diff options
author | Marco Paniconi <marpan@google.com> | 2022-05-12 11:18:19 -0700 |
---|---|---|
committer | Marco Paniconi <marpan@google.com> | 2022-05-12 18:28:08 -0700 |
commit | a6bff83a603affa2799bbacedc24f9ca8632a5c6 (patch) | |
tree | 97d63b12b6a1b341c6ecc57ed5f7572d7ded24fc | |
parent | e8579cc3d4302214805bb28fbc27b771b1047325 (diff) | |
download | libvpx-a6bff83a603affa2799bbacedc24f9ca8632a5c6.tar.gz |
vp9-rtc: Fix to interp_filter for segment skip
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
-rw-r--r-- | test/active_map_test.cc | 3 | ||||
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/test/active_map_test.cc b/test/active_map_test.cc index 9c55f9a8b..7f41009e0 100644 --- a/test/active_map_test.cc +++ b/test/active_map_test.cc @@ -37,6 +37,7 @@ class ActiveMapTest ::libvpx_test::Encoder *encoder) { if (video->frame() == 0) { encoder->Control(VP8E_SET_CPUUSED, cpu_used_); + encoder->Control(VP9E_SET_AQ_MODE, 3); } else if (video->frame() == 3) { vpx_active_map_t map = vpx_active_map_t(); /* clang-format off */ @@ -87,5 +88,5 @@ TEST_P(ActiveMapTest, Test) { VP9_INSTANTIATE_TEST_SUITE(ActiveMapTest, ::testing::Values(::libvpx_test::kRealTime), - ::testing::Range(0, 9)); + ::testing::Range(0, 10)); } // namespace diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index fc4089865..9da8f61e3 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1905,13 +1905,17 @@ void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src, } static void set_mode_info_seg_skip(MACROBLOCK *x, TX_MODE tx_mode, + INTERP_FILTER interp_filter, RD_COST *rd_cost, BLOCK_SIZE bsize) { MACROBLOCKD *const xd = &x->e_mbd; MODE_INFO *const mi = xd->mi[0]; INTERP_FILTER filter_ref; filter_ref = get_pred_context_switchable_interp(xd); - if (filter_ref == SWITCHABLE_FILTERS) filter_ref = EIGHTTAP; + if (interp_filter == BILINEAR) + filter_ref = BILINEAR; + else if (filter_ref == SWITCHABLE_FILTERS) + filter_ref = EIGHTTAP; mi->sb_type = bsize; mi->mode = ZEROMV; @@ -4682,7 +4686,7 @@ static void nonrd_pick_sb_modes(VP9_COMP *cpi, TileDataEnc *tile_data, hybrid_search_svc_baseiskey(cpi, x, rd_cost, bsize, ctx, tile_data, mi_row, mi_col); else if (segfeature_active(&cm->seg, mi->segment_id, SEG_LVL_SKIP)) - set_mode_info_seg_skip(x, cm->tx_mode, rd_cost, bsize); + set_mode_info_seg_skip(x, cm->tx_mode, cm->interp_filter, rd_cost, bsize); else if (bsize >= BLOCK_8X8) { if (cpi->rc.hybrid_intra_scene_change) hybrid_search_scene_change(cpi, x, rd_cost, bsize, ctx, tile_data, mi_row, |