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
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c index 510100d..534e780 100644 --- a/av1/av1_dx_iface.c +++ b/av1/av1_dx_iface.c
@@ -558,7 +558,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 9b958e6..00f7916 100644 --- a/av1/decoder/decoder.c +++ b/av1/decoder/decoder.c
@@ -417,7 +417,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 838080f..f8cc3ab 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