Analysis of H264 in WEBRTC

Source: Internet
Author: User

H264 code Stream parsing, online has a lot of open source files;


The general analysis is: Obtain Nalu,sps,pps,nalu type,slice type, obtain QP and so on;

The computation can be obtained by the bitwise operation of C + +, but the structure can be obtained directly.


Here is the WEBRTC in the H264 parsing Related:

In the WEBRTC, about the H264 related source files in: webrtc58\src\webrtc\common_video\h264;

All contain good functions:

H264_bitstream_parser.h;

H264_common.h;

Pps_parser.h;

Sps_parser.h;

Profile_level_id.h;


Compared to the whole, specific can be viewed by themselves, relatively simple;





Popularize some simple knowledge:

The difference between "H. Sodb rbsp ebsp"

from:http://blog.csdn.net/threewells_14/article/details/1508657


Sodb Data bit string--> the most primitive encoded data

RBSP raw byte sequence load--> the end bit (rbsp trailing bits a bit "1") is added to the back of the Sodb for byte alignment.

EBSP Extended byte sequence payload-----rbsp byte (0X03) is added to the base of this: when Nalu is added to the ANNEXB, it is necessary to add the start code NALU before each group of Startcodeprefix, If the Nalu corresponding slice is the beginning of a frame, it is represented by a 4-bit byte, ox00000001, otherwise the ox000001 is represented by a 3-bit byte. In order for the Nalu body to not include the start code conflict, at the time of encoding, each encounter two bytes consecutive 0, insert a byte of 0x03. 0X03 is removed when decoding. Also known as shelling operations.

The difference between online inquiry:

After adding the original byte sequence payload (RBSP) end bit (rbsp trailing bits, adding a bit of "1" and a few bits "0" to the byte alignment) after the data bit string (SODB) of the entire frame image is added, then check if there is a continuous three-byte "00000000" in rbsp 00000000 000000XX "; If there is such a continuous three-byte code, insert a byte of" 0x03 "before the third byte in order to avoid competing with the starting code to form a ebsp stream, which requires nearly twice times the full frame image stream size. In order to reduce the memory requirements, after each macro block encoding, check the Sodb of the macro block in the beginning of the competition problem, and keep sodb the last two bytes of the number of 0 bytes, so that with the next macro block of the sodb of the starting byte to form a continuous starting code competition detection; The last macro block of a frame image, First, add the end stop bit, and then detect the start code competition.








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.