diff mbox series

[FFmpeg-devel,16/18] avcodec/h264_parse: Move find_start_code() to its only user

Message ID AM7PR03MB66608FDD061C7303A5E4B8F88F5E9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Superseded
Headers show
Series [FFmpeg-devel,01/13] lavc/h264: replace MAX_MMCO_COUNT with H264_MAX_MMCO_COUNT | expand

Checks

Context Check Description
andriy/configurex86 warning Failed to apply patch
andriy/configure_aarch64_jetson warning Failed to apply patch

Commit Message

Andreas Rheinhardt Jan. 24, 2022, 6:48 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/h264_parse.h  | 13 +------------
 libavcodec/h264_parser.c |  9 +++++++++
 2 files changed, 10 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/h264_parse.h b/libavcodec/h264_parse.h
index 9b6391edda..3901b46ac2 100644
--- a/libavcodec/h264_parse.h
+++ b/libavcodec/h264_parse.h
@@ -28,11 +28,10 @@ 
 
 #include <stdint.h>
 
-#include "libavutil/common.h"
+#include "libavutil/attributes.h"
 
 #include "get_bits.h"
 #include "h264_ps.h"
-#include "internal.h"
 
 #define MB_TYPE_REF0       MB_TYPE_ACPRED // dirty but it fits in 16 bit
 #define MB_TYPE_8x8DCT     0x01000000
@@ -130,16 +129,6 @@  int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps,
  */
 int ff_h264_get_profile(const SPS *sps);
 
-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);
-}
-
 static av_always_inline uint32_t pack16to32(unsigned a, unsigned b)
 {
 #if HAVE_BIGENDIAN
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index b221459c1b..d9cbb7d6d5 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -67,6 +67,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)