summaryrefslogtreecommitdiff
path: root/vp9/encoder
AgeCommit message (Collapse)Author
2022-01-11Revert "Add vp9 ref frame to flag map function"Jerome Jiang
This reverts commit 44e611482e13fdffa0acde780a20dd68ee153498. Change-Id: Ic900cc01be4de7983fab42178a488277efab77b3
2022-01-01Add vp9 ref frame to flag map functionJianhui Dai
Change-Id: I371c2346b9e0153c0f8053cab399ce14cd286c56
2021-12-21vp9_prob_diff_update_savings_search_model: quiet conv warningsJames Zern
under Visual Studio: Warning C4244 '=': conversion from 'int64_t' to 'vpx_prob', possible loss of data after: ea042a676 vp9 encoder: fix integer overflows 'newp' has already been range checked earlier in the loop so the cast won't have any unexpected results Change-Id: Ic10877db2c0633d53fffdf8852d5095403c23a02
2021-12-15Merge "Set unused reference frames to first ref" into mainMarco Paniconi
2021-12-15Merge "vp9 encoder: fix integer overflows" into mainFyodor Kyslov
2021-12-14vp9 encoder: fix integer overflowsFyodor Kyslov
fixing integer overflow with 16K content and enabling the test Bug: webm:1750 Fixed: webm:1750 Change-Id: I76eebd915bcae55bc755613251a98e1716dea4c0
2021-12-11Set unused reference frames to first refJianhui Dai
If a reference frame is not referenced, then set the index for that reference to the first one used/referenced instead of unused slot. Unused slot means key frame, as key frame resets all slots with itself. This CL extracts `get_first_ref_frame()` from `reset_fb_idx_unused()` with a typo fixing, and sets all unused reference frames to first ref in vp9 uncompressed header. Bug: webrtc:13442 Change-Id: I99523bc2ceedf27efe376d1113851ff342982181
2021-12-10Merge "vp9_diamond_search_sad_avx: quiet -Wmaybe-uninitialized warning" into ↵James Zern
main
2021-12-10Merge "vp[89]_initalize_enc(): protect against multiple invocations" into mainJames Zern
2021-12-09vp[89]_initalize_enc(): protect against multiple invocationsJames Zern
this removes the burden from callers; the rtcd functions are left with a mostly redundant (outside of tests) once() as top-level functions should ensure their constraints are met Change-Id: I5bdbcfa4671c6a1492cfe9c7d886c361c26caaa9
2021-12-09vp9_diamond_search_sad_avx: quiet -Wmaybe-uninitialized warningJames Zern
w/gcc-11 v_these_mv_w is always initialized in this block with _mm_add_epi16(); converting this to a _mm_storeu_si32(tmp) call also works, but introduces more stack usage || ../vp9/encoder/x86/vp9_diamond_search_sad_avx.c: In function ‘vp9_diamond_search_sad_avx’: vp9/encoder/x86/vp9_diamond_search_sad_avx.c|285 col 19| warning: ‘v_these_mv_w’ may be used uninitialized [-Wmaybe-uninitialized] || 285 | new_bmv = ((const int_mv *)&v_these_mv_w)[local_best_idx]; || | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vp9/encoder/x86/vp9_diamond_search_sad_avx.c|149 col 21| note: ‘v_these_mv_w’ declared here || 149 | const __m128i v_these_mv_w = _mm_add_epi16(v_bmv_w, v_ss_mv_w); || | ^~~~~~~~~~~~ Change-Id: I1cd2fcb41030db16f51c94f3a70eb8eb2a526401
2021-12-09vp9_bitstream.c: quiet -Wstringop-overflow warningJames Zern
w/gcc-11 as noted in the size of interp_filter_selected[][]'s first dimension varies between VP9_COMP and VP9BitstreamWorkerData as noted in the latter's definition: // The size of interp_filter_selected in VP9_COMP is actually // MAX_REFERENCE_FRAMES x SWITCHABLE. But when encoding tiles, all we ever do // is increment the very first index (index 0) for the first dimension. Hence // this is sufficient. int interp_filter_selected[1][SWITCHABLE]; normalize the function signatures of write_modes*(), etc. to take this into account. vp9/encoder/vp9_bitstream.c|948 col 3| warning: ‘write_modes’ accessing 64 bytes in a region of size 16 [-Wstringop-overflow=] || 948 | write_modes(cpi, xd, &cpi->tile_data[data->tile_idx].tile_info, || | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || 949 | &data->bit_writer, tile_row, data->tile_idx, || | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || 950 | &data->max_mv_magnitude, data->interp_filter_selected); || | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vp9/encoder/vp9_bitstream.c|948 col 3| note: referencing argument 8 of type ‘int (*)[4]’ vp9/encoder/vp9_bitstream.c|488 col 13| note: in a call to function ‘write_modes’ Change-Id: I0898cd7c3431633c382a0c3a1be2f0a0bea8d0f9
2021-12-02clear -Wextra-semi/-Wextra-semi-stmt warningsJames Zern
Bug: chromium:1257449 Change-Id: Ia9aafccc09b611521d4a7aedfe3723393a840c62
2021-11-19Merge "vp9 encoder: fix row-mt crash w/thread config change" into mainJames Zern
2021-11-18vp9 encoder: fix row-mt crash w/thread config changeJames Zern
previously row-mt would allocate thread data once, so increasing the number of threads with a config change would cause a heap overflow. Bug: chromium:1261415 Bug: chromium:1270689 Change-Id: I3c5ec8444ae91964fa34a19dd780bd2cbb0368bf
2021-11-18Merge "vp9 encoder: fix some integer overflows" into mainJames Zern
2021-11-17vp9 encoder: fix some integer overflowsFyodor Kyslov
cap bitrate to 1000Mbps, change bitsaving budget to int64_t this make test coverage for 2048x2048 - same as for vp8 Bug: webm:1749 Fixed: webm:1749 Change-Id: Ic58d73cb7529b0826d1f501ad09af8e80f706a6e
2021-11-16vp9: Fix multiplication overflowMikko Koivisto
Fix UBSan error reported from aosp Cuttlefish device: /vp9/encoder/vp9_ratectrl.c:238:33: unsigned integer overflow: 2500000 * 1800 cannot be represented in type 'unsigned int' ...by casting the operand and the result of multiplication to 64bit integer. Test: vp9 webrtc streaming with Cuttlefish Change-Id: Id5bb3d4071a96179caffae0829d3cc4e48c7614b
2021-10-01{vp8,vp9}_set_roi_map: fix validation with INT_MINJames Zern
previously ranges were checked with abs() whose behavior is undefined with INT_MIN. this fixes a crash when the original value is returned and it later used as and offset into a table. Bug: webm:1742 Change-Id: I345970b75c46699587a4fbc4a059e59277f4c2c8
2021-08-24vp9 rc lib: Allow aq 3 to work for SVC with unit testJerome Jiang
Also use round to cast float to int with more accurate calculation to avoid error accumulation which causes qp to be different after ~290 frames. Change-Id: Iff65a8fdc67401814fd253dbf148afe9887df97f
2021-07-26Fix some instances of -Wunused-but-set-variable.Peter Kasting
Bug: chromium:1203071 Change-Id: Ieb628f95d676ba3814b5caf8a02a884330928c77
2021-07-26Merge "Remove unused old FP_MB_STATS code" into mainYunqing Wang
2021-07-26Merge "Clean up allow_partition_search_skip code" into mainYunqing Wang
2021-07-25Merge "Disable allow_partition_search_skip feature" into mainYunqing Wang
2021-07-23Remove unused old FP_MB_STATS codeYunqing Wang
Change-Id: I78ac1f8ce1598de295efd2ac1fe8244072d9b501
2021-07-23Clean up allow_partition_search_skip codeYunqing Wang
Change-Id: Ia05157fc3e613d93f10df5abddd77a740a0005ca
2021-07-23Disable allow_partition_search_skip featureYunqing Wang
This feature was added to help speed up still images and slideshows. It didn't work anymore, and thus was disabled. Code cleanup will follow. This had negligible impact to regular test sets. Borg test result on ugc360p set at speed 3. avg_psnr: ovr_psnr: ssim: speed: -0.244 -0.278 -0.153 -0.973 Change-Id: If74edabce0c93be1361e645ffd2eec063c2db76b
2021-07-23Merge "Add control to get QP for all spatial layers" into mainJerome Jiang
2021-07-22Add control to get QP for all spatial layersJerome Jiang
Change-Id: I77a9884351e71649c8f8632293d9515c60f6adbc
2021-07-22Merge "Use round to be more accurate casting float to int" into mainJerome Jiang
2021-07-21Add cyclic refresh to vp9 rtc external ratecontrolJerome Jiang
Change-Id: Ia2a881399aa31ca0f34481b975362ddd4ad87f1c
2021-07-20Use round to be more accurate casting float to intJerome Jiang
Change-Id: Ifd5961917831752b176dd75d39d6b2cba6ce72fa
2021-07-13Add codec control for rtc external ratectrl libJerome Jiang
This will do 3 things: Turn off low motion computation Turn off gf update constrain on key frame frequency turn off content mode for cyclic refresh Those are used to verify the external ratectrl lib works as expected. Change-Id: Ic6e61498de82d6b3973e58df246cf5e05f838680
2021-06-29Merge "vp9-rtc: Extract content dependency in cyclic refresh" into mainMarco Paniconi
2021-06-25Disallow skipping transform and quantizationCheng Chen
The encoder has a feature to skip transform and quantization based on model rd analysis. It could happen that the model based analysis lets the encoder skips transform and quantization, while a bad prediction occurs, leading to bad reconstructed blocks, which are intrusive and apparently coding errors. We add a speed feature to guard the skipping feature. Due to the risk of bad perceptual quality, we disallow such skipping by default. On hdres test set, speed 2, the coding performance difference is 0.025%, speed difference is 1.2%, which can be considered non significant. BUG=webm:1729 Change-Id: I48af01ae8dcc7a76c05c695f3f3e68b866c89574
2021-06-25vp9-rtc: Extract content dependency in cyclic refreshMarco Paniconi
For usage in the external RC. When content_mode = 0, the cyclic refresh has no dependency on the content (motion, spatial variance, motion vectors, etc,). The content_mode = 0, when compared to content_mode = 1, on rtc set for speed 7: has some regression on some clips (~3-5%), but overall/average bdrate loss is about ~1-2%. Comparing aq_mode=3 with content_mode = 0, vs aq_mode=3: about ~14% avg/overall bdrate gain, but has ~3-7% regression on some hard motion clip (e.g.m street). Change-Id: I93117fabb8f7f89032c15baf1292b201e8c07362
2021-06-22Merge "rc: turn off gf constrain for external RC" into mainJerome Jiang
2021-06-22rc: turn off gf constrain for external RCJerome Jiang
Added a new flag in rate control which turns off gf interval constrain on key frame frequency for external RC. It remains on for libvpx. Change-Id: I18bb0d8247a421193f023619f906d0362b873b31
2021-06-22Merge changes I9f0852a0,Ieecb98a7 into mainAngie Chiang
* changes: Add use_simple_encode_api to oxcf Fix flaky assertions in SimpleEncode
2021-06-21Add use_simple_encode_api to oxcfAngie Chiang
Use this flag to change the encoder behavior when SimpleEncode APIs are used BUG=webm:1733 Change-Id: I9f0852a03ff99faa01cdd8eee8ab71718cc58632
2021-06-21Fix flaky assertions in SimpleEncodeAngie Chiang
Bug: webm:1731 Change-Id: Ieecb98a7ac19e6291acd5d51432dc6a3789e9552
2021-06-18Merge "vp9 rc: add vbr to rtc rate control library" into mainJerome Jiang
2021-06-18vp9 rc: add vbr to rtc rate control libraryJerome Jiang
Change-Id: I3d2565572c2b905966d60bcaa6e5e6f057b1bd51
2021-06-18normalize vp9_calc_[ip]frame declarations and definitionsJames Zern
fixes warnings under visual studio: vp9\encoder\vp9_ratectrl.c(2012): warning C4028: formal parameter 1 different from declaration vp9\encoder\vp9_ratectrl.c(2027): warning C4028: formal parameter 1 different from declaration Change-Id: Ia0740db597fb7a259f90d362b483f58662f9f584
2021-06-17vp9: Adjust logic for gf update in 1 pass vbrMarco Paniconi
This reduces some regression when external RC is used, for which avg_frame_low_motion is not set/updated (=0). Change-Id: I2408e62bd97592e892cefa0f183357c641aa5eea
2021-06-14vp9-rtc: Refactor 1 pass vbr rate controlMarco Paniconi
This refactoring is needed to allow the RC_rtc library to support VBR. Change-Id: I863a4a65096fed06b02307098febf7976360e0f3
2021-06-07L2E: properly init two pass rc parametersCheng Chen
Two pass rc parameters are only initialized in the second pass in vp9 normal two pass encoding. However, the simple_encode API queries the keyframe group, arf group, and number of coding frames without going throught the two pass route. Since recent libvpx rc changes, parameters in the TWO_PASS struct have a great influence on the determination of the above information. We therefore need to properly init two pass rc parameters in the simple_encode related environment. Change-Id: Ie14b86d6e7ebf171b638d2da24a7fdcf5a15c3d9
2021-05-26Fix simple encodeCheng Chen
Properly init and delete cpi struct in simple encode functions. Change-Id: I6e66bcac852cbb3dec9b754ba3fb01a348ac98b8
2021-05-04vp9_denoiser_neon,horizontal_add_s8x16: use vaddlv w/aarch64James Zern
this reduces the number of instructions to compute the sum Change-Id: Icae4d4fb3e343d5b6e5a095c60ac6d171b3e7d54
2021-04-29Add assert for zero_motion_factor rangePaul Wilkins
Change clamp to an assert so we are warned if changes to input ranges or defaults in the future lead to an invalid value. Change-Id: Idb4e0729f477a519bfff3083cdce3891e2fc6faa