I realized the calculation of the size of the list of VpxTplBlockStats
is non-trivial. So it's better to add the field for the size.
Bug: b/
273736974
Change-Id: Ic1b50597c1f89a8f866b5669ca676407be6dc9d8
if (tpl_stats[i].frame_width != 0) {
ASSERT_EQ(tpl_stats[i].frame_width, width_);
ASSERT_EQ(tpl_stats[i].frame_height, height_);
+ ASSERT_GT(tpl_stats[i].num_blocks, 0);
ASSERT_NE(tpl_stats[i].block_stats_list, nullptr);
stats_not_all_zero = true;
}
cm, cpi->tpl_frame_stats[frame].block_stats_list,
vpx_calloc(mi_rows * mi_cols,
sizeof(*cpi->tpl_frame_stats[frame].block_stats_list)));
+ cpi->tpl_frame_stats[frame].num_blocks = mi_rows * mi_cols;
cpi->tpl_stats[frame].is_valid = 0;
cpi->tpl_stats[frame].width = mi_cols;
cpi->tpl_stats[frame].height = mi_rows;
for (i = 0; i < MAX_ARF_GOP_SIZE; i++) {
data[i].frame_width = cpi->tpl_frame_stats[i].frame_width;
data[i].frame_height = cpi->tpl_frame_stats[i].frame_height;
+ data[i].num_blocks = cpi->tpl_frame_stats[i].num_blocks;
data[i].block_stats_list = cpi->tpl_frame_stats[i].block_stats_list;
}
typedef struct VpxTplFrameStats {
int frame_width; /**< Frame width */
int frame_height; /**< Frame height */
- // Size of the list can be calculated from frame_width and frame_height.
+ int num_blocks; /**< Number of blocks. Size of block_stats_list */
VpxTplBlockStats *block_stats_list; /**< List of tpl stats for each block */
} VpxTplFrameStats;