简体   繁体   English

检查x264 Nal单位的有效性

[英]Check the Validity of x264 Nal Units

I am working with x264 encoder api where for every encoded picture i get a number of nal unit. 我正在使用x264编码器api ,对于每个编码的图片,我都会得到许多nal单位。 is there any way i can check whether nals are valid or not in my VS2010 Debugger. 有什么方法可以检查VS2010调试器中的nals是否有效。 Currently i can see the following information:: 目前,我可以看到以下信息:

i_ref_idc        -858993460
i_type           -858993460
b_long_startcode -858993460
i_first_mb       -858993460
i_last_mb        -858993460
i_payload        27
p_payload        0x06b94d68
i_padding        -858993460

im not sure whether these negative values are representing that nals are invalid or it is missing information. 我不确定这些负值是否表示nals无效或缺少信息。
Basically how can i check that the nals i got from x264_encoder_encode() is a valid nal unit? 基本上,我如何检查从x264_encoder_encode()获得的nals是有效的nal单位?
NOTE :: im using these nals to stream live using LIVE555. 注意 ::我使用这些信号通过LIVE555进行实时直播。

-858993460 are also known as 0xСССССССС and indicate that values were not initialized by the encoder. -858993460也称为0xСССССССС ,它指示值未由编码器初始化。

i_payload , p_payload are size of payload in bytes and pointer to the data. i_payloadp_payload是有效载荷的大小(以字节为单位)和指向数据的指针。 There is not basically a validity check for this data other than feeding data to a decoder and testing against availability of output and decoding errors. 除了将数据馈送到解码器并针对输出和解码错误的可用性进行测试之外,基本上没有针对此数据的有效性检查。

This is definitely invalid. 这绝对是无效的。 You can not know for sure if a nalu is 100% valid without parsing the entire thing. 您不能确定nalu是否在不解析整个内容的情况下100%有效。 But you can sanity check values. 但是您可以理智地检查值。

i_ref_idc is a 2 bit field. i_ref_idc是一个2位字段。 Anything outside the range of 0-3 is not sane. 0-3范围以外的任何内容都不是理智的。

i_type is 5 bits. i_type是5位。 But in reality an encoder will only produce 1-15 or 19-21 inclusive 但实际上,编码器只会产生1-15或19-21(含)值

b_long_startcode is boolean, so you cant sanity check it b_long_startcode是布尔值,因此您无法理智地检查它

i_first_mb and i_last_mb will be less then ceil(width/8.0) * ceil(height/8.0) i_first_mb和i_last_mb小于ceil(width/8.0) * ceil(height/8.0)

i_payload is the size, of the data p_payload point to, so pick a high value here. i_payload是数据p_payload指向的大小,因此请在此处选择较高的值。 10*with*height should suffice. 10*with*height高就足够了。

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

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