]> granicus.if.org Git - libvpx/commitdiff
Increase memory size in non-greedy-mv
authorAngie Chiang <angiebird@google.com>
Tue, 1 Jan 2019 04:56:31 +0000 (20:56 -0800)
committerAngie Chiang <angiebird@google.com>
Fri, 4 Jan 2019 01:53:14 +0000 (17:53 -0800)
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

vp9/encoder/vp9_encoder.c

index 339aa4eed333bba19a70fd31d810bb9960540fd5..fb0cc23e5af79d94a56673df1c9879cd76143a0a 100644 (file)
@@ -6436,15 +6436,17 @@ static void init_tpl_buffer(VP9_COMP *cpi) {
   // 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;
   }