当前位置:网站首页>Analysis of h264nalu head
Analysis of h264nalu head
2020-11-09 16:06:00 【Zhu Zilong 2018】
One NALU Head analysis

F: forbidden_zero_bit. stay H.264 It is stipulated in the specification that this person must be 0. NRI: nal_ref_idc. take 00~11, It seems to indicate this NALU Importance , Such as 00 Of NALU The decoder can discard it without affecting the playback of the image ,0~3, The larger the value , At present NAL The more important , Need to be protected first . If at present NAL It's a piece of reference frame , Or a sequence parameter set , Or the important units of the image parameter set , This syntactic element must be greater than 0. Type: identification NAL In the cell RBSP data type , among ,nal_unit_type by 1, 2, 3, 4, 5 Of NAL The unit is called VCL Of NAL unit , Other types NAL Unit is not VCL Of NAL unit .
Two NALU Type analysis nalu type Calculation method of
At the beginning of each frame (00 00 00 01) And then I got nalu Head code A byte
Use this formula to calculate nalutype :int type = code & 0x1fnalu type
nal_unit_type. This NALU The type of unit ,1~12 from H.264 Use ,24~31 from H.264 For applications other than , The brief is as follows :0 No definition
1-23 NAL unit Single NAL Unit package
1 No zoning , Not IDR The film of the image
2 Slice partition A
3 Slice partition B
4 Slice partition C
5 IDR The film in the image
6 Supplementary enhanced information unit (SEI)
7 SPS
8 PPS
9 End of sequence
10 End of sequence
11 End of stream
12 fill
13-23 Retain 24 STAP-A A single time combination package
25 STAP-B A single time combination package
26 MTAP16 Multiple time packages
27 MTAP24 Multiple time packages
28 FU-A Sliced units
29 FU-B Sliced units
30-31 No definition
Common data frames
Sequence parameter set SPS----7:
SPS namely Sequence Paramater Set SPS A set of encoded video sequences is stored in (Coded video sequence) Global parameters of . The so-called encoded video sequence is the sequence composed of the pixel data of the original video frame by frame after being encoded . The parameters of the encoded data of each frame are saved in the image parameter set . General situation SPS and PPS Of NAL Unit Usually at the beginning of the whole stream . But in some special cases , These two structures may also appear in the middle of the code stream , The main reason may be : 1: The decoder needs to start decoding in the middle of the stream ; 2: The encoder changes the parameters of the code stream in the process of encoding ( Such as image resolution );
Image parameter set PPS----8:
Except for the sequence parameter set SPS outside ,H.264 Another important parameter set in is image parameter set Picture Paramater Set(PPS). Usually ,PPS Be similar to SPS, stay H.264 A single bitstream is stored in a single stream NAL Unit in , It's just PPS NAL Unit Of nal_unit_type The value is 8; In the package format ,PPS Usually with SPS Together , Save in the header of the video file .
Keyframes IDR frame ----5:
I Frames represent keyframes , You can understand it as a complete preservation of this frame ; Decoding only needs the frame data to complete ( Because it contains the whole picture )
P frame ----1:
P The frame represents this frame and the previous keyframe ( or P frame ) The difference between , In decoding, the difference defined in this frame needs to be superimposed on the previous cached picture , Generate the final picture .( That's the difference frame ,P Frame has no full picture data , Only data different from the previous frame )
3、 ... and Reference code
h264nalu Head analysis can refer to ffmpeg Source code h264_parser.c Of parse_nal_units function
版权声明
本文为[Zhu Zilong 2018]所创,转载请带上原文链接,感谢
边栏推荐
- To me, multithreading transaction must be a pseudo proposition!
- MIT6.824分布式系统课程 翻译&学习笔记(三)GFS
- Flink的安装和测试
- Full stack technology experience tells you: how much does it cost to develop a mall small program?
- Kubernetes V1.19.3 kubeadm 部署笔记(中)
- SEO builders, what are the unspeakable hardships?
- 用微信表情翻译表白,程序员的小浪漫,赶紧Get起来!
- 标梵IPFS矿机app软件开发软件 IPFSApp开发方法详解
- 融云完成数亿人民币 D 轮融资,将持续打造全球云通信能力
- 5分钟GET我使用Github 5 年总结的这些骚操作!
猜你喜欢

In depth analysis of the multi-user shopping mall system from search to create a profit point

Two ways for Tencent cloud server to build WordPress website

Chrome浏览器 js 关闭窗口失效解决方法

5 minutes get I use GitHub's 5-year summary of these operations!

使用基于GAN的过采样技术提高非平衡COVID-19死亡率预测的模型准确性

Full link stress testing of moral integrity -- the evolution of corpus intelligence

MES系统在行业应用里区别于传统式管理

超简单集成华为系统完整性检测,搞定设备安全防护

5分钟GET我使用Github 5 年总结的这些骚操作!
![What is website [new four modernizations]?](/img/3b/00bc81122d330c9d59909994e61027.jpg)
What is website [new four modernizations]?
随机推荐
AUTOCAD2020安装包&安装教程
低功耗蓝牙单芯片为物联网助力
详解三种不同的身份验证协议
Embedded assembly in IOS
Native地图与Web融合技术的应用与实践
JS design pattern
MES系统在工厂生产管理起到9大很重要的作用
Decision tree algorithm theory
标梵IPFS矿机app软件开发软件 IPFSApp开发方法详解
干货推荐:关于网络安全技术的专业术语,你知道多少?
脑机接口先驱炮轰马斯克:“他走的是一条死胡同,说的话我一个字都不同意”
【亲测有效】Github无法访问或者访问速度的解决方案
在Python中创建文字云或标签云
高德全链路压测——语料智能化演进之路
Set two ways of background image, and solve the mobile phone background image highly adaptive problem
Kubernetes V1.19.3 kubeadm 部署笔记(中)
CAD2020下载AutoCAD2020下载安装教程AutoCAD2020中文下载安装方法
shell脚本快速入门----shell基本语法总结
Using art template to obtain weather forecast information
揭秘在召唤师峡谷中移动路径选择逻辑?