HOME

TheInfoList



OR:

The macroblock is a processing unit in
image An image or picture is a visual representation. An image can be Two-dimensional space, two-dimensional, such as a drawing, painting, or photograph, or Three-dimensional space, three-dimensional, such as a carving or sculpture. Images may be di ...
and
video compression In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compression ...
formats based on linear block transforms, typically the
discrete cosine transform A discrete cosine transform (DCT) expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequency, frequencies. The DCT, first proposed by Nasir Ahmed (engineer), Nasir Ahmed in 1972, is a widely ...
(DCT). A macroblock typically consists of 16×16 samples, and is further subdivided into transform blocks, and may be further subdivided into prediction blocks. Formats which are based on macroblocks include
JPEG JPEG ( , short for Joint Photographic Experts Group and sometimes retroactively referred to as JPEG 1) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degr ...
, where they are called MCU blocks, H.261,
MPEG-1 Part 2 MPEG-1 is a standard for lossy compression of video and audio. It is designed to compress VHS-quality raw digital video and CD audio down to about 1.5 Mbit/s (26:1 and 6:1 compression ratios respectively) without excessive quality loss, m ...
, H.262/MPEG-2 Part 2, H.263,
MPEG-4 Part 2 MPEG-4 Part 2, MPEG-4 Visual (formally International Organization for Standardization, ISO/International Electrotechnical Commission, IEC 14496-2) is a video encoding specification designed by the Moving Picture Experts Group (MPEG). It belongs to ...
, and H.264/MPEG-4 AVC. In H.265/HEVC, the macroblock as a basic processing unit has been replaced by the
coding tree unit Coding tree unit (CTU) is the basic processing unit of the High Efficiency Video Coding (HEVC) video standard and conceptually corresponds in structure to macroblock units that were used in several previous video standards. CTU is also referred to a ...
.


Technical details


Transform blocks

A macroblock is divided into transform blocks, which serve as input to the linear block transform, e.g. the DCT. In H.261, the first video codec to use macroblocks, transform blocks have a fixed size of 8×8 samples. In the
YCbCr YCbCr, Y′CbCr, also written as YCBCR or Y′CBCR, is a family of color spaces used as a part of the color image pipeline in digital video and digital photography, photography systems. Like YPbPr, YPBPR, it is based on RGB primaries; the two ...
color space with 4:2:0 chroma subsampling, a 16×16 macroblock consists of 16×16 luma (Y) samples and 8×8 chroma (Cb and Cr) samples. These samples are split into four Y blocks, one Cb block and one Cr block. This design is also used in
JPEG JPEG ( , short for Joint Photographic Experts Group and sometimes retroactively referred to as JPEG 1) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degr ...
and most other macroblock-based video codecs with a fixed transform block size, such as MPEG-1 Part 2 and H.262/MPEG-2 Part 2. In other
chroma subsampling Chroma subsampling is the practice of encoding images by implementing less resolution for Chrominance, chroma information than for luma (video), luma information, taking advantage of the human visual system's lower acuity for color differences t ...
formats, e.g. 4:0:0, 4:2:2, or 4:4:4, the number of chroma samples in a macroblock will be smaller or larger, and the grouping of chroma samples into blocks will differ accordingly. In more modern macroblock-based video coding standards such as H.263 and H.264/AVC, transform blocks can be of sizes other than 8×8 samples. For instance, in H.264/AVC main profile, the transform block size is 4×4. In H.264/AVC High profile, the transform block size can be either 4×4 or 8×8, adapted on a per-macroblock basis.


Prediction blocks

Distinct from the division into transform blocks, a macroblock can be split into prediction blocks. In early standards such as H.261, MPEG-1 Part 2, and H.262/MPEG-2 Part 2, motion compensation is performed with one motion vector per macroblock. In more modern standards such as H.264/AVC, a macroblock can be split into multiple variable-sized prediction blocks, called partitions. In an inter-predicted macroblock in H.264/AVC, a separate motion vector is specified for each partition. Correspondingly, in an intra-predicted macroblock, where samples are predicted by extrapolating from the edges of neighboring blocks, the predicted direction is specified on a per-partition basis. In H.264/AVC, prediction partition size ranges from 4×4 to 16×16 samples for both inter-prediction (motion compensation) and intra-prediction.


Bitstream representation

A possible bitstream representation of a macroblock in a video codec which uses
motion compensation Motion compensation in computing is an algorithmic technique used to predict a frame in a video given the previous and/or future frames by accounting for motion of the camera and/or objects in the video. It is employed in the encoding of video ...
and
transform coding Transform coding is a type of data compression for "natural" data like audio signals or photographic images. The transformation is typically lossless (perfectly reversible) on its own but is used to enable better (more targeted) quantization, whi ...
is given below. It is similar to the format used in H.261.
+------+------+-------+--------+-----+----+----+--------+
,  ADDR ,  TYPE ,  QUANT ,  VECTOR ,  CBP ,  b0 ,  b1 ,  ... b5 , 
+------+------+-------+--------+-----+----+----+--------+
* ADDR — address of block in image * TYPE — identifies type of macroblock (
intra frame Intra-frame coding is a data compression technique used within a video frame, enabling smaller file sizes and lower bitrates, with little or no loss in quality. Since neighboring pixels within an image are often very similar, rather than storing ...
,
inter frame An inter frame is a frame in a video compression stream which is expressed in terms of one or more neighboring frames. The "inter" part of the term refers to the use of ''Inter frame prediction''. This kind of prediction tries to take advantage fr ...
, bi-directional inter frame) * QUANT — quantization value to vary quantization * VECTOR — motion vector * CBP — Coded Block Pattern, this is bit mask indicating for which blocks coefficients are present. * bN — the blocks (4 Y, 1 Cr, 1 Cb)


Macroblocking

The term ''macroblocking'' is commonly used to refer to block coding artifacts.


See also

*
JPEG JPEG ( , short for Joint Photographic Experts Group and sometimes retroactively referred to as JPEG 1) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degr ...
, H.261,
MPEG-1 Part 2 MPEG-1 is a standard for lossy compression of video and audio. It is designed to compress VHS-quality raw digital video and CD audio down to about 1.5 Mbit/s (26:1 and 6:1 compression ratios respectively) without excessive quality loss, m ...
, H.262/MPEG-2 Part 2, H.263 and H.264 *
Coding tree unit Coding tree unit (CTU) is the basic processing unit of the High Efficiency Video Coding (HEVC) video standard and conceptually corresponds in structure to macroblock units that were used in several previous video standards. CTU is also referred to a ...
*
Discrete cosine transform A discrete cosine transform (DCT) expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequency, frequencies. The DCT, first proposed by Nasir Ahmed (engineer), Nasir Ahmed in 1972, is a widely ...
*
Video compression picture types In the field of video compression, a video frame is compressed using different algorithms with different advantages and disadvantages, centered mainly around amount of data compression. These different algorithms for video frames are called pic ...
*
Compression artifact A compression artifact (or artefact) is a noticeable distortion of media (including Image, images, Sound recording, audio, and video) caused by the application of lossy compression. Lossy data compression involves discarding some of the medi ...
*
Deblocking filter A deblocking filter is a video filter applied to decoded compressed video to improve visual quality and prediction performance by smoothing the sharp edges which can form between macroblocks when block coding techniques are used. The filter ai ...
*
Pixelation In computer graphics, pixelation (also spelled pixellation in British English) is caused by displaying a bitmap or a section of a bitmap at such a large size that individual pixels, small single-colored square display elements that comprise th ...


References

{{Compression methods Video compression Image compression Data compression