Advanced Video Coding
H.264 / AVC
Video compression standards jointly developed by ITU-T and ISO/IEC, published as H.264 and MPEG-4 AVC, respectively, are widely used in broadcasting, optical discs, online video, mobile devices, and real-time communications.
Explanation
H.264, also known as AVC (Advanced Video Coding, 高级视频编码), is a video compression standard jointly developed by the ITU-T Video Coding Study Group and the ISO/IEC Moving Image Study Group. The two organizations established the Joint Video Team (JVT) in 2001, and the first version of the specification was approved in 2003 and published as ITU-T H.264 and ISO/IEC 14496-10, respectively. The MPEG family therefore also refers to it as MPEG-4 Part 10 or MPEG-4 AVC.
H.264 is not the same codec as the earlier MPEG-4 Visual.
MPEG-4 Visual is part of ISO/IEC 14496-2, and common implementations include the early DivX and Xvid; AVC is part of ISO/IEC 14496-10. Simply writing “MPEG-4 video” does not accurately distinguish between the two.
The standard specifies the syntax of compliant bitstreams and how decoders should reconstruct frames; it does not prescribe how encoders must detect motion, allocate bitrate, or select prediction modes. H.264 encoders typically first perform intra-frame prediction using adjacent regions of the same frame that have already been reconstructed, or inter-frame prediction by searching for similar content in other reference frames, and then apply transformation, quantization, and entropy coding to the residual between the original image and the predicted result. The decoder reconstructs the picture based on the prediction information and residual data in the bitstream; therefore, prediction accuracy, reference structure, and quantization choices collectively affect the amount of data required. The basic encoding unit is a macroblock, which typically covers 16×16 luminance samples and corresponding chrominance samples. Intra-frame encoding can select prediction in different directions for 16×16 or smaller regions; High Profile also introduces 8×8 intra-frame prediction. Inter-frame macroblocks can be divided into 16×16, 16×8, 8×16, and 8×8 regions, with the latter further subdivided into 4×4 regions, allowing different motion vectors to be used for motion boundaries and local changes, respectively. The standard supports multiple reference frames and subpixel motion compensation; however, whether an encoder performs a wide search, how many reference frames it uses, and how it determines the optimal partitioning are implementation strategies rather than bitstream specifications.
Prediction residuals are primarily processed using 4×4 integer transforms; High Profile supports 8×8 transforms. The computational form is specified to ensure that different decoders produce consistent results within limited integer precision. Quantization sacrifices some precision of the transform coefficients and is the primary source of lossy compression; the quantization strength can be adjusted at the image, slice, or macroblock level. The deblocking filter in the reconstruction loop subsequently processes block boundaries; its output is used both for display and as the reference frame for subsequent prediction, and is therefore not an arbitrary image enhancement feature added by the player. H.264 defines two main types of entropy coding: CAVLC and CABAC. CAVLC selects variable-length codes based on the coefficient characteristics of neighboring blocks and has a relatively simple structure; CABAC first converts syntactic elements into binary symbols and then performs adaptive arithmetic coding based on a context model, which typically further reduces the bit rate but involves more complex computations and state dependencies. The Baseline Profile does not use CABAC, whereas profiles such as Main and High may utilize it.
A bitstream may contain different frame types, such as I, P, and B frames. I frames are predicted solely based on information within the same frame, while P and B frames may reference other frames; B frames do not necessarily have to reference only the immediately preceding and following frames in time. IDR images are a type of instant-decode refresh point with explicit random access and reference cleanup semantics, whereas ordinary I images merely indicate that their internal slices use intra-frame coding and cannot be regarded as fully equivalent to “key frames” in all bitstream structures.
Profiles and levels describe two distinct dimensions. Profiles define the permissible encoding tools, bit depth, and chroma formats—such as Baseline, Main, and High, as well as High 10, High 10, High 4:2:2, and High 4:4:4 Predictive, which are designed for higher bit depths or professional chroma sampling; levels, on the other hand, restrict resources such as the maximum number of frames, frames per second, decoding frame buffer, and bit rate. A device’s claim of supporting H.264 does not imply that it can decode all combinations of profiles, levels, resolutions, and reference frames. H.264 specifies encoding methods for both progressive and interlaced video. Field-adaptive image coding allows the selection of frame or field structure on a per-frame basis, while macroblock-adaptive frame-field coding allows the selection of frame or field encoding between macroblock pairs within the same frame. The latter provides finer-grained adaptation to static regions and interlaced motion, but also increases encoding decision-making and decoding complexity. 1080i programming in broadcasting and early high-definition discs may use these tools, but progressive-scan network video typically does not require them.
The encoded data is organized into units at the network abstraction layer; parameter sets, slices, and supplementary enhancement information can be mapped to different transport environments as required by the application. H.264 itself is not a file format.
The bitstream can be encapsulated in MP4, QuickTime, Matroska, MPEG-2 Transport Stream, M2TS, or other containers, and combined with various audio and subtitle tracks. File extensions alone do not indicate the internal video codec, and the coding standard does not specify chapters, menus, or digital rights management. H.264 has been used in AVCHD, Blu-ray Disc, digital television, network streaming, video conferencing, surveillance recording, and mobile devices; however, each application further restricts the allowed profiles, levels, frame rates, and bit rates. AVC on Blu-ray must comply with the disc application specifications; simply writing any compliant H.264 file directly to the data directory does not qualify it as a Blu-ray Video. x264, OpenH264, and hardware encoders in chips are specific implementations for generating or processing H.264 video streams; they are not names of new formats.
H.264 does not specify a single optimal bitrate for any given resolution, nor does it guarantee that files using it will necessarily be superior to those using MPEG-2, VC-1, or subsequent codecs. Video content, source material, preprocessing, encoder implementation, bitrate control, keyframe structure, and processing time all affect the compression results; the “H.264” designation specifies the decoding syntax, not a rating of the final video quality.