Re: [FFmpeg-devel] [PATCH 81/87] avcodec: Move all AVCodecParser.split functions to remove_extradata_bsf

2022-05-12 Thread John Stebbins
Thanks for the pointer. Much appreciated.

On Thu, 2022-05-12 at 17:43 +0200, Andreas Rheinhardt wrote:
> John Stebbins:
> > Hi all,
> > 
> > I know this happened quite some time ago, but we just noticed the
> > change.
> > 
> > This effectively disables the public API AVCodecParser.split for
> > these
> > codecs. HandBrake uses this API to split out extradata for a few
> > codecs. Any chance we can bring these back?  Otherwise, we will
> > have to
> > replicate this code in HandBrake 😕️
> > 
> 
> I know that AVCodecParser was lacking the typical public-private
> demarkation, but you are actually not supposed to call these function
> pointers directly. In fact, it is not publically documented at all
> what
> AVCodecParser.split does.
> Anyway, use the extract_extradata BSF. It is the intended replacement
> for this feature. It is also what avformat_find_stream_info() uses to
> extract extradata in case the container doesn't provide any.
> 
> > On Mon, 2021-04-19 at 11:10 -0300, James Almer wrote:
> > > From: Andreas Rheinhardt 
> > > 
> > > The remove_extradata bsf is the only user of these functions.
> > > 
> > > Signed-off-by: Andreas Rheinhardt 
> > > ---
> > >  libavcodec/Makefile   |   4 +-
> > >  libavcodec/av1_parser.c   |  25 +---
> > >  libavcodec/avs2_parser.c  |   1 -
> > >  libavcodec/avs3_parser.c  |   1 -
> > >  libavcodec/cavs_parser.c  |   1 -
> > >  libavcodec/h264_parser.c  |  38 --
> > >  libavcodec/hevc_parser.c  |  34 -
> > >  libavcodec/mpeg4video_parser.c    |   1 -
> > >  libavcodec/mpegvideo_parser.c |  18 ---
> > >  libavcodec/parser.c   |  14 ---
> > >  libavcodec/remove_extradata_bsf.c | 201
> > > +---
> > > --
> > >  libavcodec/vc1_parser.c   |  19 ---
> > >  12 files changed, 171 insertions(+), 186 deletions(-)
> > > 
> > > diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> > > index a640c548e5..c19a3cb60d 100644
> > > --- a/libavcodec/Makefile
> > > +++ b/libavcodec/Makefile
> > > @@ -1075,7 +1075,7 @@ OBJS-$(CONFIG_AAC_PARSER)  +=
> > > aac_parser.o aac_ac3_parser.o \
> > >    mpeg4audio.o
> > >  OBJS-$(CONFIG_AC3_PARSER)  += ac3tab.o
> > > aac_ac3_parser.o
> > >  OBJS-$(CONFIG_ADX_PARSER)  += adx_parser.o adx.o
> > > -OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o
> > > av1_parse.o
> > > +OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o
> > >  OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o
> > >  OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o
> > >  OBJS-$(CONFIG_BMP_PARSER)  += bmp_parser.o
> > > @@ -1159,7 +1159,7 @@ OBJS-$(CONFIG_NULL_BSF)  
> > > +=
> > > null_bsf.o
> > >  OBJS-$(CONFIG_OPUS_METADATA_BSF)  += opus_metadata_bsf.o
> > >  OBJS-$(CONFIG_PCM_RECHUNK_BSF)    += pcm_rechunk_bsf.o
> > >  OBJS-$(CONFIG_PRORES_METADATA_BSF)    +=
> > > prores_metadata_bsf.o
> > > -OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   +=
> > > remove_extradata_bsf.o
> > > +OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   +=
> > > remove_extradata_bsf.o
> > > av1_parse.o
> > >  OBJS-$(CONFIG_SETTS_BSF)  += setts_bsf.o
> > >  OBJS-$(CONFIG_TEXT2MOVSUB_BSF)    += movsub_bsf.o
> > >  OBJS-$(CONFIG_TRACE_HEADERS_BSF)  += trace_headers_bsf.o
> > > diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
> > > index 578f5293c8..b6c8004ee3 100644
> > > --- a/libavcodec/av1_parser.c
> > > +++ b/libavcodec/av1_parser.c
> > > @@ -20,7 +20,7 @@
> > >   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> > > 02110-1301 USA
> > >   */
> > >  
> > > -#include "av1_parse.h"
> > > +#include "libavutil/avassert.h"
> > >  #include "cbs.h"
> > >  #include "cbs_av1.h"
> > >  #include "internal.h"
> > > @@ -205,33 +205,10 @@ static void
> > > av1_parser_close(AVCodecParserContext *ctx)
> > >  ff_cbs_close(&s->cbc);
> > >  }
> > >  
> > > -static int av1_parser_split(AVCodecContext *avctx,
> > > -    const uint8_t *buf, int buf_size)
> > > -{
> > > -    AV1OBU obu;
> > > -    const uint8_t *ptr = buf, *end = buf + buf_size;
> > > -
> > > -    while (ptr < end) {
> > > -    int len = ff_av1_extract_obu(&obu, ptr, buf_size,
> > > avctx);
> > > -    if (len < 0)
> > > -    break;
> > > -
> > > -    if (obu.type == AV1_OBU_FRAME_HEADER ||
> > > -    obu.type == AV1_OBU_FRAME) {
> > > -    return ptr - buf;
> > > -    }
> > > -    ptr  += len;
> > > -    buf_size -= len;
> > > -    }
> > > -
> > > -    return 0;
> > > -}
> > > -
> > >  const AVCodecParser ff_av1_parser = {
> > >  .codec_ids  = { AV_CODEC_ID_AV1 },
> > >  .priv_data_size = sizeof(AV1ParseContext),
> > >  .parser_init    = av1_parser_init,
> > >  .parser_close   = av1_parser_close,
> > >  .parser_parse   = av1_parser_parse,
> > > -    .

Re: [FFmpeg-devel] [PATCH 81/87] avcodec: Move all AVCodecParser.split functions to remove_extradata_bsf

2022-05-12 Thread Andreas Rheinhardt
John Stebbins:
> Hi all,
> 
> I know this happened quite some time ago, but we just noticed the
> change.
> 
> This effectively disables the public API AVCodecParser.split for these
> codecs. HandBrake uses this API to split out extradata for a few
> codecs. Any chance we can bring these back?  Otherwise, we will have to
> replicate this code in HandBrake 😕️
> 

I know that AVCodecParser was lacking the typical public-private
demarkation, but you are actually not supposed to call these function
pointers directly. In fact, it is not publically documented at all what
AVCodecParser.split does.
Anyway, use the extract_extradata BSF. It is the intended replacement
for this feature. It is also what avformat_find_stream_info() uses to
extract extradata in case the container doesn't provide any.

> On Mon, 2021-04-19 at 11:10 -0300, James Almer wrote:
>> From: Andreas Rheinhardt 
>>
>> The remove_extradata bsf is the only user of these functions.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavcodec/Makefile   |   4 +-
>>  libavcodec/av1_parser.c   |  25 +---
>>  libavcodec/avs2_parser.c  |   1 -
>>  libavcodec/avs3_parser.c  |   1 -
>>  libavcodec/cavs_parser.c  |   1 -
>>  libavcodec/h264_parser.c  |  38 --
>>  libavcodec/hevc_parser.c  |  34 -
>>  libavcodec/mpeg4video_parser.c    |   1 -
>>  libavcodec/mpegvideo_parser.c |  18 ---
>>  libavcodec/parser.c   |  14 ---
>>  libavcodec/remove_extradata_bsf.c | 201 +---
>> --
>>  libavcodec/vc1_parser.c   |  19 ---
>>  12 files changed, 171 insertions(+), 186 deletions(-)
>>
>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
>> index a640c548e5..c19a3cb60d 100644
>> --- a/libavcodec/Makefile
>> +++ b/libavcodec/Makefile
>> @@ -1075,7 +1075,7 @@ OBJS-$(CONFIG_AAC_PARSER)  +=
>> aac_parser.o aac_ac3_parser.o \
>>    mpeg4audio.o
>>  OBJS-$(CONFIG_AC3_PARSER)  += ac3tab.o aac_ac3_parser.o
>>  OBJS-$(CONFIG_ADX_PARSER)  += adx_parser.o adx.o
>> -OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o av1_parse.o
>> +OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o
>>  OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o
>>  OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o
>>  OBJS-$(CONFIG_BMP_PARSER)  += bmp_parser.o
>> @@ -1159,7 +1159,7 @@ OBJS-$(CONFIG_NULL_BSF)   +=
>> null_bsf.o
>>  OBJS-$(CONFIG_OPUS_METADATA_BSF)  += opus_metadata_bsf.o
>>  OBJS-$(CONFIG_PCM_RECHUNK_BSF)    += pcm_rechunk_bsf.o
>>  OBJS-$(CONFIG_PRORES_METADATA_BSF)    += prores_metadata_bsf.o
>> -OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o
>> +OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o
>> av1_parse.o
>>  OBJS-$(CONFIG_SETTS_BSF)  += setts_bsf.o
>>  OBJS-$(CONFIG_TEXT2MOVSUB_BSF)    += movsub_bsf.o
>>  OBJS-$(CONFIG_TRACE_HEADERS_BSF)  += trace_headers_bsf.o
>> diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
>> index 578f5293c8..b6c8004ee3 100644
>> --- a/libavcodec/av1_parser.c
>> +++ b/libavcodec/av1_parser.c
>> @@ -20,7 +20,7 @@
>>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
>> 02110-1301 USA
>>   */
>>  
>> -#include "av1_parse.h"
>> +#include "libavutil/avassert.h"
>>  #include "cbs.h"
>>  #include "cbs_av1.h"
>>  #include "internal.h"
>> @@ -205,33 +205,10 @@ static void
>> av1_parser_close(AVCodecParserContext *ctx)
>>  ff_cbs_close(&s->cbc);
>>  }
>>  
>> -static int av1_parser_split(AVCodecContext *avctx,
>> -    const uint8_t *buf, int buf_size)
>> -{
>> -    AV1OBU obu;
>> -    const uint8_t *ptr = buf, *end = buf + buf_size;
>> -
>> -    while (ptr < end) {
>> -    int len = ff_av1_extract_obu(&obu, ptr, buf_size, avctx);
>> -    if (len < 0)
>> -    break;
>> -
>> -    if (obu.type == AV1_OBU_FRAME_HEADER ||
>> -    obu.type == AV1_OBU_FRAME) {
>> -    return ptr - buf;
>> -    }
>> -    ptr  += len;
>> -    buf_size -= len;
>> -    }
>> -
>> -    return 0;
>> -}
>> -
>>  const AVCodecParser ff_av1_parser = {
>>  .codec_ids  = { AV_CODEC_ID_AV1 },
>>  .priv_data_size = sizeof(AV1ParseContext),
>>  .parser_init    = av1_parser_init,
>>  .parser_close   = av1_parser_close,
>>  .parser_parse   = av1_parser_parse,
>> -    .split  = av1_parser_split,
>>  };
>> diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
>> index 059faf77c5..b7d5d7774e 100644
>> --- a/libavcodec/avs2_parser.c
>> +++ b/libavcodec/avs2_parser.c
>> @@ -91,5 +91,4 @@ const AVCodecParser ff_avs2_parser = {
>>  .priv_data_size = sizeof(ParseContext),
>>  .parser_parse   = avs2_parse,
>>  .parser_close   = ff_parse_close,
>> -    .split  = ff_mpeg4video_split,
>>  };
>> diff --git a/libavcodec/avs

Re: [FFmpeg-devel] [PATCH 81/87] avcodec: Move all AVCodecParser.split functions to remove_extradata_bsf

2022-05-12 Thread John Stebbins
Hi all,

I know this happened quite some time ago, but we just noticed the
change.

This effectively disables the public API AVCodecParser.split for these
codecs. HandBrake uses this API to split out extradata for a few
codecs. Any chance we can bring these back?  Otherwise, we will have to
replicate this code in HandBrake 😕️

On Mon, 2021-04-19 at 11:10 -0300, James Almer wrote:
> From: Andreas Rheinhardt 
> 
> The remove_extradata bsf is the only user of these functions.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/Makefile   |   4 +-
>  libavcodec/av1_parser.c   |  25 +---
>  libavcodec/avs2_parser.c  |   1 -
>  libavcodec/avs3_parser.c  |   1 -
>  libavcodec/cavs_parser.c  |   1 -
>  libavcodec/h264_parser.c  |  38 --
>  libavcodec/hevc_parser.c  |  34 -
>  libavcodec/mpeg4video_parser.c    |   1 -
>  libavcodec/mpegvideo_parser.c |  18 ---
>  libavcodec/parser.c   |  14 ---
>  libavcodec/remove_extradata_bsf.c | 201 +---
> --
>  libavcodec/vc1_parser.c   |  19 ---
>  12 files changed, 171 insertions(+), 186 deletions(-)
> 
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index a640c548e5..c19a3cb60d 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -1075,7 +1075,7 @@ OBJS-$(CONFIG_AAC_PARSER)  +=
> aac_parser.o aac_ac3_parser.o \
>    mpeg4audio.o
>  OBJS-$(CONFIG_AC3_PARSER)  += ac3tab.o aac_ac3_parser.o
>  OBJS-$(CONFIG_ADX_PARSER)  += adx_parser.o adx.o
> -OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o av1_parse.o
> +OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o
>  OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o
>  OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o
>  OBJS-$(CONFIG_BMP_PARSER)  += bmp_parser.o
> @@ -1159,7 +1159,7 @@ OBJS-$(CONFIG_NULL_BSF)   +=
> null_bsf.o
>  OBJS-$(CONFIG_OPUS_METADATA_BSF)  += opus_metadata_bsf.o
>  OBJS-$(CONFIG_PCM_RECHUNK_BSF)    += pcm_rechunk_bsf.o
>  OBJS-$(CONFIG_PRORES_METADATA_BSF)    += prores_metadata_bsf.o
> -OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o
> +OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o
> av1_parse.o
>  OBJS-$(CONFIG_SETTS_BSF)  += setts_bsf.o
>  OBJS-$(CONFIG_TEXT2MOVSUB_BSF)    += movsub_bsf.o
>  OBJS-$(CONFIG_TRACE_HEADERS_BSF)  += trace_headers_bsf.o
> diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
> index 578f5293c8..b6c8004ee3 100644
> --- a/libavcodec/av1_parser.c
> +++ b/libavcodec/av1_parser.c
> @@ -20,7 +20,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
>   */
>  
> -#include "av1_parse.h"
> +#include "libavutil/avassert.h"
>  #include "cbs.h"
>  #include "cbs_av1.h"
>  #include "internal.h"
> @@ -205,33 +205,10 @@ static void
> av1_parser_close(AVCodecParserContext *ctx)
>  ff_cbs_close(&s->cbc);
>  }
>  
> -static int av1_parser_split(AVCodecContext *avctx,
> -    const uint8_t *buf, int buf_size)
> -{
> -    AV1OBU obu;
> -    const uint8_t *ptr = buf, *end = buf + buf_size;
> -
> -    while (ptr < end) {
> -    int len = ff_av1_extract_obu(&obu, ptr, buf_size, avctx);
> -    if (len < 0)
> -    break;
> -
> -    if (obu.type == AV1_OBU_FRAME_HEADER ||
> -    obu.type == AV1_OBU_FRAME) {
> -    return ptr - buf;
> -    }
> -    ptr  += len;
> -    buf_size -= len;
> -    }
> -
> -    return 0;
> -}
> -
>  const AVCodecParser ff_av1_parser = {
>  .codec_ids  = { AV_CODEC_ID_AV1 },
>  .priv_data_size = sizeof(AV1ParseContext),
>  .parser_init    = av1_parser_init,
>  .parser_close   = av1_parser_close,
>  .parser_parse   = av1_parser_parse,
> -    .split  = av1_parser_split,
>  };
> diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
> index 059faf77c5..b7d5d7774e 100644
> --- a/libavcodec/avs2_parser.c
> +++ b/libavcodec/avs2_parser.c
> @@ -91,5 +91,4 @@ const AVCodecParser ff_avs2_parser = {
>  .priv_data_size = sizeof(ParseContext),
>  .parser_parse   = avs2_parse,
>  .parser_close   = ff_parse_close,
> -    .split  = ff_mpeg4video_split,
>  };
> diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c
> index b0e720a844..1a05ea042e 100644
> --- a/libavcodec/avs3_parser.c
> +++ b/libavcodec/avs3_parser.c
> @@ -175,5 +175,4 @@ const AVCodecParser ff_avs3_parser = {
>  .priv_data_size = sizeof(ParseContext),
>  .parser_parse   = avs3_parse,
>  .parser_close   = ff_parse_close,
> -    .split  = ff_mpeg4video_split,
>  };
> diff --git a/libavcodec/cavs_parser.c b/libavcodec/cavs_parser.c
> index 20adca1dbc..03f392c2e5 100644
> --- a/libavcodec/cavs_parser.c
> +++ b/libavcodec/cavs_parser.c
> @@ -102,5 +102,4 @@ con

[FFmpeg-devel] [PATCH 81/87] avcodec: Move all AVCodecParser.split functions to remove_extradata_bsf

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

The remove_extradata bsf is the only user of these functions.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/Makefile   |   4 +-
 libavcodec/av1_parser.c   |  25 +---
 libavcodec/avs2_parser.c  |   1 -
 libavcodec/avs3_parser.c  |   1 -
 libavcodec/cavs_parser.c  |   1 -
 libavcodec/h264_parser.c  |  38 --
 libavcodec/hevc_parser.c  |  34 -
 libavcodec/mpeg4video_parser.c|   1 -
 libavcodec/mpegvideo_parser.c |  18 ---
 libavcodec/parser.c   |  14 ---
 libavcodec/remove_extradata_bsf.c | 201 +-
 libavcodec/vc1_parser.c   |  19 ---
 12 files changed, 171 insertions(+), 186 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a640c548e5..c19a3cb60d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1075,7 +1075,7 @@ OBJS-$(CONFIG_AAC_PARSER)  += aac_parser.o 
aac_ac3_parser.o \
   mpeg4audio.o
 OBJS-$(CONFIG_AC3_PARSER)  += ac3tab.o aac_ac3_parser.o
 OBJS-$(CONFIG_ADX_PARSER)  += adx_parser.o adx.o
-OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o av1_parse.o
+OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o
 OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o
 OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o
 OBJS-$(CONFIG_BMP_PARSER)  += bmp_parser.o
@@ -1159,7 +1159,7 @@ OBJS-$(CONFIG_NULL_BSF)   += null_bsf.o
 OBJS-$(CONFIG_OPUS_METADATA_BSF)  += opus_metadata_bsf.o
 OBJS-$(CONFIG_PCM_RECHUNK_BSF)+= pcm_rechunk_bsf.o
 OBJS-$(CONFIG_PRORES_METADATA_BSF)+= prores_metadata_bsf.o
-OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o
+OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o av1_parse.o
 OBJS-$(CONFIG_SETTS_BSF)  += setts_bsf.o
 OBJS-$(CONFIG_TEXT2MOVSUB_BSF)+= movsub_bsf.o
 OBJS-$(CONFIG_TRACE_HEADERS_BSF)  += trace_headers_bsf.o
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index 578f5293c8..b6c8004ee3 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "av1_parse.h"
+#include "libavutil/avassert.h"
 #include "cbs.h"
 #include "cbs_av1.h"
 #include "internal.h"
@@ -205,33 +205,10 @@ static void av1_parser_close(AVCodecParserContext *ctx)
 ff_cbs_close(&s->cbc);
 }
 
-static int av1_parser_split(AVCodecContext *avctx,
-const uint8_t *buf, int buf_size)
-{
-AV1OBU obu;
-const uint8_t *ptr = buf, *end = buf + buf_size;
-
-while (ptr < end) {
-int len = ff_av1_extract_obu(&obu, ptr, buf_size, avctx);
-if (len < 0)
-break;
-
-if (obu.type == AV1_OBU_FRAME_HEADER ||
-obu.type == AV1_OBU_FRAME) {
-return ptr - buf;
-}
-ptr  += len;
-buf_size -= len;
-}
-
-return 0;
-}
-
 const AVCodecParser ff_av1_parser = {
 .codec_ids  = { AV_CODEC_ID_AV1 },
 .priv_data_size = sizeof(AV1ParseContext),
 .parser_init= av1_parser_init,
 .parser_close   = av1_parser_close,
 .parser_parse   = av1_parser_parse,
-.split  = av1_parser_split,
 };
diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
index 059faf77c5..b7d5d7774e 100644
--- a/libavcodec/avs2_parser.c
+++ b/libavcodec/avs2_parser.c
@@ -91,5 +91,4 @@ const AVCodecParser ff_avs2_parser = {
 .priv_data_size = sizeof(ParseContext),
 .parser_parse   = avs2_parse,
 .parser_close   = ff_parse_close,
-.split  = ff_mpeg4video_split,
 };
diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c
index b0e720a844..1a05ea042e 100644
--- a/libavcodec/avs3_parser.c
+++ b/libavcodec/avs3_parser.c
@@ -175,5 +175,4 @@ const AVCodecParser ff_avs3_parser = {
 .priv_data_size = sizeof(ParseContext),
 .parser_parse   = avs3_parse,
 .parser_close   = ff_parse_close,
-.split  = ff_mpeg4video_split,
 };
diff --git a/libavcodec/cavs_parser.c b/libavcodec/cavs_parser.c
index 20adca1dbc..03f392c2e5 100644
--- a/libavcodec/cavs_parser.c
+++ b/libavcodec/cavs_parser.c
@@ -102,5 +102,4 @@ const AVCodecParser ff_cavsvideo_parser = {
 .priv_data_size = sizeof(ParseContext),
 .parser_parse   = cavsvideo_parse,
 .parser_close   = ff_parse_close,
-.split  = ff_mpeg4video_split,
 };
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 880ccb50fa..d3c56cc188 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -644,43 +644,6 @@ static int h264_parse(AVCodecParserContext *s,
 return next;
 }
 
-static int h264_split(AVCodecContext *avctx,
-  const uint8_t *buf, int buf_size)
-{
-uint32_t state = -1;
-int has_sps= 0;