diff mbox series

[FFmpeg-devel,v2,05/18] lavc/h264: replace MAX_DELAYED_PIC_COUNT with FF_ARRAY_ELEMS where appropriate

Message ID AM7PR03MB6660573E3DED4009809C07558F5E9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Headers show
Series [FFmpeg-devel,v2,01/18] avcodec/h264dec: Move find_start_code() to its only user | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 24, 2022, 8:09 p.m. UTC
From: Anton Khirnov <anton@khirnov.net>

---
 libavcodec/h264_refs.c  | 2 +-
 libavcodec/h264_slice.c | 2 +-
 libavcodec/h264dec.c    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 93526b11e2..94b473257f 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -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);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 4833282191..d6d4497fc9 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -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;
 
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 7f10026340..3706ae0e31 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -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;
 }