what are the difference between 0x000001 (3Bytes) and 0x00000001(4Bytes)?

0

H264 bitstreams has a three-byte or four-byte start code, 0x000001 or 0x00000001.

what are the difference between 0x000001 (3Bytes) and 0x00000001(4Bytes)?

thank you !

h.264
asked on Stack Overflow Jul 2, 2020 by smart

1 Answer

1

3 byte take less space, so are preferable, but not do not include enough information to detect byte alignment. If you join a stream of bits in the middle of a byte, you can find 4 byte start codes by looking for 31 zero bits followed by a 1 bit. The first bit after the 1, is the start of a byte. 31 consecutive zeros is not possible to occur in a well constructed NALU.

This is why the 4 byte variation is generally only used before NALUs suitable for random access, such as AUD, SPS, PPS, and IDR.

This feature is not commonly used however, because networking protocols often handle the byte alignment, and broadcast protocols usually have a container, like TS, that have a similar method.

answered on Stack Overflow Jul 2, 2020 by szatmary

User contributions licensed under CC BY-SA 3.0