Declare pbi->output_frame_index as an array of int All the other frame buffer index fields, such as cm->new_fb_idx, cm->ref_frame_map[], and ctx->last_show_frame have the int type. Declaring pbi->output_frame_index as an array of int instead of size_t allows us to remove some casts to int. Change-Id: I5792ea6824197e30e0d94fe0c42c155425aa89f3 (cherry picked from commit 26cab1553691749954c04a4de4e3ecf7f78382a6)
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c index 0c14a97..ac8d123 100644 --- a/av1/av1_dx_iface.c +++ b/av1/av1_dx_iface.c
@@ -557,7 +557,7 @@ (FrameWorkerData *)worker->data1; struct AV1Decoder *pbi = frame_worker_data->pbi; for (size_t j = 0; j < pbi->num_output_frames; j++) { - decrease_ref_count((int)pbi->output_frame_index[j], frame_bufs, pool); + decrease_ref_count(pbi->output_frame_index[j], frame_bufs, pool); } pbi->num_output_frames = 0; }
diff --git a/av1/decoder/decoder.c b/av1/decoder/decoder.c index c0b55b6..b38d97b 100644 --- a/av1/decoder/decoder.c +++ b/av1/decoder/decoder.c
@@ -418,7 +418,7 @@ // Replace any existing output frame assert(pbi->num_output_frames == 0 || pbi->num_output_frames == 1); if (pbi->num_output_frames > 0) { - decrease_ref_count((int)pbi->output_frame_index[0], frame_bufs, pool); + decrease_ref_count(pbi->output_frame_index[0], frame_bufs, pool); } pbi->output_frames[0] = cur_frame; pbi->output_frame_index[0] = cm->new_fb_idx;
diff --git a/av1/decoder/decoder.h b/av1/decoder/decoder.h index cc34bbe..683a094 100644 --- a/av1/decoder/decoder.h +++ b/av1/decoder/decoder.h
@@ -195,7 +195,7 @@ // application calls aom_codec_decode(). int output_all_layers; YV12_BUFFER_CONFIG *output_frames[MAX_NUM_SPATIAL_LAYERS]; - size_t output_frame_index[MAX_NUM_SPATIAL_LAYERS]; // Buffer pool indices + int output_frame_index[MAX_NUM_SPATIAL_LAYERS]; // Buffer pool indices size_t num_output_frames; // How many frames are queued up so far? // In order to properly support random-access decoding, we need