当前位置:网站首页>[codec] write H264 decoder (1) from scratch
[codec] write H264 decoder (1) from scratch
2022-06-28 13:35:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
1. background
Because of work , I have been in contact with codec for some time .AVC,HEVC, There are also some functions, large and small , I have been reading books and articles on the principle of codec . From introduction to a little understanding , It feels a little fragmented , Or incomplete , It doesn't seem to form a system . Some small functions , To know is to know , I don't know its meaning and function , Over time, you will gradually forget . Think about it , Maybe a lot of things , You still need to do it yourself , Will understand deeper and more thoroughly , Like Feynman's learning method , Can you say it , That means I understand , This one is the same , You can realize the function , That means you really understand the process and logic . So , During the Chinese new year this year , Suddenly came up with the idea of writing a decoder , And I couldn't hold it down as soon as I started , I've always wanted to move the keyboard and write . In fact, there are many open source and easy-to-use decoders on the market , image ffmpeg,x264 wait . Own this project , It should be a simple learning project , It is estimated that the effect and function of these famous projects will not be achieved in the end , But so what , The process and experience are also great , isn't it? ? At the beginning, I wanted to write an encoder , After thinking about it, I soon gave up , My current idea is just to familiarize myself with the agreement , Not focusing on coding algorithms , by comparison , The knowledge needed to write a decoder is exactly what I need . This has become the cause of this series of articles , Write your own code , Write a summary . Although from “ zero ” Start , But the basic knowledge of codec still needs some reserves , I will introduce and explain the knowledge points involved in decoding in each chapter , But it's too fragmented , It won't be explained one by one . If the knowledge point is too big , You may write a separate article to summarize .
2. plan
2.1 Writing plan
Follow the steps of a decoder , I'm going to divide it into these parts for the time being
- NALU: Format , Start code , EBSP RBSP SODB
- Columbus entropy coding of entropy coding
- SPS: Analyze the meaning of each member in the agreement
- PPS: Analyze the meaning of each member in the agreement
- SEI: Analyze the meaning of each member in the agreement
- SLICE Header: analysis Header
- SLICE data: analysis slice data
- MarcoBlock: How to restore a complete macroblock YUV data
- macroblock_layer
- mb_pred
- Intra predicted part The prediction mode of
- CAVLC
- residual Residual data acquisition
- Intra predicted part Forecast data for and Image data recovery
- deblocking
- …… undetermined
2.2 Project plan
- development environment C Language
- Include features : H264 It is divided 7 individual profile Of , Every profile Is a collection of different functions . See... For specific differences wiki Encyclopedias plan : The first stage is the most basic one baseline The decoder of ( nothing B frame , Only CAVLC, Only line by line is supported Progressive) The second stage is to do main or Extend The decoder of ( Yes B frame , Yes CABAC, Support Progressive and interlace)
The follow-up will not be supported . Decoding does not display , from h264 File solution YUV File can .
- Time arrangement : expect 6 Months to finish it baseline (8 month 30), The second stage will be arranged later .
3. Reference resources
3.1 Reference material
3.2 Reference Engineering
3.3 Reference blog
- Implement one from zero H.264 Stream resolver Supporting works
- Do it yourself H.264 decoder -ZigZagSin Supporting works
- H264 Video decoder C++ Project description Supporting works
4. Tool preparation
4.1 Bitstream analysis tool
- vega: I've used the most professional , Analyze the best software . However, it can only be used by units. Ha ha , Visual inspection should be expensive .
- H264 Visa : I am using 1.15 edition , Out-of-service vega Used when . The parameter analysis is comprehensive , It is very helpful to judge whether your parsing is correct in the early stage .
It is said that there is an upgraded version later H.264 CodecVisa, It doesn't work for the time being .
- elecard I tried it out , I don't think it's very easy to use , It is better to be beautiful and easy to use than vega, Wheel parameters are not as complete as H264 Visa. Not much use . Here is a record of ,elecard There are many kinds of software ,elecard stream analyzer, elecard stream eye,Elecard StreamEye Studio wait . Actually Elecard StreamEye Studio contains stream analyzer, Don't get confused by a bunch of names . among streamEye It has a comprehensive function .
4.2 YUV View tools
- 7yuv
4.3 player
- potplayer: see h264 stream
4.4 some YUV data source
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/150705.html Link to the original text :https://javaforall.cn
边栏推荐
- Yii2 writing the websocket service of swoole
- Recognize the startup function and find the user entry
- 2022年中国运维安全产品市场规模及发展趋势预测分析
- c语言中的类结构体-点号
- China Database Technology Conference (DTCC) specially invited experts from Kelan sundb database to share
- Latest summary! 30 provinces announce 2022 college entrance examination scores
- Embedded development: seven techniques for estimating battery life
- codeblocks mingw安装配置问题
- Jeecg 官方组件的使用笔记(更新中...)
- Visual design tutorial of word cloud
猜你喜欢

Design artificial intelligence products: technical possibility, user acceptability and commercial feasibility

PHP抓取网页获取特定信息

Pytorch Foundation

First knowledge of exception

Hubble数据库x某股份制商业银行:冠字号码管理系统升级,让每一张人民币都有 “身份证”

单元测试 CI/CD

Hematemesis recommends 17 "wheels" to improve development efficiency

Kubernetes 深入理解kubernetes(一)
![(original) [Maui] realize](/img/76/d79b9cf4ed44870bb20a189315def9.jpg)
(original) [Maui] realize "floating action button" step by step

StackOverflow 2022数据库年度调查
随机推荐
Jerry's wif interferes with Bluetooth [chapter]
yii2连接websocket服务实现服务端主动推送消息给客户端
完全背包 初学篇「建议收藏」
为什么新的5G标准将为技术栈带来更低的 TCO
How about stock online account opening and account opening process? Is it safe to open a mobile account?
Setup and upload of arduino-esp32 flash file plug-in program
Websocket automatically disconnects in 1 minute
PostgreSQL surpasses MySQL
codeblocks mingw安装配置问题
Zhongang mining focuses on the fluorine chemical industry and lays out the new energy industry chain
抢做意大利岛主?刘强东两月套现66亿 疑一次性5.6亿“紧急转账”急购欧洲海上皇宫
Action interprets value. The chairman of chenglian Youpin Han attended the Guangdong Yingde flood fighting donation public welfare event
China Radio and television 5g package is coming, lower than the three major operators, but not as low as expected
How fragrant! The most complete list of common shortcut keys for pychar!
Mobile web training -flex layout test question 1
众昂矿业着眼氟化工产业,布局新能源产业链
Google Earth engine (GEE) - Global organic soil area of FAO (1992-2018)
(原创)【MAUI】一步一步实现“悬浮操作按钮”(FAB,Floating Action Button)
腾讯云国际云服务器登录之后没有网络,如何排查?
How to solve the problem that the computer wireless network does not display the network list