summaryrefslogtreecommitdiff
path: root/vp9
AgeCommit message (Collapse)Author
2022-05-27L2E: Add vp9 GOP decision helper functionCheng Chen
Add a helper function to call the external rate control model. The helper function is placed in the function where vp9 determines GOP decisions. The helper function passes frame information, including current frame show index, coding index, etc to the external rate control model, and then receives GOP decisions. The received GOP decisions overwrites the default GOP decision, only when the external rate control model is set to be active via the codec control. The decision should satisfy a few constraints, for example, larger than min_gf_interval; smaller than max_gf_interval. Otherwise, return error. Unit tests are added to test the new functionality. Change-Id: Id129b4e1a91c844ee5c356a7801c862b1130a3d8
2022-05-27L2E: Add control type for the external rate control APICheng Chen
Two control types are defined: QP and GOP control. Now the API only supports the QP model. Change-Id: Ib3a712964b9d2282c93993ee56e0558e4795fb46
2022-05-26Revert "[NEON] Optimize vp9_diamond_search_sad() for NEON"Jerome Jiang
This reverts commit 258affdeab68ed59e181368baa46e2f1d077b0ab. Reason for revert: Not bitexact with C version Original change's description: > [NEON] Optimize vp9_diamond_search_sad() for NEON > > About 50% improvement in comparison to the C function. > I have followed the AVX version with some simplifications. > > Change-Id: I72ddbdb2fbc5ed8a7f0210703fe05523a37db1c9 Change-Id: I5c210b3dfe1f6dec525da857dd8c83946be566fc
2022-05-15vp9-rtc: Fix to usage of active_maps when aq_mode=0Marco Paniconi
If aq_mode=0 the segmentation feature may still be used for active_maps, so the condition active_maps.enabled needs to be added in two places regarding segmentation logic in encodeframe.c. Otherwise the active_maps would have no effect. This also resolves why the assert in bug webm:1762 was not triggered when aq_mode=0. Change-Id: Ibd68e9b5c3f81728241a168d3fb3567d6845633d
2022-05-12vp9-rtc: Fix to interp_filter for segment skipMarco Paniconi
For segment skip feature: allow for setting the mi->interp_filter to BILINEAR, if cm->interp_filter is set BILIENAR. This can happen at speed 9 when the segment skip feature is used (e.g., active_maps) Without this fix the assert can be triggered with the active_map_test.cc for speed 9 included. Updated the test. Fixes the assert triggered in the issue: Bug: webm:1762 Change-Id: I462e0bdd966e4f3cb5b7bc746685916ac8808358
2022-05-07[NEON] Optimize vp9_diamond_search_sad() for NEONKonstantinos Margaritis
About 50% improvement in comparison to the C function. I have followed the AVX version with some simplifications. Change-Id: I72ddbdb2fbc5ed8a7f0210703fe05523a37db1c9
2022-04-26vp9_get_smooth_motion_field: check allocJames Zern
Change-Id: I6b19d0169d127f622abf97b3b8590eee957bdc51
2022-04-26vp9_row_mt_alloc_rd_thresh: check allocJames Zern
Change-Id: I6fb7771d9fa6ec54d81f24a02a289e8b852e7332
2022-04-26simple_encode,init_encoder: check buffer_pool allocJames Zern
Change-Id: I54f83733260abf828166400c5fd0c4c7e3ccec2f
2022-04-26VP9RateControlRTC::Create: check segmentation_map allocJames Zern
Change-Id: I17b23915c32accf834def5ab26a8e4e188f9993a
2022-04-26vp9_speed_features.c: check allocationsJames Zern
Change-Id: If3b319c1ce7036c2259440f4eeb2e645bf559f4c
2022-04-26vp9_alloc_motion_field_info: check motion_field_array allocJames Zern
Change-Id: I4ae11242e645feb3b85eaea186f14b3676ae40a8
2022-04-26vp9_enc_grp_get_next_job: check job queue allocJames Zern
+ reverse conditional order; var == constant is more readable Change-Id: I9f2b4394024c262fd5fe9576a8bf33afe197c050
2022-04-26vp9: check postproc_state.limits allocsJames Zern
Change-Id: I9d5df96580074375e4847d2e2f60a6a6d56eeea5
2022-04-26vp9,encode_tiles_buffer_alloc: fix allocation checkJames Zern
previously vp9_bitstream_worker_data was checked after it was memset(); this change uses CHECK_MEM_ERROR for consistency to ensure the pointer is checked first Change-Id: I532d0eb0e746dc6b8d694b616eba693c5c0053ac
2022-04-18vp9_dx_iface,init_buffer_callbacks: return on alloc failureJames Zern
use an error code as a jmp target is not currently set in init_decoder() Change-Id: If7798039439f13c739298a8a92a55aaa24e2210c
2022-04-18vp9_encoder: check context buffer allocationsJames Zern
previously the returns for alloc_context_buffers_ext() and vp9_alloc_context_buffers() were ignored which would result in a NULL access during encoding should they fail Change-Id: Icd76576f3d5f8d57697adc9ae926a3a5be731327
2022-04-18vp9_alloc_internal_frame_buffers: fix num buffers assignmentJames Zern
avoid setting num_internal_frame_buffers until the allocation is checked, avoiding an invalid access in vp9_free_internal_frame_buffers() Change-Id: I28a544a2553d62a6b5cb7c45bf10591caa4ebab6
2022-04-18vp9_alloccommon: add missing pointer checksJames Zern
in vp9_free_ref_frame_buffers() and vp9_free_context_buffers(); pool and free_mi may be NULL due to earlier allocation failures Change-Id: I3bd26ea29b3aea6c58f33d5b7f5a280eb6250ec7
2022-04-18temporal_filter_sse4,cosmetics: fix some typosJames Zern
Change-Id: If8318068a32da52d15c0ba595f80092611f4c847
2022-04-14temporal_filter_sse4: remove unused function paramsJames Zern
this clears warnings under clang-13 of the form: ../vp9/encoder/x86/temporal_filter_sse4.c:275:39: warning: parameter 'u_pre' set but not used [-Wunused-but-set-parameter] Change-Id: I21519b5b0b9c21b04b174327415e0e73b56bdfda
2022-04-13vp9,update_mbgraph_frame_stats: rm unused variablesJames Zern
this quiets warnings under clang-13 of the form: ../vp9/encoder/vp9_mbgraph.c:222:42: warning: variable 'gld_y_offset' set but not used [-Wunused-but-set-variable] Change-Id: I32170b90c07058f780b4e8100ee5217232149db8
2022-04-05Merge "L2E: Make SimpleEncode take vp9 level as an input" into mainCheng Chen
2022-03-31Revert "quantize: replace highbd versions"James Zern
This reverts commit 2200039d33c49a9f7a5c438656df143755b022c4. This causes failures with VP9/EndToEndTestLarge.EndtoEndPSNRTest/*; it seems the assembly does not match the C code. Bug: webm:1586 Change-Id: I4c63beebf88d4c12789d681b0d38014510b147fe
2022-03-31Merge "Optimize FHT functions for NEON" into mainJames Zern
2022-03-31Merge "remove sad x3,x8 specializations" into mainJohann Koenig
2022-03-31quantize: replace highbd versionsJohann
The optimized quantize functions were already built to handle highbd values. The only difference is the clamping. All highbd functions expand to 32bits when running in highbd mode. Removes vpx_highbd_quantize_32x32_sse2 as it is slower than the C version in the worst case. Bug: webm:1586 Change-Id: I49bf8a6a2041f78450bf43a4f655c67656b0f8d9
2022-03-30L2E: Make SimpleEncode take vp9 level as an inputCheng Chen
Level conformance is standadized in vp9. If a specific target level is set, the vp9 encoder is required to produce conformant bitstream with limit on frame size, rate, min alt-ref distance, etc. This change makes the SimpleEncode environment take the target level as an input. To make existing tests pass, we set the level to 0. Change-Id: Ia35224f75c2fe50338b5b86a50c84355f5daf6fd
2022-03-30Optimize FHT functions for NEONKonstantinos Margaritis
[NEON] Optimize vp9_fht4x4, vp9_fht8x8, vp9_fht16x16 for NEON Following change #3516278, the improvement for these functions is: Before: 4.10% 0.75% vpxenc vpxenc [.] vp9_fht16x16_c 2.93% 0.65% vpxenc vpxenc [.] vp9_fht8x8_c 0.93% 0.77% vpxenc vpxenc [.] vp9_fht4x4_c And after the patch: 0.69% 0.16% vpxenc vpxenc [.] vp9_fht16x16_neon 0.28% 0.28% vpxenc vpxenc [.] vp9_fht8x8_neon 0.54% 0.53% vpxenc vpxenc [.] vp9_fht4x4_neon Bug: webm:1634 Change-Id: I6748a0c4e0cfaafa3eefdd4848d0ac3aab6900e4
2022-03-30remove skip_block from quantizeJohann
Whether a block is skipped is handled by mi->skip. x->skip_block is kept exclusively to verify that the quantize functions are not called for skip blocks. Finishes the cleanup in 13eed991f Bug: libvpx:1612 Change-Id: I1598c3b682d3c5e6c57a15fa4cb5df2c65b3a58a
2022-03-29remove sad x3,x8 specializationsJohann
These would compute the sum of absolute differences (sad) for a group of 3 or 8 references. This was used as part of an exhaustive search. vp8 only uses these functions in speed 0 and best quality. For vp9 this is only used with the --enable-non-greedy-mv experiment. This removes the 3- and 8-at-a-time optimized functions and uses the fall back code which will process 1 or 4 (vpx_sadMxNx4d) at a time. For configure --target=x86_64-linux-gcc --enable-realtime-only: libvpx.a before: 3002424 after: 2937622 delta: 64802 after 'strip libvpx.a' before: 2116998 after: 2073090 delta: 43908 Change-Id: I566d06e027c327b3bede68649dd551bba81a848e
2022-02-08rtc-vp9: Fix intra-only for bypass modeMarco Paniconi
Allow intra-only frame in svc to also work in bypass (flexible-svc) mode. Added unittest for the flexible svc case. And fix the gld_fb_idx for (SL0, TL1) in bypass/flexible mode pattern in the sample encoder: force it to be 0 (same as lst_fb_idx), since the slot is unused on SL0. Change-Id: Iada9d1b052e470a0d5d25220809ad0c87cd46268
2022-02-08Merge "Handle NV12 in vpx_img_chroma_subsampling()" into mainWan-Teh Chang
2022-02-05Handle NV12 in vpx_img_chroma_subsampling()Wan-Teh Chang
Change-Id: Ibac9f6f8dcdcae0d0c10ae1a118d13baf2407270
2022-02-05Update error messages in validate_img()Wan-Teh Chang
Change-Id: I4aa6d2e16e077d29e4e9eabfc7056fcfed6786d6
2022-01-31Merge "Use background segmentation mask with ROI" into mainJerome Jiang
2022-01-27Use background segmentation mask with ROIJerome Jiang
RTC sample encoder vpx_temporal_svc_encoder can take mask files as input when ROI_MAP is set to 1. Uses ROI and segmentation of vp9 to skip background encoding when source_sad is low and the correspond block in previous frame is also skipped. Change-Id: I8590e6f9a88cecfa1d7f375d4cc480f0f2af87b6
2022-01-19Reland "Add vp9 ref frame to flag map function"Jianhui Dai
Original change's description: > Add vp9 ref frame to flag map function > > Change-Id: I371c2346b9e0153c0f8053cab399ce14cd286c56 Change-Id: I04a407ee0ef66c01a0d224b4468e043213f8791f
2022-01-11Revert "Set unused reference frames to first ref"Jerome Jiang
This reverts commit e7f33a53cf404bbb3688af9b13375b5c090daae4. Change-Id: I54e807220885cb78af6f3c6e48b3eb2c9f1e70b4
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