[FFmpeg-devel] [PATCH 16/18] avcodec/h264_parse: Move find_start_code() to its only user
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Mon Jan 24 20:48:25 EET 2022
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavcodec/h264_parse.h | 13 +------------
libavcodec/h264_parser.c | 9 +++++++++
2 files changed, 10 insertions(+), 12 deletions(-)
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)
--
2.32.0
More information about the ffmpeg-devel
mailing list