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".
Unified · Split
| @@ -6436,15 +6436,17 @@ static void init_tpl_buffer(VP9_COMP *cpi) { · 6435 unmodified lines | |||
| 6436 | // TODO(angiebird): This probably needs further modifications to support | 6436 | // TODO(angiebird): This probably needs further modifications to support |
| 6437 | // frame scaling later on. | 6437 | // frame scaling later on. |
| 6438 | if (cpi->feature_score_loc_alloc == 0) { | 6438 | if (cpi->feature_score_loc_alloc == 0) { |
| 6439 | // The smallest block size of motion field is 4x4, but the mi_unit is 8x8, | ||
| 6440 | // therefore the number of units is "mi_rows * mi_cols * 4" here. | ||
| 6439 | CHECK_MEM_ERROR( | 6441 | CHECK_MEM_ERROR( |
| 6440 | cm, cpi->feature_score_loc_arr, | 6442 | cm, cpi->feature_score_loc_arr, |
| 6441 | vpx_calloc(mi_rows * mi_cols, sizeof(*cpi->feature_score_loc_arr))); | 6443 | vpx_calloc(mi_rows * mi_cols * 4, sizeof(*cpi->feature_score_loc_arr))); |
| 6442 | CHECK_MEM_ERROR( | 6444 | CHECK_MEM_ERROR(cm, cpi->feature_score_loc_sort, |
| 6443 | cm, cpi->feature_score_loc_sort, | 6445 | vpx_calloc(mi_rows * mi_cols * 4, |
| 6444 | vpx_calloc(mi_rows * mi_cols, sizeof(*cpi->feature_score_loc_sort))); | 6446 | sizeof(*cpi->feature_score_loc_sort))); |
| 6445 | CHECK_MEM_ERROR( | 6447 | CHECK_MEM_ERROR(cm, cpi->feature_score_loc_heap, |
| 6446 | cm, cpi->feature_score_loc_heap, | 6448 | vpx_calloc(mi_rows * mi_cols * 4, |
| 6447 | vpx_calloc(mi_rows * mi_cols, sizeof(*cpi->feature_score_loc_heap))); | 6449 | sizeof(*cpi->feature_score_loc_heap))); |
| 6448 | 6450 | ||
| 6449 | cpi->feature_score_loc_alloc = 1; | 6451 | cpi->feature_score_loc_alloc = 1; |
| 6450 | } | 6452 | } |