[FFmpeg-devel] avcodec/h264_parser: create nalus without trailing bits

Submitted by Aman Gupta on May 18, 2018, 11:50 p.m.

Details

Message ID 20180518235013.40599-1-ffmpeg@tmm1.net
State New
Headers show

Commit Message

Aman Gupta May 18, 2018, 11:50 p.m.
From: Aman Gupta <aman@tmm1.net>

Fixes "unknown SEI type 128" debug messages from the parser
on https://tmm1.s3.amazonaws.com/vts.mpg

Signed-off-by: Aman Gupta <aman@tmm1.net>
---
 libavcodec/h264_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Aman Gupta May 19, 2018, 12:19 a.m.
On Fri, May 18, 2018 at 4:50 PM, Aman Gupta <ffmpeg@tmm1.net> wrote:

> From: Aman Gupta <aman@tmm1.net>
>
> Fixes "unknown SEI type 128" debug messages from the parser
> on https://tmm1.s3.amazonaws.com/vts.mpg


This fixed SEI parsing, but now I'm seeing other parser errors on the same
input:

Overread SPS by 8 bits
illegal reordering_of_pic_nums_idc 5

So this is still not quite right.

Aman


>
>
> Signed-off-by: Aman Gupta <aman@tmm1.net>
> ---
>  libavcodec/h264_parser.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
> index 1a9840a62c..a546239370 100644
> --- a/libavcodec/h264_parser.c
> +++ b/libavcodec/h264_parser.c
> @@ -311,7 +311,7 @@ static inline int parse_nal_units(AVCodecParserContext
> *s,
>
>          buf_index += consumed;
>
> -        ret = init_get_bits8(&nal.gb, nal.data, nal.size);
> +        ret = init_get_bits(&nal.gb, nal.data, nal.size_bits);
>          if (ret < 0)
>              goto fail;
>          get_bits1(&nal.gb);
> --
> 2.14.2
>
>
Michael Niedermayer May 19, 2018, 1:53 a.m.
On Fri, May 18, 2018 at 05:19:48PM -0700, Aman Gupta wrote:
> On Fri, May 18, 2018 at 4:50 PM, Aman Gupta <ffmpeg@tmm1.net> wrote:
> 
> > From: Aman Gupta <aman@tmm1.net>
> >
> > Fixes "unknown SEI type 128" debug messages from the parser
> > on https://tmm1.s3.amazonaws.com/vts.mpg
> 
> 
> This fixed SEI parsing, but now I'm seeing other parser errors on the same
> input:
> 
> Overread SPS by 8 bits
> illegal reordering_of_pic_nums_idc 5
> 
> So this is still not quite right.

yes, the patch also breaks some fate tests
for example fate-h264-conformance-bamq1_jvc_c

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 1a9840a62c..a546239370 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -311,7 +311,7 @@  static inline int parse_nal_units(AVCodecParserContext *s,
 
         buf_index += consumed;
 
-        ret = init_get_bits8(&nal.gb, nal.data, nal.size);
+        ret = init_get_bits(&nal.gb, nal.data, nal.size_bits);
         if (ret < 0)
             goto fail;
         get_bits1(&nal.gb);