shithub: libvpx

Download patch

ref: 3271a7ed6c976fd6d25c144c19170bac9b57367b
parent: 23f8b831776824e2b95db70979addd1e4623b746
author: Angie Chiang <angiebird@google.com>
date: Mon Dec 31 15:56:31 EST 2018

Increase memory size in non-greedy-mv

The smallest block size of motion field is 4x4, but the mi_unit
size is 8x8, therefore the number of units of motion field is
"mi_rows * mi_cols * 4".

Change-Id: I95292904d757705d39b78af5d0cf2d25f376c642

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -6436,15 +6436,17 @@
   // TODO(angiebird): This probably needs further modifications to support
   // frame scaling later on.
   if (cpi->feature_score_loc_alloc == 0) {
+    // The smallest block size of motion field is 4x4, but the mi_unit is 8x8,
+    // therefore the number of units is "mi_rows * mi_cols * 4" here.
     CHECK_MEM_ERROR(
         cm, cpi->feature_score_loc_arr,
-        vpx_calloc(mi_rows * mi_cols, sizeof(*cpi->feature_score_loc_arr)));
-    CHECK_MEM_ERROR(
-        cm, cpi->feature_score_loc_sort,
-        vpx_calloc(mi_rows * mi_cols, sizeof(*cpi->feature_score_loc_sort)));
-    CHECK_MEM_ERROR(
-        cm, cpi->feature_score_loc_heap,
-        vpx_calloc(mi_rows * mi_cols, sizeof(*cpi->feature_score_loc_heap)));
+        vpx_calloc(mi_rows * mi_cols * 4, sizeof(*cpi->feature_score_loc_arr)));
+    CHECK_MEM_ERROR(cm, cpi->feature_score_loc_sort,
+                    vpx_calloc(mi_rows * mi_cols * 4,
+                               sizeof(*cpi->feature_score_loc_sort)));
+    CHECK_MEM_ERROR(cm, cpi->feature_score_loc_heap,
+                    vpx_calloc(mi_rows * mi_cols * 4,
+                               sizeof(*cpi->feature_score_loc_heap)));
 
     cpi->feature_score_loc_alloc = 1;
   }