summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_pickmode.c
AgeCommit message (Collapse)Author
2015-03-20vp9_pred_mv(): misc fixes and optimizationsYaowu Xu
1. skip near if it is same as nearest 2. correct rounding for converting mv to fullpel position 3. update pred_mv_sad after new mv search. Overall .1%~.25% compression gains on rtc set for speed 5, 6, 7, 8. Change-Id: Ic300ca53f7da18073771f1bb993c58cde9deee89
2015-03-18Speed up non-rd mode decision searchJingning Han
This commit makes the encoder to explicitly calculate the SAD associated with the LAST_FRAME motion vector and compare it to that of the GOLDEN_FRAME given by integral projection motion estimation. It skips the expensive sub-pixel motion search over GOLDEN_FRAME when the LAST_FRAME can provide fairly good motion compensated prediction quality. For dark720p speed -6 single thread goes from 33304 b/f, 40.070 dB, 18156 ms -> 33319 b/f, 40.061 dB, 17611 ms Change-Id: I01bc94b9b598075567a392111046b97a9bc30efe
2015-03-17Fix an ioc warning in vp9_pick_inter_modeJingning Han
Shut off all the metric checks for golden reference frame, if we decide that it is unlikely to be selected for reference. Change-Id: Ie457cc1fd43935584403b4982659aed80fb9909c
2015-03-16Merge "Remove duplicate clamping"Yaowu Xu
2015-03-16Merge "Remove ineffective newmv skip checking from vp9_pick_inter_mode"Jingning Han
2015-03-16Merge "Simplify prediction filter search in rtc coding mode"Jingning Han
2015-03-16Remove duplicate clampingYaowu Xu
The mvs are clamped in the vp9_find_best_ref_mvs() already. Change-Id: I9bea5e35aef6007466fe7fca4bc2dc5c17e74222
2015-03-16Remove ineffective newmv skip checking from vp9_pick_inter_modeJingning Han
Change-Id: I41ee684cf113a7b5edf280183e51cb08b2e93cc4
2015-03-16Simplify prediction filter search in rtc coding modeJingning Han
Reduce unnecessary fetch from MB_MODE_INFO. Change-Id: Iff89b76d5e2774c00a564e902913a633fa2e1ea9
2015-03-16change the order of inter modes evaluatedYaowu Xu
Change-Id: I10c1ad23b110cf92cb026e895039c215c47abfd0
2015-03-16vp9_pick_inter_mode(): minor optimizationsYaowu Xu
1. remove duplicate initialization to mbmi->interp_filter. 2. move mv clamping into ref_frame loop instead of mode checking loop. 3. move the check if last frame is same as golden frame earlier to avoid initialization of Golden reference related variables. Change-Id: Idf2d05e19e94a24f69cc289687869fc71d2ff289
2015-03-13Merge "Reconcile active_map and cyclic refresh"Alex Converse
2015-03-12Merge "vp9_pick_inter_mode(): Use single loop to evaluate inter modes"Yaowu Xu
2015-03-12Merge "Minorly modify model_rd_for_sb_y function"Yunqing Wang
2015-03-12Reconcile active_map and cyclic refreshAlex Converse
Change-Id: Id7f8654aeeb20caa402bc822521b1d72c658f4f9
2015-03-12vp9_pick_inter_mode(): Use single loop to evaluate inter modesYaowu Xu
This commit changes to use single loop to evaluate all inter modes. There is no impact on compression quality and speed, but allow future experiment with the order of modes evaluated. Change-Id: I71696ce1014cbe127e25e98710d835987f5ecc09
2015-03-12Minorly modify model_rd_for_sb_y functionYunqing Wang
Added a skip_dc check. If skip_dc = 1, we could eliminate calling of vp9_model_rd_from_var_lapndz(). This gave slight PSNR & SSIM gain(<0.1%), and no speed change. Change-Id: If5ca733366148c86b98e196a00cc890f50e9a3e5
2015-03-11Remove unnecessary speed feature checkingJingning Han
This commit removes the pred_mv_sad comparison from rtc motion search, given that a stronger comparison has been done at the mode search level to eliminate unlikely selected reference frames. Change-Id: I49b8d24b2174303066fd8eff2102c0648f2869df
2015-03-11Apply fast motion search to golden reference frameJingning Han
This commit enables the rtc coding mode to run integral projection based motion search for golden reference frame. It improves the speed -6 compression performance by 1.1% on average, 3.46% for jimred_vga, 6.46% for tacomascmvvga, and 0.5% for vidyo clips. The speed -6 is about 6% slower. Change-Id: I0fe402ad2edf0149d0349ad304ab9b2abdf0c804
2015-03-10Separate rd_thresh adaption by ref_frameYaowu Xu
Only update the rd_thresh factors for modes sharing same reference frame. This helps overall compression of 6 and 7 by .13% and .19% respectively without any noticeable speed difference. Change-Id: Idb3a3879512c5d7d0880034516079949290690c5
2015-03-09Merge "Skip golden ref frame check when it is same as last ref frame"Jingning Han
2015-03-09Skip golden ref frame check when it is same as last ref frameJingning Han
When golden reference frame is refreshed, the next frame has both its last and golden reference frames point to the same reference frame in real-time coding mode. Experiments suggest that using two separate reference frames for frames right after golden refresh frame does not provide further compression performance advantage. This commit hence retains the current encoder implementation and shuts off the mode search over golden reference frame in this case. It makes the encoder run slightly faster at no coding performance change. Change-Id: I1561f7799253a10e675d05c63c1749fe9e85b472
2015-03-06Modify the setting of transform skip flags in non-rd modeYunqing Wang
While searching for the best mode in non-rd case, SSE of a partition block is calculated and the transform size is set. This patch rewrites the skip checking conditions based on transform size instead of partition size to be more precise. Small gains were seen in rtc set borg test (speed 6). AVG PSNR: 0.087%, overall PSNR: 0.073%, SSIM: 0.146%. No noticeable speed change. Change-Id: I5603ca5339c784dfa02263f4005988ccd8c32f6e
2015-03-04Make encoder buffer allocation dynamicAdrian Grange
Frame buffers are now allocated dynamically on-demand. Entries in the reference frame map, cm->ref_frame_map, may now be set to -1 (INVALID_IDX) to indicate that there is not a valid reference buffer in that "slot". All slots in the reference frame map are now initialized to the empty state (-1) and each buffer is initialized to have a reference count of 0. Change-Id: Id1afe98de98db4ae8b2dfefed7889c3b28c68582
2015-03-01Use variance metric for integral projection vector matchJingning Han
This commit replaces the SAD with variance as metric for the integral projection vector match. It improves the search accuracy in the presence of slight light change. The average speed -6 compression performance for rtc set is improved by 1.7%. No speed changes are observed for the test clips. Change-Id: I71c1d27e42de2aa429fb3564e6549bba1c7d6d4d
2015-02-20Merge "Adjustments to cyclic refresh (aq-mode=3)."Marco
2015-02-20Merge "Add high bit depth support to rtc sub8x8 block coding"Jingning Han
2015-02-20Adjustments to cyclic refresh (aq-mode=3).Marco
Target higher delta-qp for big blocks with zero motion, and for segment#1: avoid 64x64 partition size and force 8x8 tx size. Metrics on RTC set mostly positive: SSIM up by ~4%, PSRN by ~1.5%. Doesn't seem to be any change in speed. Change-Id: I1f68fa3c4f62dab3b90cc58041f05ebb048ae5ac
2015-02-20Add high bit depth support to rtc sub8x8 block codingJingning Han
This commit adds proper buffer handle to support high bit depth in rtc sub8x8 block coding. Change-Id: Ibaf8a2160194121aec9ca68b8094817fed9ccaea
2015-02-19Improve skip_txfm thresholds in the non-rd mode selectionYunqing Wang
Modified the thresholds of deciding whether or not to skip the transforms in model_rd_for_sb_y(). Used zbin[] instead of dequant[] to be more precise. Also, modified the checking coditions. Rtc set borg test results (at speed 6) showed: average PSNR gain: 0.138%, overall PSNR gain: 0.158%, and SSIM gain: 0.177%. The data rate test was modified slightly as suggested by Marco. Change-Id: Ieaf633ab77f4838cb3c45cf69065b29d55f8ae6c
2015-02-13Replace some operations with shift in encoder_breakout.Marco
Replaced a divide by 9 with 8, so some very small difference, but otherwise no change in behavior. Change-Id: I1079ae3c41e0789ff0bc6fa9940a238b6bca0f5b
2015-02-11Add mode cost to sub8x8 block mode decision in rtc codingJingning Han
This commit allows the encoder to properly account for the mode cost in sub8x8 non-RD mode decision. Change-Id: I2951960d20e37ed08e372ee0c7044935b2b9b899
2015-02-11Merge "Account for inter prediction filter rate cost in rtc mode selection"Jingning Han
2015-02-11Account for inter prediction filter rate cost in rtc mode selectionJingning Han
Add the rate cost on inter prediction filter type to the overall rate-distortion cost in vp9_pick_mode_inter. Change-Id: I72c34017adf5220cadb3962694ee5404469fc673
2015-02-11Add ref frame rate cost to non-RD mode decisionJingning Han
This commit adds a heuristic rate cost of reference frame to the non-RD mode decision. It improves the compression performance of speed -6 by 0.31% and speed -5 by 0.69%. Change-Id: If7f3b45519d49b2cb640bcb7316a254efc8be446
2015-02-06Re-arrange inter mode search order in RTC coding flowJingning Han
This commit makes the ZEROMV mode first in the search order to ensure that the zero mv is always checked in the RTC coding mode. It improves the average speed -6 compression performance by 0.3% in both PSNR and SSIM at no visible speed change. Change-Id: I465a7e59f4e20cd84fee3f02ced6f98036945949
2015-02-04Save an extra call for setup_pred_plane functionJingning Han
Reuse the yv12_mb array to fetch the buffer pointers/strides corresponding to the current reference frame. Change-Id: I5276b7494158b2cccef15213be2dc189e9036851
2015-02-04Account for chroma component costs in RTC mode decisionJingning Han
This commit allows the encoder to account for additional chroma plane costs in the mode decision process, if the current block potentially contains significant color change. It improves the visual quality at very low bit-rates. The compression performance of dark720p is improved by 12.39% in speed 6. For jimred at 150 kbps, the PSNR of V component (red) increased by 0.2 dB, at the expense of about 5% increase in encoding time. Note that for sequences where the chroma components are fairly consistent, the encoding time increase is negligible. On average the rtc set compression performance is improved by 1.172% in PSNR and 1.920% in SSIM. Change-Id: Ia55b24ef23a25304f7ec9958fbf07fd6e658505c
2015-01-30Try again to merge branch 'frame-parallel' into master branch.hkuang
In frame parallel decode, libvpx decoder decodes several frames on all cpus in parallel fashion. If not being flushed, it will only return frame when all the cpus are busy. If getting flushed, it will return all the frames in the decoder. Compare with current serial decode mode in which libvpx decoder is idle between decode calls, libvpx decoder is busy between decode calls. Current frame parallel decode will only speed up the decoding for frame parallel encoded videos. For non frame parallel encoded videos, frame parallel decode is slower than serial decode due to lack of loopfilter worker thread. There are still some known issues that need to be addressed. For example: decode frame parallel videos with segmentation enabled is not right sometimes. * frame-parallel: Add error handling for frame parallel decode and unit test for that. Fix a bug in frame parallel decode and add a unit test for that. Add two test vectors to test frame parallel decode. Add key frame seeking to webmdec and webm_video_source. Implement frame parallel decode for VP9. Increase the thread test range to cover 5, 6, 7, 8 threads. Fix a bug in adding frame parallel unit test. Add VP9 frame-parallel unit test. Manually pick "Make the api behavior conform to api spec." from master branch. Move vp9_dec_build_inter_predictors_* to decoder folder. Add segmentation map array for current and last frame segmentation. Include the right header for VP9 worker thread. Move vp9_thread.* to common. ctrl_get_reference does not need user_priv. Seperate the frame buffers from VP9 encoder/decoder structure. Revert "Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:""" Conflicts: test/codec_factory.h test/decode_test_driver.cc test/decode_test_driver.h test/invalid_file_test.cc test/test-data.sha1 test/test.mk test/test_vectors.cc vp8/vp8_dx_iface.c vp9/common/vp9_alloccommon.c vp9/common/vp9_entropymode.c vp9/common/vp9_loopfilter_thread.c vp9/common/vp9_loopfilter_thread.h vp9/common/vp9_mvref_common.c vp9/common/vp9_onyxc_int.h vp9/common/vp9_reconinter.c vp9/decoder/vp9_decodeframe.c vp9/decoder/vp9_decodeframe.h vp9/decoder/vp9_decodemv.c vp9/decoder/vp9_decoder.c vp9/decoder/vp9_decoder.h vp9/encoder/vp9_encoder.c vp9/encoder/vp9_pickmode.c vp9/encoder/vp9_rdopt.c vp9/vp9_cx_iface.c vp9/vp9_dx_iface.c This reverts commit a18da9760a74d9ce6fb9f875706dc639c95402f5. Change-Id: I361442ffec1586d036ea2e0ee97ce4f077585f02
2015-01-23Revert "Merge branch 'frame-parallel' to enable frame parallel decode in ↵Johann
master branch." This reverts commit bde04ce5039cbcf86c8b34bdb4127e18d7e1d0c7 Change-Id: I053dae04c761b04a36dc239558503905a14d2470
2015-01-22Merge branch 'frame-parallel' to enable frame parallel decode in master branch.hkuang
In frame parallel decode, libvpx decoder decodes several frames on all cpus in parallel fashion. If not being flushed, it will only return frame when all the cpus are busy. If getting flushed, it will return all the frames in the decoder. Compare with current serial decode mode in which libvpx decoder is idle between decode calls, libvpx decoder is busy between decode calls. VP9 frame parallel decode is >30% faster than serial decode with tile parallel threading which will makes devices play 1080P VP9 videos more easily. * frame-parallel: Add error handling for frame parallel decode and unit test for that. Fix a bug in frame parallel decode and add a unit test for that. Add two test vectors to test frame parallel decode. Add key frame seeking to webmdec and webm_video_source. Implement frame parallel decode for VP9. Increase the thread test range to cover 5, 6, 7, 8 threads. Fix a bug in adding frame parallel unit test. Add VP9 frame-parallel unit test. Manually pick "Make the api behavior conform to api spec." from master branch. Move vp9_dec_build_inter_predictors_* to decoder folder. Add segmentation map array for current and last frame segmentation. Include the right header for VP9 worker thread. Move vp9_thread.* to common. ctrl_get_reference does not need user_priv. Seperate the frame buffers from VP9 encoder/decoder structure. Revert "Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:""" Conflicts: test/codec_factory.h test/decode_test_driver.cc test/decode_test_driver.h test/invalid_file_test.cc test/test-data.sha1 test/test.mk test/test_vectors.cc vp8/vp8_dx_iface.c vp9/common/vp9_alloccommon.c vp9/common/vp9_entropymode.c vp9/common/vp9_loopfilter_thread.c vp9/common/vp9_loopfilter_thread.h vp9/common/vp9_mvref_common.c vp9/common/vp9_onyxc_int.h vp9/common/vp9_reconinter.c vp9/decoder/vp9_decodeframe.c vp9/decoder/vp9_decodeframe.h vp9/decoder/vp9_decodemv.c vp9/decoder/vp9_decoder.c vp9/decoder/vp9_decoder.h vp9/encoder/vp9_encoder.c vp9/encoder/vp9_pickmode.c vp9/encoder/vp9_rdopt.c vp9/vp9_cx_iface.c vp9/vp9_dx_iface.c Change-Id: Ib92eb35851c172d0624970e312ed515054e5ca64
2015-01-08Merge "Initalize zeromv_sse and newmv_sse in vp9_pick_inter_mode"Jingning Han
2015-01-07Initalize zeromv_sse and newmv_sse in vp9_pick_inter_modeJingning Han
These two parameters are used to control the denoiser cut-off thresholds. They should be properly initialized when starting mode search of a given block. Change-Id: Iba8a25487026a0dbe0d350c347d7e4e4e237b637
2015-01-07Fix best ref frame rd cost update in sub8x8 non-RD mode searchJingning Han
This fixes the issue that sub8x8 inter blocks always end up with GOLDEN_FRAME. Change-Id: Id0c25cbb9c2003f43b4dff8fb1572512c246e077
2015-01-07Format fix in vp9_pick_inter_mode_sub8x8Jingning Han
Replace ref_frame++ with ++ref_frame. Change-Id: Ic39793081156c314bf1b85d5ab76def97f3bff52
2015-01-02Merge "Remove redundant local variable for segment_id"Jingning Han
2015-01-02Remove redundant local variable for segment_idJingning Han
Use mbmi->segment_id directly in vp9_pick_inter_mode. The value is set outside this function, hence no need to assign it again. Change-Id: I3d63cdd2e4fadf62ccdefada638b00d979eb3741
2015-01-02Merge "Use less tmp motion vectors in vp9_pick_inter_mode_sub8x8"Jingning Han
2015-01-02Merge "Enable sub8x8 inter block search for RTC coding mode"Jingning Han
2014-12-30Use less tmp motion vectors in vp9_pick_inter_mode_sub8x8Jingning Han
This commit simplifies the reference motion vector part for sub8x8 block coding in RTC mode and reduces the required local variables. Change-Id: I470d1482092563b68af22404dc1f497e7457b0a8