summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decoder.c
AgeCommit message (Collapse)Author
2018-12-06vp9 decoder: cleanup on exit if no available frame buffer.Jerome Jiang
There was no setjmp on vpx_internal_error when there is no available frame buffer, ready_for_new_data is not reset to 1. BUG=webm:1571 Change-Id: I4f8efffb7d6fed3085b1f0229d0d1071a056b6c6
2018-10-25Add Memory to Enable Row DecodeRitu Baldwa
Row based multi-thread needs extra memory to store the parsed co-efficients, partitions and eob. This commit adds memory for the same. Change-Id: I13fa4a6ada2ec3048bc973e465055b832429388f
2018-09-12Fix buffer overrun of postproc_state.limitsMatthias Räncker
Always allocate cpi->common.postproc_state.limits using unscaled width. With ./configure --enable-pic --enable-decode-perf-tests --enable-encode-perf-tests --enable-encode-perf-tests --enable-vp9-highbitdepth --enable-better-hw-compatibility --enable-internal-stats --enable-postproc --enable-vp9-postproc --enable-error-concealment --enable-coefficient-range-checking --enable-postproc-visualizer --enable-multi-res-encodin --enable-vp9-temporal-denoising --enable-webm-io --enable-libyuv segfaults tend to occur in VP9/DatarateOnePassCbrSvcSingleBR.* tests. This is an analogue to issue https://bugs.chromium.org/p/webm/issues/detail?id=1374 where a buffer allocated using a scaled width is reused after scaling back to the original size. Unfortunately, in this case the unscaled width doesn't appear to be known in the immediated context of the allocation, so the the signature of vp9_post_proc_frame needs to be changed to provide that information in order to provide a similar fix as in #1374. Signed-off-by: Matthias Räncker <theonetruecamper@gmx.de> Change-Id: I6f943aafbb3484ee94c5b38d7fcdd9d53fce3e5f
2018-08-27Rework enc/dec mismatch detectionJingning Han
The previous enc/dec mismatch detection assumes the previously reconstructed frame would always stay at frame buffer pool index at 0. It could hence cause certain delay in enc/dec mismatch detection when the immediate reconstruction frame is not yet propagated to index 0 in the buffer map pool. This change always keeps the latest decoded show frame buffer index and directly gets the reconstructed frame from encoder and decoder buffer pools to check for mismatch. Change-Id: If53092cbc42ab78d55af5b83f12a489fc362f3ae
2018-07-12Backport libaom bug fixes.Wan-Teh Chang
libaom commit 80a5b09337a80093e1e7ae5eb540020a22949805: dec_free_mi: Reset cm->mi_alloc_size. libaom commit fb0dd0bb80fc95ef016f1421b105a52fffa32816: Clear cm->width and cm->height on alloc failure. libaom commit ccb27264089a8cfa1334391ebbcb6a11b8dff442: Misc. resize fixes along with the resize test Note: only the change to enc_free_mi in av1/encoder/encoder.c is merged. Change-Id: I602813230d40125e59608fa013085dca3e160c33
2017-11-09vp9: Fix mem rel for non-ref for external buffer.Jerome Jiang
Release frame buffers for non-ref when the decoder is destroyed. Enable the non ref test. BUG=b/68819248 Change-Id: Id87ef3b0a62318f9812e927cd957c05c859047fa
2017-07-05vp9: remove FrameWorkerData & vp9_dthread.hJames Zern
the file was empty after the struct removal. the only remaining use was within vp9_dx_iface, but the wrapper became unnecessary after the removal of frame_parallel_decode. BUG=webm:1395 Change-Id: I515ab585d701e77d388d12b2802d844c424f9bcd
2017-07-05vp9: remove (un)lock_buffer_poolJames Zern
there is no threaded access to this pool after the removal of frame_parallel_decode BUG=webm:1395 Change-Id: I710769b87102edc898c59eb9a2e7a91d8c49107f
2017-06-30VP9Decoder: rm frame_parallel_decodeJames Zern
this has been 0 since the removal of frame_parallel_decode in vp9_dx_iface. BUG=webm:1395 Change-Id: I3f579766ecfa4777395b99686738e1c5610f86ef
2017-05-26Fix vp8 race when build --enable-vp9-highbitdepth.Jerome Jiang
Split vp8/vp9 implementations on yv12_copy_frame_c. Remove high-bitdepth codes from vp8_yv12_extend_frame_borders_c. Clean up vp8 codes usage in vp9. BUG=webm:1435 Change-Id: Ic68e79e9d71e1b20ddfc451fb8dcf2447861236d
2016-08-03vp9/decoder,vp9/*.[hc]: apply clang-formatclang-format
Change-Id: Ic38ea06c7b2fb3e8e94a4c0910e82672a1acaea7
2016-07-01Make set_reference control API work in VP9Yunqing Wang
Moved the API patch from NextGenv2. An example was included. To try it, for example, run the following command: $ examples/vpx_cx_set_ref vp9 352 288 in.yuv out.ivf 4 30 Change-Id: I4cf8f23b86d7ebd85ffd2630dcfbd799c0b88101
2016-05-17Promote to uint32_t before left shiftYaowu Xu
This commit change to promote uint8_t explicitly to uint32_t before left shift operation. BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=612021 Change-Id: Id7059154efb5bdfa45889dabe72aaafd46d79f23
2016-04-10Merge "VP9: Combine TileData with TileWorkerData"Scott LaVarnway
2016-04-07VP9: Combine TileData with TileWorkerDataScott LaVarnway
Change-Id: I83536734a54ef7b85f90f56a51878d94fac7ff22
2016-03-28Properly propagate out of memory errors.Jean-Yves Avenard
It would otherwise result in an infinite loop. Change-Id: Ic03fb220cc048538bd62dee599653187f2093079
2015-11-17Fixed a few sanity checks.Zoe Liu
Change-Id: Ieec4a7be5945dc6de192e2d8292ab978baf47f53 (cherry picked from commit 2096296421c7fa56abb49470c0fbe7c4337b8a71)
2015-09-24vp9/10 decoder_remove: check pbi pointerJames Zern
fixes crash on error Change-Id: Ibb1ef5565fb833cdee1a49335473d98f1187ef43
2015-09-04VP9Decoder: remove duplicate tile_worker_infoJames Zern
unnecessary since: 86f4a3d Remove tile param Change-Id: Iff75d3acf6c5aade833ea0a214c919279403cf97
2015-08-10Move vp9_systemdependent.h to vpx_ports bitops.h and system_state.hAlex Converse
Use system_state.h in vpx_dsp and remove unneeded includes of vp9_systemdependent.h. Change-Id: I92557ec6dd5aa790160b4f31fe7967db0d7ec3c4
2015-07-02Rename vpx_thread to vpx_utilJingning Han
Change the dir name to include more util tools. Change-Id: Id5b16062803ce5eed872fe2edb36d7e56b32eed8
2015-07-02Use vpx prefix for codec independent threading functionsJingning Han
Replace vp9_ prefix with vpx_ for common multi-threading functions. Change-Id: I941a5ead9bfe8213fdad345511d2061b07797b55
2015-07-01Move multi-threading module functions into vpx_thread folderJingning Han
This commit moves the primitive multi-threading files from vp9 folder to vpx_thread, which will be accessible by all vpx codec. Change-Id: Ib51e66e9c69801c10631fab56d35a0c0aaed5883
2015-05-28Merge "Add error handling when running out of free frame buffers."hkuang
2015-05-27Add error handling when running out of free frame buffers.hkuang
Change-Id: If28b59b9521204a6e3aecedcf75932d76a752567
2015-05-20[decoder] Optimize context buffer re-allocationMinghai Shang
1. Check existing buffer sizes when re-allocate context buffers. 2. Don't need to set mi buffers to 0 during setup_mi. Change-Id: I6b48b0e077a4d804312b605ad0dc34aec5795a6d
2015-05-06Move shared SAD code to vpx_dspJohann
Create a new component, vpx_dsp, for code that can be shared between codecs. Move the SAD code into the component. This reduces the size of vpxenc/dec by 36k on x86_64 builds. Change-Id: I73f837ddaecac6b350bf757af0cfe19c4ab9327a
2015-04-28vpx_mem: remove vpx_memsetJames Zern
vestigial. replace instances with memset() which they already were being defined to. Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
2015-04-21Revert "Remove mi_grid_* structures."Scott LaVarnway
(see I3a05cf1610679fed26e0b2eadd315a9ae91afdd6) For the test clip used, the decoder performance improved by ~2%. This is also an intermediate step towards adding back the mode_info streams. Change-Id: Idddc4a3f46e4180fbebddc156c4bbf177d5c2e0d
2015-04-15Reorganize *_rtcd() calling conventionsJohann
Change-Id: Ib1e17d8aae9b713b87f560ab5e49952ee2bfdcc2
2015-02-19Optimize the dequantization process on decoder side.Hangyu Kuang
Change-Id: I00621ff7165bbe86a18794b4a816976c9effaf78
2015-02-05vp9: fix segfault w/corrupt data post frame-parallel mergeJames Zern
cm->frame_bufs[].idx values were made consistent in: 61c5e94 Use -1 consistently as invalid buffer idx update the initialization in swap_frame_buffers() to match. additionally: - remove some shadowed variables in the former and marked them volatile Change-Id: Ie3f9636c405bd822112bb56bd22d28024ae98909
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-16vp9_ethread: add parallel loopfilterYunqing Wang
1. Added row-based loopfilter in encoder; 2. Moved common multi-threaded loopfilter functions from decoder to common; 3. Merged multi-threaded loopfilter code, and made encoder/ decoder call same function to reduce code duplication. Encoder tests showed that 1% - 2% speedup was seen for good-quality 2-pass mode(at speed 3); 1% - 3% speedup using 2 threads and 4% - 6% speedup using 4 threads were seen for real-time mode(at speed 7). Change-Id: I8a4ac51c2ad9bab9fa7b864e90743931c53ec1c4
2015-01-08Merge "vp9: fix -Wclobbered (longjmp + local variables)"James Zern
2015-01-06Use -1 consistently as invalid buffer idxYaowu Xu
Instead of mixed use of both -1 and INT_MAX. This also fixes a vp9 fuzzing test failure. Change-Id: I950ea94b44ec7cdb5232773bee30b104e342f52a
2014-12-23vp9: fix -Wclobbered (longjmp + local variables)James Zern
Local variables used at the setjmp() site need to be marked volatile. Relevant excerpt from the 'man longjmp': =============== The values of automatic variables are unspecified after a call to longjmp() if they meet all the following criteria: · they are local to the function that made the corresponding setjmp(3) call; · their values are changed between the calls to setjmp(3) and longjmp(); and · they are not declared as volatile. =============== Change-Id: I093e6eeeedbf5f781d202248ca701ba2c29d3064
2014-12-19resolve visual studio warnings around initializersJim Bankoski
Change-Id: Id2ad4fb24242f7ca8fa7a152f0889fded4113613
2014-12-18make vp9 encoder static initializers thread safeJim Bankoski
Change-Id: If2d0888d13ebe52bc7c3b16f16319408a86ab6de
2014-12-08Add error handling for frame parallel decode and unit test for that.hkuang
Change-Id: I6e309e11f1641618d2424b7a2c0fe744b8974dec
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-12-02vp9: sync threads after a longjmpJames Zern
Synchronize all threads immediately as a subsequent decode call may cause a resize invalidating some allocations. fixes one aspect of crbug.com/437655 Change-Id: Ie993b62c2756478543206ddbe43ec6268d90a470
2014-11-14Fix a bug in frame parallel decode and add a unit test for that.hkuang
A flush bug is discovered during putting frame parallel decoder into Android. This test will expose that bug. Change-Id: Ia047f27972f4da0471649f79f1f91e7695297473
2014-11-06Modify the frame context memory deallocationYunqing Wang
This patch was to fix the vpxdec fuzzing3 test failure. When an error occurs, setjmp() is invoked, which calls the decoder removing routine. In multiple thread situation, other threads could try to access the frame context memory that is already deallocated, thus causing a segfault. An invalid unit test was added for this issue. Change-Id: Ida7442154f3d89759483f0f4fe0324041fffb952
2014-11-05Totally remove prev_mi in VP9 decoder.hkuang
This will save the memory and improve the decode speed due to removing unnecessary memset of big prev_mi array for all the key frames. Decoding a all key frames 1080p video shows speed improve around 2%. Change-Id: I6284a445c1291056e3c15135c3c20d502f791c10
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-24Merge changes I8a9c9019,Ic7b2faa3,I44d42a50,I3f3a3924,I10747b32,I31b49c9eJames Zern
* changes: add vp9_loop_filter_data_reset move LFWorkerData allocation to VP9LfSync vp9_loop_filter_frame_mt: remove pbi dependency vp9_loop_filter_frame_mt: pass planes directly vp9_loop_filter_frame_mt: pass VP9LfSync directly vp9: store TileWorkerData allocations separately
2014-10-22Merge "vp9_ethread: allocate frame contexts outside VP9_COMMON struct"Yunqing Wang