[vlc-devel] [PATCH] h264_nal: fix NAL parsing

Rémi Denis-Courmont remi at remlab.net
Mon Jul 13 14:31:31 CEST 2015


Le 2015-07-13 15:17, Francois Cartegnie a écrit :
> Le 13/07/2015 14:06, Rémi Denis-Courmont a écrit :
>> Le 2015-07-13 15:04, Thomas Guillem a écrit :
>>> On Mon, Jul 13, 2015, at 13:58, Rémi Denis-Courmont wrote:
>>>> Le 2015-07-13 14:22, Thomas Guillem a écrit :
>>>> > The NAL start code prefix is "0x00 0x00 0x01" and is not always
>>>> > followed by an other zero byte.
>>>>
>>>> NAL start code is always followed by the first NAL byte, which 
>>>> cannot
>>>> be zero in current H.264.
>>>
>>> Oops, I wanted to say prefixed, not followed.
>>> "The NAL start code prefix is "0x00 0x00 0x01" and is not always
>>> prefixed by an other zero byte."
>>
>> That's still wrong.
>
> NAL start code is always "0x00 0x00 0x01" and is prefixed by one more
> zero byte when first in sequence or NAL is sps or pps.

 From the parsing/decoding point of view, that's over-simplifying. The 
parser should look for \0\0\0\1 at start, on discontinuity, or on detect 
syntax. And *then* it should look for \0\0\1.

I hope we can assume that trailing zero bytes will be ignored by the 
decoders. But I don't think we can treat \0\0\1 the same as \0\0\0\1 in 
the depacketizer.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list