Image Processing Reference
In-Depth Information
I don't know if this frightens you but it does me. Whenever I see sigma signs and
functions of two variables like this I have to sit down and think very hard about what is
going on. The u and v values represent the coordinates of the output array of frequency
components. The x and y values are the input array of pixel values.
This formula is designed to operate on blocks of 8
16 luma chan-
nel block is divided into 4 rectangles that are coded individually. The chroma channels in
the macroblocks are sampled at a lower resolution and may require 1, 2, or 4 such 8
×
8 pixels, so a 16
×
×
8
blocks to code them.
The first part of the formula (prior to the sigma signs) scales the result but applies a
correction factor along the topmost row of pixels (when u = 0) and down the left row of
pixels (when v = 0).
The two sigma signs indicate that a pair of nested loops computes a formula to the
right of the sigma signs for each discrete value and then adds them together.
10.7.4
The Pseudo-Code Approach
In computational terms, the DCT algorithm could be implemented with a pseudo-code
structure like this:
For (u = 0 to 7)
{
For (v =0 to 7)
{
A = 0
For (x = 0 to 7)
{
a = 0
For (Y = 0 to 7)
{
{a = a + result of evaluating cosine formula
}
}
multiply a by scaling factor
assign a to appropriate cell (u, v) in output pixel array
}
}
Every pixel in the x,y array contributes a value to every pixel in the output array. The DCT
algorithm transforms pixels into frequencies using a fast Fourier transform (FFT) technique.
10.7.5
The Frequency Domain
The output array contains the average color of the macroblock at the top left corner. As you
move through the pixel array toward the bottom right, the frequency components are based
on ever-higher harmonics of the fundamental in both the horizontal and vertical axes. As the
frequencies increase they have smaller magnitude. Fine detail is recorded at the lower right.
Figure 10-12 shows the frequency coefficients just on one axis:
Search WWH ::




Custom Search