lavc/h264: replace MAX_DELAYED_PIC_COUNT with FF_ARRAY_ELEMS where appropriate

This commit is contained in:
Anton Khirnov 2022-01-24 18:00:05 +01:00 committed by Andreas Rheinhardt
parent 5484c502db
commit ef4537bd1b
3 changed files with 4 additions and 4 deletions

View File

@ -729,7 +729,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
h->poc.frame_num = h->cur_pic_ptr->frame_num = 0;
h->mmco_reset = 1;
h->cur_pic_ptr->mmco_reset = 1;
for (j = 0; j < MAX_DELAYED_PIC_COUNT; j++)
for (j = 0; j < FF_ARRAY_ELEMS(h->last_pocs); j++)
h->last_pocs[j] = INT_MIN;
break;
default: av_assert0(0);

View File

@ -428,7 +428,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
copy_picture_range(h->short_ref, h1->short_ref, 32, h, h1);
copy_picture_range(h->long_ref, h1->long_ref, 32, h, h1);
copy_picture_range(h->delayed_pic, h1->delayed_pic,
MAX_DELAYED_PIC_COUNT + 2, h, h1);
FF_ARRAY_ELEMS(h->delayed_pic), h, h1);
h->frame_recovered = h1->frame_recovered;

View File

@ -308,7 +308,7 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h)
h->sei.unregistered.x264_build = -1;
h->next_outputed_poc = INT_MIN;
for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++)
for (i = 0; i < FF_ARRAY_ELEMS(h->last_pocs); i++)
h->last_pocs[i] = INT_MIN;
ff_h264_sei_uninit(&h->sei);
@ -445,7 +445,7 @@ static void idr(H264Context *h)
h->poc.prev_frame_num_offset = 0;
h->poc.prev_poc_msb = 1<<16;
h->poc.prev_poc_lsb = -1;
for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++)
for (i = 0; i < FF_ARRAY_ELEMS(h->last_pocs); i++)
h->last_pocs[i] = INT_MIN;
}