简体   繁体   English

字节流到NAL单位—视频解码

[英]Byte Stream to NAL units — Video Decoding

I am working on direct show filter of H.265 decoder. 我正在研究H.265解码器的直接显示过滤器。 I am using lide265 for this purpose. 我为此使用lide265。

The encoder returns byte stream. 编码器返回字节流。 I need to convert it into NAL unit as per decoder requirement. 我需要根据解码器要求将其转换为NAL单位。 How can I do that. 我怎样才能做到这一点。

Because simple byte stream is not decoded. 因为简单字节流没有被解码。

Seems that H.265 byte stream syntax is very similar to H.264. 似乎H.265字节流的语法与H.264非常相似。 If you take a look a the specification here : 如果您在这里查看规格:

H.265 byte stream NAL unit syntax! 字节流NAL单元语法!

leading_zero_8bits is a byte equal to 0x00. Leading_zero_8bits是一个等于0x00的字节。

NOTE – The leading_zero_8bits syntax element can only be present in the first byte stream NAL unit of the bitstream, because (as shown in the syntax diagram of clause B.2.1) any bytes equal to 0x00 that follow a NAL unit syntax structure and precede the four-byte sequence 0x00000001 (which is to be interpreted as a zero_byte followed by a start_code_prefix_one_3bytes) will be considered to be trailing_zero_8bits syntax elements that are part of the preceding byte stream NAL unit. 注–前导_zero_8bits语法元素只能出现在比特流的第一个字节流NAL单元中,因为(如B.2.1的语法图所示)等于NAL单元语法结构且在NAL之前的等于0x00的任何字节。四字节序列0x00000001(将被解释为zero_byte,然后是start_code_prefix_one_3bytes)将被视为Trailing_zero_8bits语法元素,它们是先前字节流NAL单元的一部分。

zero_byte is a single byte equal to 0x00. zero_byte是等于0x00的单个字节。

When one or more of the following conditions are true, the zero_byte syntax element shall be present: 当满足以下一个或多个条件时,zero_byte语法元素应存在:

– The nal_unit_type within the nal_unit( ) syntax structure is equal to VPS_NUT, SPS_NUT or PPS_NUT. – nal_unit()语法结构内的nal_unit_type等于VPS_NUT,SPS_NUT或PPS_NUT。

– The byte stream NAL unit syntax structure contains the first NAL unit of an access unit in decoding order, as specified in clause 7.4.2.4.4.` –字节流NAL单元的语法结构按第7.4.2.4.4节的规定,以解码顺序包含访问单元的第一个NAL单元。

This should give you a notion when to expect 0x00000001 and when to expect 0x000001 and you should be able to parse the bitstream looking for the start codes and extracting the NAL units in between them. 这应该给您一个概念,什么时候期望0x00000001,什么时候期望0x000001,并且您应该能够解析比特流以寻找起始码并提取它们之间的NAL单元。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM