From 3271a7ed6c976fd6d25c144c19170bac9b57367b Mon Sep 17 00:00:00 2001 From: Angie Chiang Date: Mon, 31 Dec 2018 20:56:31 -0800 Subject: [PATCH] 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 --- vp9/encoder/vp9_encoder.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 339aa4eed..fb0cc23e5 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -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; } -- 2.40.0