summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decodemv.c
AgeCommit message (Collapse)Author
2015-02-03vp9_dthread: pass frame counts to decoder functionsYunqing Wang
The current multi-threaded tile decoder requires that the videoes are encoded with frame_parallel_decoding_mode = 1. This requirement is not necessary, and is better to be removed. This patch includes the first part of the work. Change-Id: Ic7695fb3cfe13f9022582c9f0edd2aa6e2e36d28
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
2014-12-19vp9: add per-tile longjmp error handlingJames Zern
this avoids longjmp'ing from another thread on error which will cause undesired behavior Change-Id: Ic9074ed8cc4243944bf2539d6e482f213f4e8c86
2014-12-04Clean up the logic of handling corrupted frame.hkuang
No more checking of corrupted reference frame as we skip decoding any non-intra frame in case of frame corrupted. Change-Id: I77d41bbb02fc5f61972740e2d411441eb6a17073
2014-11-05Merge "Simplify interface of write_selected_tx_size and read_tx_size"Hui Su
2014-11-04Simplify interface of write_selected_tx_size and read_tx_sizeHui Su
Change-Id: Ia2b2a895deefaaf7b34bf26df86add56dbab082c
2014-10-31Bind motion vectors with frame buffer structure.hkuang
This will save a lot of memory for decoder due to removing of prev_mi, but prev_mi is still needed in encoder. So this will increase a little bit memory for encoder. Change-Id: I24b2f1a423ebffa55a9bd2fcee1077dac995b2ed
2014-10-22vp9_ethread: allocate frame contexts outside VP9_COMMON structYunqing Wang
This patch allocated frame contexts outside VP9_COMMON. This allows multiple threads to share the same copy of frame contexts, and reduces the overhead. It also guarantees the correct update of these contexts during bitstream packing. This patch doesn't change encoding result. Change-Id: Ic181a2460b891d1d587278a6d02d8057b9dbd353
2014-10-22Implement frame parallel decode for VP9.Hangyu Kuang
Using 4 threads, frame parallel decode is ~3x faster than single thread decode and around 30% faster than tile parallel decode for frame parallel encoded video on both Android and desktop with 4 threads. Decode speed is scalable to threads too which means decode could be even faster with more threads. Change-Id: Ia0a549aaa3e83b5a17b31d8299aa496ea4f21e3e
2014-10-14Merge "Remove extra line."hkuang
2014-10-10Remove extra line.hkuang
Change-Id: I5e79c276d8953ae17cd35b2846e6e40660c037c3
2014-10-09Optimize the code to set the refernce frame right after reading the header.hkuang
Change-Id: I495cf4a366e06e3220ed132500b1ba1c8448f708
2014-10-09Remove unnecessary scale check in set_ref.hkuang
Scale check has been done in read_inter_block_mode_info. Change-Id: I6c86f93bd579109ed30ff13a04a30e35f5ae6fc5
2014-09-19Remove mi_grid_* structures.hkuang
mi_grid_* are arrays of pointer to pointer. They save the pointers that point to the MIs in cm->mi. But they are unnecessary and complicated. The original goal was to remove MODE_INFO_t copy. But with an extra MODE_INFO_t pointer inside MODE_INFO_t, same goal could be achieved. This commit totally removes the mi_grid_* structures. But there are still many dummy MODE_INFO_t inside cm->mi which are a waste of memory. Next commit will do on-demand MODE_INFO_t allocation in order to save these memories. Change-Id: I3a05cf1610679fed26e0b2eadd315a9ae91afdd6
2014-07-28Add segmentation map array for current and last frame segmentation.hkuang
The original implementation only allocates one segmentation map and this works fine for serial decode. But for frame parallel decode, each thread need to have its own segmentation map and the last frame segmentation map should be provided from last frame decoding thread. After finishing decoding a frame, thread need to serve the old segmentation map that associate with the previous decoded frame. The thread also need to use another segmentation map for decoding the current frame. Change-Id: I442ddff36b5de9cb8a7eb59e225744c78f4492d8
2014-07-24Changed validation of reference frame sizeYaowu Xu
A previous change, https://gerrit.chromium.org/gerrit/#/c/70632, introduced a size validation for reference frames to insuare the input stream is a valid VP9 stream. However, the logic requiring all reference frames have valid size turned out to be too strict. In this commit, we modify the validation to require one of the reference frame has valid dimension. In addition, the decoder reports error whenever it detects the use of reference frame with invalid scalig ratio. Change-Id: If8efc312244087556cfe00f1fcbdff811268ebad
2014-04-22Renaming MB_PREDICTION_MODE to PREDICTION_MODE.Dmitry Kovalev
Actually, it would be great to have two separate enums INTRA_MODES and INTER_MODES in future. Change-Id: I6c4147cf0002853da9c1e03fe9514eab876f01c8
2014-04-01Renaming two members in MACROBLOCKD struct.Dmitry Kovalev
Renames: mi_8x8 -> mi mode_info_stride -> mi_stride Change-Id: I66f3e5fd1e7b7f46f108af5bb711c5fd9493c1be
2014-03-21Making c++ compiler happier.Dmitry Kovalev
Change-Id: Ie224e968589bdb0774dc112e6f6df56cc0447465
2014-03-18Fixing warnings/errors from c++ compiler.Dmitry Kovalev
Change-Id: Ia561dda53f2dd10e3a10a2df2adb8027ab19397a
2014-03-13Merge "Speeding up reading of intra block modes."Dmitry Kovalev
2014-03-12Speeding up reading of intra block modes.Dmitry Kovalev
Reimplementing sub8x8-reading of intra block modes in read_intra_frame_mode_info() and read_intra_block_mode_info(). Code looks more readable as well. Change-Id: Ia42fc7d0dad708bc0c7a8bff1f8b37809b843f40
2014-03-10Removing last_mi from MACROBLOCKD struct.Dmitry Kovalev
Change-Id: Ied12b39c55667b26fd3bf90eb331e601c53a10f6
2014-03-10Adding reusable get_y_mode_prob() function.Dmitry Kovalev
Change-Id: Iebd182d7aeebc0f8964b6fd35057449bb25b00c1
2014-03-05Removing vp9_onyxd_int.h file.Dmitry Kovalev
Moving VP9Decompressor struct from vp9_onyxd_int.h to vp9_onyxd.h. Change-Id: Ic86c15e44130541a7f692db43ef9109293f99ae8
2014-02-25Merge "Consistent names for reference_mode functions."Dmitry Kovalev
2014-02-19Consistent names for reference_mode functions.Dmitry Kovalev
Change-Id: I48c9e5e4ca21e11740c750ca2eabf7e8a51c52d2
2014-02-19Adding is_mv_valid() function.Dmitry Kovalev
Change-Id: I9d036244b558765b252d8c6681b22721cb2e51bb
2014-02-12Renaming skip_coeff to skip for consistency.Dmitry Kovalev
Change-Id: I036e815ca63d00cba71202ae09ba0f6ef745dcb8
2014-01-31static function convert to inline or global vp9_blockd.hJim Bankoski
Change-Id: Ifdd951f24932839f06d1c700371662511dde6ebe
2014-01-29Renaming "mbskip" to "skip".Dmitry Kovalev
Change-Id: I27a30b43eae026a77f92958e2238d02d9cdf7832
2014-01-24Renaming INTERPOLATION_TYPE to INTERP_FILTER.Dmitry Kovalev
Corresponding renames: subpel_kernel => interp_kernel vp9_get_filter_kernel() => vp9_get_interp_kernel() pred_filter_type => pred_interp_filter adaptive_pred_filter_type => adaptive_pred_interp_filter mcomp_filter_type => interp_filter read_interp_filter_type() => read_interp_filter() write_interp_filter_type() => write_interp_filter() fix_mcomp_filter_type() => fix_interp_filter() Change-Id: I1fa61fa1dc81ebbf043457c3ee2d8d4515bee6d3
2014-01-16Deprecate the use of best_mv in decoding processJingning Han
This commit removes the use of best_mv in the decoding process. This variable can be replaced with nearest_mv. It saves a few cycles on assigning the values for best_mv. Change-Id: Ic183f9c1fb615c54efd7e6ccfedcf09d493435e4
2013-12-26Merge "Removing vp9_findnearmv.{h, c} files."Dmitry Kovalev
2013-12-20Renaming vp9_dboolhuff.{h, c} to vp9_reader.{h, c}.Dmitry Kovalev
Change-Id: I50c009ff8108bda1c57427f23d63a79c04f7e776
2013-12-19Removing vp9_findnearmv.{h, c} files.Dmitry Kovalev
Moving all code from that files to vp9_mvref_common.{h, c}. Change-Id: Ibc4afcb8cea6847166ff411130e93611ebe63b20
2013-12-16Add const to match declarationJohann
The definition fell out of sync in I7d2fda72de5fc27e86c6589543b41fa044681dbf Change-Id: I3ce3f6ba96bb121f51efaa08f64a69ad9f731a9e
2013-12-13Merge "Cleaning up vp9_append_sub8x8_mvs_for_idx()."Dmitry Kovalev
2013-12-13Merge "vp9 asserts: fix compile warning"James Zern
2013-12-12Moving mi configuration loop from vp9_read_mode_info to set_offsets.Dmitry Kovalev
set_offsets() is a right place to configure all mi-related pointers. Change-Id: I7d2fda72de5fc27e86c6589543b41fa044681dbf
2013-12-12vp9 asserts: fix compile warningJames Zern
string literal to int within an assert Change-Id: I0c889256b67a078e6e2a79577f0b7ae084243258
2013-12-10Cleaning up vp9_append_sub8x8_mvs_for_idx().Dmitry Kovalev
Replacing if-else with switch statement, reordering function arguments. Change-Id: I4825d2ef311ba8999b6d4ceb0eef003587a13434
2013-12-10Merge "Cleaning up skip context calculation."Dmitry Kovalev
2013-12-10Merge "Cleaning up read_inter_block_mode_info() function."Dmitry Kovalev
2013-12-10Cleaning up skip context calculation.Dmitry Kovalev
Renames: vp9_get_pred_context_mbskip => vp9_get_skip_context vp9_get_pred_prob_mbskip => vp9_get_skip_prob Change-Id: I2af499848ef73f3f5cd8cdb27852d0bcdfe31d09
2013-12-10Merge "Renaming comp_pred_mode to reference_mode."Dmitry Kovalev
2013-12-09Renaming comp_pred_mode to reference_mode.Dmitry Kovalev
Change-Id: I83ffed2b1878a35ac35f07f9ee74309adc9c7b11
2013-12-09Cleaning up read_inter_block_mode_info() function.Dmitry Kovalev
Change-Id: Ib4e215a80f00e342d857a54a4ca1b2dc82b6db1d