diff mbox series

[FFmpeg-devel,v2,01/18] avcodec/h264dec: Move find_start_code() to its only user

Message ID AM7PR03MB6660FFBD9B9DB75F5B0B6A928F5E9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit b531b58b2c9f684ad9408f878453e10908ca94de
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 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/h264_parser.c |  9 +++++++++
 libavcodec/h264dec.h     | 11 -----------
 2 files changed, 9 insertions(+), 11 deletions(-)

Comments

Anton Khirnov Jan. 26, 2022, 11:18 a.m. UTC | #1
Patchset LGMT, except for the trivial comments I sent.
diff mbox series

Patch

diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index cfbf6f4486..881cab7536 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -64,6 +64,15 @@  typedef struct H264ParseContext {
     int last_frame_num, last_picture_structure;
 } H264ParseContext;
 
+static int find_start_code(const uint8_t *buf, int buf_size,
+                                  int buf_index, int next_avc)
+{
+    uint32_t state = -1;
+
+    buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1;
+
+    return FFMIN(buf_index, buf_size);
+}
 
 static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf,
                                int buf_size, void *logctx)
diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h
index 87c4e4e539..1128dddfd1 100644
--- a/libavcodec/h264dec.h
+++ b/libavcodec/h264dec.h
@@ -44,7 +44,6 @@ 
 #include "h264pred.h"
 #include "h264qpel.h"
 #include "h274.h"
-#include "internal.h"
 #include "mpegutils.h"
 #include "parser.h"
 #include "qpeldsp.h"
@@ -833,16 +832,6 @@  static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceCo
                   0x0001000100010001ULL));
 }
 
-static inline int find_start_code(const uint8_t *buf, int buf_size,
-                           int buf_index, int next_avc)
-{
-    uint32_t state = -1;
-
-    buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1;
-
-    return FFMIN(buf_index, buf_size);
-}
-
 int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup);
 
 int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src);