do you need remove emulation prevention bytes of H.264 stream in AVCC or HVCC format?

287 views Asked by At

There are mainly two formats of H.264(H.265) stream, Annexb and AVCC(HVCC), in Annexb, we need to add emulation prevention bytes to escape start code, I want to know wheather emulation prevention bytes exist in AVCC(HVCC) formatted stream, I checked the ITU specification, but didn't find the answer.

4

There are 4 answers

0
nobody555 On BEST ANSWER

An AVCC(HVCC) formatted stream still uses the emulation prevention byte because it is part of the NAL unit syntax and not something specific to Annex B, such as start code prefix.

2
marom On

AVCC does not need them. AVCC prefixes the content with a (usually 4) bytes length prefix, and what follows is the content. Emulation prevention bytes are needed because special patterns are used to delimit NALs and when such patterns occour in the NAL emulation prevenion bytes are inserted to avoid wrong NAL delimiting

0
Roman Ryltsov On

Here is your cheat sheet:

enter image description here

Both formats have NALUs and 0x03 prevention bytes are a part of this data stream.

So - expanding nobody555's answer - yes you do need to unescape them.

0
BaraBashkaD On

There are many quantities in the standard that are encoded using the Exp-Golomb code which can lead, in a certain set of circumstances, to the appearance of the sequence 0x000001 anywhere in the payload if the video stream is processed as is without an additional container According to the standard, the payload size is the size between 2 occurrences of the sequence 0x000001 before adding the NAL header both H.264 and H.265 standards were required to prevent emulation start code sequence look https://www.itu.int/rec/T-REC-H.264-202108-I 7.3.1 NAL unit syntax

enter image description here

or enter link description here 7.3.1.1 General NAL unit syntax

enter image description here