|
Algorithms in Video Codec
A video codec is a cocktail of algorithms,
combined in the proper fashion to achieve the compression. The significant algorithms/tools used in the
encoder are discussed here.
1)
Intra Frame
Intra-prediction utilizes spatial correlation
in each frame to reduce the amount of transmission data
necessary to represent the picture. Intra frame is essentially
the first frame to encode but with less amount of compression.

2) Motion
Estimation
The fundamental concept in video compression
is to store only incremental changes between frames. The
difference between to frames are extracted by Motion
Estimation tool. Here one whole frame is reduced into many sets
of motion vectors.
3) Motion
Compensation
Motion Compensation will decode the image that
is encoded by Motion Estimation. This reconstruction of image is
done from received motion vectors and the reference frame.
4) Transformation
The transformation is used to
compress the image in Inter-frames or Intra-frames. The mostly
used transformation is Discrete Cosine Transform (DCT) and
Wavelet Transform. The codec calculates a DCT on each 4 x 4
block of pixel in frame.
5) Quantization
The quantization stage reduces
the amount of information by dividing each coefficient by a
particular number to reduce the quantity of possible values that
value could have. Because this makes the values fall into a
narrower range, this allows entropy coding to express the values
more compactly.
6) De-blocking filter
Loop filtering is mandatory in the encoder, it
identify a blocking situation depending by two threshold factors
(alpha and beta). A lot of efficiency is due to the loop filter.
The strength of filter depends on intra/inter coding,
differential vectors, quantization level. Up to 40% of total
processing power may be required by this kind of filter.
Filtering the reference frames prior to use them in prediction
can significantly improve the objective and perceptual quality
expecially at low or medium bitrates.
|
|
7)
Entropy Coder
This algorithm is a lossless
encoding tool, i.e. the encoded stream can be decoded without any
loss.
H.264 deployed an enhanced VLC of two types.
1) context-adaptive variable-length coding (CAVLC)
2) Context-adaptive binary-arithmetic coding (CABAC)
With the knowledge of the probabilities of
syntax elements in a given context, syntax elements in the video
stream can be losslessly compressed .
8) Network
Abstraction
Layer
All the compressed data is
packetized in Network friendly format by NAL unit. A NAL unit
specifies a generic format for use in both packet-oriented and
bitstream systems. The format of NAL units for both
packet-oriented transport and bitstream delivery is - except
that each NAL unit can be preceded by a start code prefix in a
bitstream-oriented transport layer.
9) Rate Distortion
Optimization
The compressed bitstream will
vary the size depending upon the contends of the frames. For
example, a slow moving movie will generated very less compressed
data, where as a fast moving movie will generate significantly
large compressed data, for the same resolution & fps. This
characteristics may not be welcoming in most of the situations.
The rate control mechanism will keep the output bitrate within
the requirement.
These techniques, along with several others,
help H.264 to perform significantly better than any prior
standard, under a wide variety of circumstances in a wide
variety of application environments. H.264 can often perform
radically better than MPEG-2 video—typically obtaining the same
quality at half of the bit rate or less.
|