summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_parser.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-03-07 00:28:14 +0100
committerJames Almer <jamrial@gmail.com>2021-04-27 10:43:16 -0300
commite5af9203098a889f36b759652615046254d45102 (patch)
tree5b27c29186fc551d4d40669039fb49ab04224baf /libavcodec/hevc_parser.c
parente625ae609206e0550ff733965c6f5447579320aa (diff)
downloadffmpeg-e5af9203098a889f36b759652615046254d45102.tar.gz
avcodec: Move all AVCodecParser.split functions to remove_extradata_bsf
The remove_extradata bsf is the only user of these functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevc_parser.c')
-rw-r--r--libavcodec/hevc_parser.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 320d4eb562..c944a6aacd 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -336,39 +336,6 @@ static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
return next;
}
-// Split after the parameter sets at the beginning of the stream if they exist.
-static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
-{
- const uint8_t *ptr = buf, *end = buf + buf_size;
- uint32_t state = -1;
- int has_vps = 0;
- int has_sps = 0;
- int has_pps = 0;
- int nut;
-
- while (ptr < end) {
- ptr = avpriv_find_start_code(ptr, end, &state);
- if ((state >> 8) != START_CODE)
- break;
- nut = (state >> 1) & 0x3F;
- if (nut == HEVC_NAL_VPS)
- has_vps = 1;
- else if (nut == HEVC_NAL_SPS)
- has_sps = 1;
- else if (nut == HEVC_NAL_PPS)
- has_pps = 1;
- else if ((nut != HEVC_NAL_SEI_PREFIX || has_pps) &&
- nut != HEVC_NAL_AUD) {
- if (has_vps && has_sps) {
- while (ptr - 4 > buf && ptr[-5] == 0)
- ptr--;
- return ptr - 4 - buf;
- }
- }
- }
- return 0;
-}
-
static void hevc_parser_close(AVCodecParserContext *s)
{
HEVCParserContext *ctx = s->priv_data;
@@ -385,5 +352,4 @@ const AVCodecParser ff_hevc_parser = {
.priv_data_size = sizeof(HEVCParserContext),
.parser_parse = hevc_parse,
.parser_close = hevc_parser_close,
- .split = hevc_split,
};