Commit Graph

1300 Commits

Author SHA1 Message Date
Yunqing Wang
bcee56bed5 Minor fix: add back a vpx_free call
Added back a vpx_free call that was mistakenly removed.

Change-Id: Ib662933a8697a4efb8534b5b9b762ee6c2777459
2012-03-21 14:09:33 -04:00
Yunqing Wang
9ed1b2f09e Merge "Add motion search skipping in first pass" 2012-03-16 14:02:51 -07:00
Yunqing Wang
6a819ce4fe Add motion search skipping in first pass
This change added a motion search skipping mechanism similar
to what we did in second pass. For a macroblock that is very
similar to the macroblock at same location on last frame,
we can set its mv to be zero, and skip motion search. This
improves first-pass performance for slide shows and video
conferencing clips with a slight PSNR loss.

Change-Id: Ic73f9ef5604270ddd6d433170091d20361dfe229
2012-03-16 15:59:00 -04:00
Johann
e68953b7c8 Merge "RFC: Reorganize MFQE loops" 2012-03-16 11:35:18 -07:00
Scott LaVarnway
9aa2bd8a03 Merge "x_motion_minq table reduction" 2012-03-16 09:03:47 -07:00
John Koleszar
422f97d7ab Merge "fix potential use of uninitialized rate_y" 2012-03-14 12:00:27 -07:00
John Koleszar
20cd3e6b8f fix potential use of uninitialized rate_y
This issue likely doesn't appear in the unmodified encoder, but
sufficient hacking on the mode selection loop can expose it.

Change-Id: I8a35831e8f08b549806d0c2c6900d42af883f78f
2012-03-14 10:10:30 -07:00
Jim Bankoski
6b66c01c88 Merge "Adds a motion compensated temporal denoiser to the encoder." 2012-03-13 16:18:57 -07:00
Stefan Holmer
9c41143d66 Adds a motion compensated temporal denoiser to the encoder.
Some refactoring in rdopt.c and pickinter.c.

Change-Id: I4f50020eb3313c37f4d441d708fedcaf219d3038
2012-03-13 15:33:50 -07:00
Jim Bankoski
e9cacfd66d Merge "Update for key frame target size setting." 2012-03-13 10:13:03 -07:00
Marco Paniconi
301409107f Update for key frame target size setting.
Set an iniital/minimun boost level for the frame rate
factor of key frame target size setting.

Change-Id: If2586f4ac76a1fa89378aa652a58607356a1f426
2012-03-12 16:23:08 -07:00
Johann
ddf94f6184 Merge "Move SAD and variance functions to common" 2012-03-12 15:08:48 -07:00
Scott LaVarnway
7a1590713e Merge changes I9c26870a,Ifabb0f67
* changes:
  threading.c refactoring
  Decoder loops refactoring
2012-03-09 10:48:11 -08:00
Scott LaVarnway
9ed874713f threading.c refactoring
Added recon above/left to MACROBLOCKD
Reworked decode_macroblock

Change-Id: I9c26870af75797134f410acbd02942065b3495c1
2012-03-08 15:27:41 -05:00
Johann
fd903902ef RFC: Reorganize MFQE loops
Break MFQE code into it's own file.

It is currently only valid for 16x16 and 8x8 Y blocks. It also filters
4x4 U/V blocks.

Refactor filtering and add associated assembly. Limited test cases show
--mfqe introduces a penalty of ~20% with HD content. The assembly
reduces the penalty to ~15%

Change-Id: I4b8de6b5cdff5413037de5b6c42f437033ee55bf
2012-03-06 15:20:03 -08:00
Jim Bankoski
154b4b4196 vp8e - RDLambda fix
Last commit went the wrong way.

Change-Id: I5e47ee6c25b0893dfa84318229b93c57dfeec24e
2012-03-06 08:47:12 -08:00
Johann
e50f96a4a3 Move SAD and variance functions to common
The MFQE function of the postprocessor depends on these

Change-Id: I256a37c6de079fe92ce744b1f11e16526d06b50a
2012-03-05 16:50:33 -08:00
Jim Bankoski
888699091d vp8e - fix coefficient costing
Coefficient costing failed to take account of the first branch
being skipped ( 0 vs eob) if the previous token is 0.

Fixed rd to account for slightly increased token cost & cleaned up
warning message

Change-Id: I56140635d9f48a28dded5a816964e973a53975ef
2012-03-05 08:20:42 -08:00
Jim Bankoski
a60461a340 Merge "vp8e - attempt to lessen blockiness" 2012-03-01 11:47:09 -08:00
Jim Bankoski
f0f609c2e2 Merge "vp8e - static key boost" 2012-03-01 11:23:10 -08:00
Jim Bankoski
91b5c98b3d Merge "vp8e - force at least some change in over and under shoots" 2012-03-01 11:22:52 -08:00
Paul Wilkins
8d07a97acc vp8e - static key boost
This seeks to boost the size of the keyframe if the entire section
is a single frame clip

Change-Id: I3c00268dc155b047dc4b90e514cf403d55a4f8ef
2012-03-01 10:39:41 -08:00
Paul Wilkins
6d84322762 vp8e - force at least some change in over and under shoots
Change-Id: Ie1796f272dc33bf5a1c8ac990da625961d272aa9
2012-03-01 10:35:22 -08:00
Attila Nagy
52cf4dcaea Packing bitstream on-the-fly with delayed context updates
Produce the token partitions on-the-fly, while processing each MB.
Context is updated at the beginning of each frame based on the
previoud frame's counters. Optimally encoder outputs partitions in
separate buffers. For frame based output, partitions are concatenated
internally.

Limitations:
    - enabled just in combination with realtime-only mode
    - number of encoding threads has to be equal or less than the
    number of token partitions. For this reason, by default the encoder
    will do 8 token partitions.
    - vpxenc supports partition output (-P) just in combination with
    IVF output format (--ivf)

Performance:
    - Realtime encoder can be up to 13% faster (ARM) depending on the number
    of threads and bitrate settings. Constant gain over the 5-16 speed
    range.
    - Token buffer reduced from one frame to 8 MBs

Quality:
    - quality is affected by the delayed context updates. This again
    dependents on input material, speed and bitrate settings. For VC
    style input the loss seen is up to 0.2dB. If error-resilient=2
    mode is used than the effect of this change is negligible.

Example:
./configure --enable-realtime-only --enable-onthefly-bitpacking
./vpxenc --rt --end-usage=1 --fps=30000/1000 -w 640 -h 480
--target-bitrate=1000 --token-parts=3 --static-thresh=2000
--ivf -P -t 4 -o strm.ivf tanya_640x480.yuv

Change-Id: I127295cb85b835fc287e1c0201a67e378d025d76
2012-02-29 12:13:37 -05:00
Jim Bankoski
b8fa2839a2 vp8e - attempt to lessen blockiness
applies a penalty to intra blocks in order to cut down on blockiness in
easy sections.

Change-Id: Ia9e5df16328b0bf01bf0f2e6e61abcb687316c12
2012-02-29 09:03:13 -08:00
Scott LaVarnway
2578b767c3 Decoder loops refactoring
Eliminated some mb branches along with other code cleanups.
This is part of an ongoing effort to remove cut/paste
code in the decoder.

Change-Id: Ifabb0f67cafa6922b5a0e89a0d03a9b34e9e5752
2012-02-29 10:38:14 -05:00
Scott LaVarnway
ce328b855f Merge changes Ifb450710,I61c4a132
* changes:
  Eliminated reconintra_mt.c
  Eliminated vp8mt_build_intra_predictors_mbuv_s
2012-02-28 11:42:45 -08:00
Scott LaVarnway
aab70f4d7a Merge "Removed duplicate code in threading.c" 2012-02-28 11:25:43 -08:00
Scott LaVarnway
bcba86e2e9 Eliminated reconintra_mt.c
Reworked the code to use vp8_build_intra_predictors_mby_s,
vp8_intra_prediction_down_copy, and vp8_intra4x4_predict_d_c
functions instead.  vp8_intra4x4_predict_d_c is a decoder-only
version of vp8_intra4x4_predict.  Future commits will fix this
code duplication.

Change-Id: Ifb4507103b7c83f8b94a872345191c49240154f5
2012-02-28 14:12:30 -05:00
Scott LaVarnway
9a4052a4ec Removed duplicate code in threading.c
Change-Id: Id7e44950ceda67b280e410e541510106ef02f1da
2012-02-28 14:00:32 -05:00
Yunqing Wang
b1bfd0ba87 Merge "Only do uv intra-mode evaluation when intra mode is checked" 2012-02-28 10:11:24 -08:00
Yunqing Wang
019384f2d3 Only do uv intra-mode evaluation when intra mode is checked
When we encode slide-show clips, for the majority of the time,
only ZEROMV mode is checked, and all other modes are skipped.
This change delayed uv intra-mode evaluation until intra mode is
actually checked. This gave big performance gain for slide-show
video encoding (2nd pass gain: 18% to 28%). But, this change
doesn't help other types of videos.

Also, zbin_mode_boost is adjusted in mode-checking loop, which
causes bitstream mismatch before/after this change when --best
or --good with --cpu-used=0 are used.

Change-Id: I582b3e69fd384039994360e870e6e059c36a64cc
2012-02-28 13:08:17 -05:00
James Berry
e2c6b05f9a bugfix: use oxcf width/height for reinit check
use oxcf instead of common in check to Reinit the
lookahead buffer if the frame size changes
prior behavior would cause assertion fail/crash

first observed in:
support changing resolution with vpx_codec_enc_config_set

Change-Id: Ib669916ca9b4f206d4cc3caab5107e49d39a36aa
2012-02-27 16:10:45 -05:00
Yunqing Wang
61c5e31ca1 Merge "Fix skippable evaluation in mode decision" 2012-02-27 11:06:13 -08:00
John Koleszar
02a31e6b3c Merge "decoder: reset segmentation map on keyframes" 2012-02-27 09:58:29 -08:00
Yunqing Wang
84be08b07f Fix skippable evaluation in mode decision
Yaowu fixed the skippable evaluation by correcting 2nd order
block's eob.

Change-Id: Id47930cbc74a90a046c0c0e324efb03477639ee0
2012-02-27 12:45:12 -05:00
James Berry
313bfbb6a2 Merge "Add unit tests for idctllm_test and idctllm_mmx" 2012-02-23 08:50:36 -08:00
Jim Bankoski
2089f26b08 Merge "Remove the frame rate factor for key frame size." 2012-02-23 08:38:44 -08:00
Marco Paniconi
507ee87e3e Remove the frame rate factor for key frame size.
When temporal layers is used (i.e., number_of_layers > 1),
we don't use the frame rate boost for setting the key
frame target size. The factor was forcing the target size to be
always at its minimum (2* per_frame_bandwidth) for low frame rates
(i.e., base layer frame rate).

Generally we should modify or remove this frame rate factor;
for now we turn if off for number_of_layers > 1.

Change-Id: Ia5acf406c9b2f634d30ac2473adc7b9bf2e7e6c6
2012-02-22 15:25:32 -08:00
Scott LaVarnway
f2bd11faa4 Eliminated vp8mt_build_intra_predictors_mbuv_s
Reworked the code to use vp8_build_intra_predictors_mbuv_s
instead.  This is WIP with the goal of eliminating all
functions in reconintra_mt.h

Change-Id: I61c4a132684544b24a38c4a90044597c6ec0dd52
2012-02-21 14:59:05 -05:00
James Berry
0c1cec2205 Add unit tests for idctllm_test and idctllm_mmx
add unit tests for vp8_short_idct4x4llm_c

Change-Id: I472b7c0baa365ba25dc99a3f6efccc816d27c941
2012-02-21 14:52:36 -05:00
John Koleszar
dadc9189ed Merge changes I0341554f,I64e110c8
* changes:
  Consolidate C version of token packing functions
  Multithreaded encoder, late sync loopfilter
2012-02-21 10:09:23 -08:00
Scott LaVarnway
f05feab7b9 Merge "Remove redundant init of segment_counts in vp8_encode_frame" 2012-02-21 09:51:02 -08:00
John Koleszar
02360dd2c2 Merge "Update encoder mb_skip_coeff and prob_skip_false calculation" 2012-02-21 09:48:26 -08:00
Yunqing Wang
f93b1e7be1 Merge "Fix incorrect use of uv eobs in intra modes" 2012-02-17 10:43:05 -08:00
Yunqing Wang
04b9e0d787 Fix incorrect use of uv eobs in intra modes
In vp8_rd_pick_inter_mode(), if total of eobs is zero, rate needs
to be adjusted since there are no non-zero coefficients for
transmission. The uv intra eobs calculated in
rd_pick_intra_mbuv_mode() need to be saved before they are
overwritten by inter-mode eobs.

Change-Id: I41dd04fba912e8122ef95793d4d98a251bc60e58
2012-02-17 09:15:08 -05:00
Attila Nagy
ce42e79abc Update encoder mb_skip_coeff and prob_skip_false calculation
mode_info_context->mbmi.mb_skip_coeff has to always reflect the
existence or not of coeffs for a certain MB. The loopfilter needs this
info.
mb_skip_coeff is either set by the vp8_tokenize_mb or has to be set to
1 when the MB is skipped by mode selection. This has to be done
regardless of the mb_no_coeff_skip value.

prob_skip_false is needed just when mb_no_coeff_skip is 1. No need to
keep count of both skip_false and skip_true as they are complementary
(skip_true+skip_false = total_mbs)

Change-Id: I3c74c9a0ee37bec10de7bb796e408f3e77006813
2012-02-17 14:27:40 +02:00
Attila Nagy
565d0e6feb Remove redundant init of segment_counts in vp8_encode_frame
segment_counts was zero init twice in the beginning of vp8_encode_frame.

Change-Id: Ibc29f6896dabd9aab1d0993f3941cf6876022e70
2012-02-17 09:51:24 +02:00
Johann
6b151d436d Clarify 'max_sad' usage
Depending on implementation the optimized SAD functions may return early
when the calculated SAD exceeds max_sad.

Change-Id: I05ce5b2d34e6d45fb3ec2a450aa99c4f3343bf3a
2012-02-16 15:17:44 -08:00
John Koleszar
e8223bd250 decoder: reset segmentation map on keyframes
Refactoring some of the mode decoding logic introduced a bug where
the segmentation maps would not be properly reset on keyframes.

http://code.google.com/p/webm/issues/detail?id=378

The text of the bug is somewhat misleading as I initially read it to
imply the bug was present in v0.9.7-p1 (Cayuga), but note the text
"master", which indicates this was something subsequent. This issue
bisects back to v0.9.7-p1-84-ga99c20c, so unfortunately it was broken
during the Duclair release.

Thanks to Alexei Leonenko for investigating the root cause.

Change-Id: I9713c9f070eb37b31b3b029d9ef96be9b6ea2def
2012-02-16 12:22:18 -08:00