]> granicus.if.org Git - libvpx/commitdiff
Fix to segfault for external resize test in vp9
authorMarco Paniconi <marpan@google.com>
Sat, 14 Jan 2023 03:46:10 +0000 (19:46 -0800)
committerMarco Paniconi <marpan@google.com>
Sat, 14 Jan 2023 04:21:12 +0000 (20:21 -0800)
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

test/resize_test.cc
vp9/encoder/vp9_encodeframe.c

index e122a747428f5ca9ac807733968fde7e88a0f926..715bb9d70fcbdac501122b2d1554fb5853054403 100644 (file)
@@ -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,
index a1ee9c6784a130917c627119248a79648836c7cc..1483ac069dd4c0bf3bc403e977dbf8f710971ff2 100644 (file)
@@ -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,