diff options
author | Marco Paniconi <marpan@google.com> | 2023-01-13 19:46:10 -0800 |
---|---|---|
committer | Marco Paniconi <marpan@google.com> | 2023-01-13 20:21:12 -0800 |
commit | 71d01660cc40306c2c7c80c8ed510e520a0c4b93 (patch) | |
tree | 4cab4dd218081be29b82f1bc3a357fa241e13e12 | |
parent | e067469e77bec79f7f52d074c440f01bfa4c14af (diff) | |
download | libvpx-71d01660cc40306c2c7c80c8ed510e520a0c4b93.tar.gz |
Fix to segfault for external resize test in vp9
Failure occurs for 1 pass non-realtime mode at speed 0.
Due to speed feautre rd_ml_partition.var_pruning, which
doesn't check for scaled reference in simple_motion_search().
Bug: webm:1768
Change-Id: Iddcb56033bac042faebb5196eed788317590b23f
-rw-r--r-- | test/resize_test.cc | 5 | ||||
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/test/resize_test.cc b/test/resize_test.cc index e122a7474..715bb9d70 100644 --- a/test/resize_test.cc +++ b/test/resize_test.cc @@ -777,10 +777,7 @@ TEST_P(ResizeCspTest, TestResizeCspWorks) { } VP8_INSTANTIATE_TEST_SUITE(ResizeTest, ONE_PASS_TEST_MODES); -// TODO(https://crbug.com/webm/1768): VP9 should use ONE_PASS_TEST_MODES for -// the ResizeTest instantiation after segfault is fixed. -VP9_INSTANTIATE_TEST_SUITE(ResizeTest, - ::testing::Values(::libvpx_test::kRealTime)); +VP9_INSTANTIATE_TEST_SUITE(ResizeTest, ONE_PASS_TEST_MODES); VP9_INSTANTIATE_TEST_SUITE(ResizeInternalTest, ::testing::Values(::libvpx_test::kOnePassBest)); VP9_INSTANTIATE_TEST_SUITE(ResizeRealtimeTest, diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index a1ee9c678..1483ac069 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -3413,7 +3413,8 @@ static void simple_motion_search(const VP9_COMP *const cpi, MACROBLOCK *const x, const VP9_COMMON *const cm = &cpi->common; MACROBLOCKD *const xd = &x->e_mbd; MODE_INFO *const mi = xd->mi[0]; - const YV12_BUFFER_CONFIG *const yv12 = get_ref_frame_buffer(cpi, ref); + YV12_BUFFER_CONFIG *yv12; + YV12_BUFFER_CONFIG *scaled_ref_frame = vp9_get_scaled_ref_frame(cpi, ref); const int step_param = 1; const MvLimits tmp_mv_limits = x->mv_limits; const SEARCH_METHODS search_method = NSTEP; @@ -3422,6 +3423,11 @@ static void simple_motion_search(const VP9_COMP *const cpi, MACROBLOCK *const x, MV best_mv = { 0, 0 }; int cost_list[5]; + if (scaled_ref_frame) + yv12 = scaled_ref_frame; + else + yv12 = get_ref_frame_buffer(cpi, ref); + assert(yv12 != NULL); if (!yv12) return; vp9_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, |