[Mp4-tech] Dropping NAL units on bit errors: Best approach?
John Cox
jc sj.co.uk
Mon Oct 23 17:26:32 ESTEDT 2006
Samuel, Gary
You are correct - I had overlooked the text at the start of Annex-B
where it says:
"The byte stream format consists of a sequence of byte stream NAL unit
syntax structures. Each byte stream NAL unit syntax structure contains
one start code prefix followed by one nal_unit( NumBytesInNALunit )
syntax structure. It may (and under some circumstances, it shall) also
contain an additional zero_byte syntax element. It may also contain one
or more additional trailing_zero_8bits syntax elements. When it is the
first byte stream NAL unit in the bitstream, it may also contain one or
more additional leading_zero_8bits syntax elements."
Which makes everything much clearer.
Thank you everyone for fixing my misreading. I clearly understood this
once as my code is correct even if my recent arguments have been wrong!
Regards
John Cox
>John Cox wrote:
>> It is always legal to pack the end of a nal_unit with extra zeros
>> (trailing_zero_8bits) so a non-start-of-AU NALU may appear to have three
>> leading seros but in fact that is one zero on the end of the previous
>> unit and two leading zeros on this unit. This detail is important if
>> you are trying to determine the exact byte on which a unit starts (e.g.
>> when encapsulated in PES the PTS applies to the first unit which starts
>> in that PES packet).
>
> I do not think it is that way. The spec reads:
>
>"When any of the following conditions are fulfilled, the zero_byte
>syntax element shall be present"
>
> I might have overlooked it, but I think there is not a statement
>saying that "the zero_byte shall not be present otherwise". Thus,
>following the description in B.1.1, any 0x00000001 is always a zero_byte
>followed by a start_code_prefix_one_3bytes.
>
> Regards.
More information about the Mp4-tech
mailing list