SOME CONCEPTS IN DISCRETE COSINE TRANSFORMS ~ Jennie G. Abraham Fall 009, EE5355 Under Digital Image and Video Processing files by Dr. Min Wu Please see lecture10 - Unitary Transform lecture11 - Transform Coding and JPEG Also refer, Fundamentals of Digital Image Processing by A.K. Jain ORTHOGONALITY From last class we, revisit the Orthogonality Property. Unitary vs Orthogonality Unitary matrix: A is unitary if A-1 = A*T = AH Denote A*T as AH ~ Hermitian Orthogonal matrix ~ A-1 = AT Row vectors of real orthogonal matrix A form orthonormal basis vectors Real-valued unitary matrix is also an orthogonal matrix as is the case with DCT matrix Exercise: Are the matrix here unitary or orthogonal? If yes, what are the basis vectors? A1 = j A = 1 j 1 j j 1 3 A3 = 1 A4 = 1 1 1 1
ROTATION: Consider a vector in planar space, rotation of this vector (or coordinate points) is about the origin. The rotation of this vector can be clockwise or counterclockwise in a plane oriented in the standard way. In linear algebra, a rotation matrix is any matrix that acts as a rotation in Euclidean space. It is important to understand the frame of reference when discussing rotations. Consider the coordinate (x,y); here (x,y) is rotated by θ degrees and the coordinates after rotation are (x',y'). The magnitude of the vector (x, y) is the same as the magnitude of vector (x, y ). Clockwise Rotation y-axis Here (x,y) is rotated clockwise by θ. (x,y) Here, we can write this in matrix form as (x,y ) or x-axis Counterclockwise Rotation Here, the coordinates will be rotated (x,y) y-axis counterclockwise about the origin.: (x,y ) or x-axis
For completeness, we will mention about complex planes. Complex plane A complex number can be seen as a two-dimensional vector in the complex plane, with its tail at the origin and its head given by the complex number. Let be such a complex number. Its real component is the abscissa and its imaginary component its ordinate. Then z can be rotated counterclockwise by an angle θ by pre-multiplying it with eiθ (see Euler's formula, viz. Algebraically, a rotation matrix is an orthogonal matrix whose determinant is equal to 1: R = rotation matrix when, Rotation matrices are always square, and are usually assumed to have real entries. Rotation matrix applied to an input vector rotates it at an angle (theta) about the origin (of x and y axis). In image compression context, applying rotation does not modify the pixel values; they simple shuffle the pixels within a block, in a deterministic way (called isometries). There are many isometries. The following eight are commonly used: identity (no rotation or flip operation), orthogonal reflection about mid-vertical axis of block, orthogonal reflection about mid-horizontal axis of block, orthogonal reflection about first diagonal of block, orthogonal reflection about second diagonal of block, rotation around center of block, through +90,
rotation around center of block, through +180, rotation around center of block, through 90. In effect, these operations are able to generate, from a single block, a whole family of geometrically related transformed blocks, which provides a pool in which matching blocks will be sought during the encoding. More complex transformations can be used. But more bits will be required to identify each transformation. [Question(?)] Any orthogonal transform (say Q) can be decomposed into a series of rotations. This helps in reducing the number of multiplies (though it may increase the adds). (4 Multiplies, Adds).ie for (3 Multiplies and 3 Adds)
Consider the example in the following paper- Stage 1 0 Stage Stage 3 Stage 4 Data DCT Coeff. 0 A 1 4 6 V C 3 4 7 S3 5 C1 6 C1 3 S1 - S1 5 - S3 7 Notations: 6 V C6 C3 Mutiplies Adds 1 C3 0 8 8 8 4 8 = 14 = 6
The DCT Matrix F = A4A3AA1, where A4, A3, A, A1 are Sparse Matrix Factors (SMF). Here, A1 and A4 remains as is, but we can write A and A3 as follows A = diag [ and, [A. A. A ] ] portion of A3= [A3. A3. A3 ]
For that we re-draw- A A A C3 S3 S3 C3 As -(S3 C3) 3 -S C3 (4 Multiplies, Adds) (3 Multiplies and 3 Adds) From this diagram, we can write decomposition SMFs A, A, A Similarly for A3.. For each time this transformation is substituted, we are changing 4M, A 3M, 3A. Therefore Mutiplies Adds 0 8 6 10 3 9 - SQRT() = 11 = 9 the
The figure can be re-drawn as follows: Previous works achieved thus - [Question(?)]Conclusion: The block diagram can be expressed as the flowgraph which yields the DCT coefficients in the order 0,4,,6,7,3,5,1. Input is the data sequence in natural order 0,1,,3,4,5,6,7 Using the algorithm express the DCT matrix as [A4.A33. A3. A31. A3. A. A1.A1]. This DCT matrix has rows rearranged as 0,4,,6,7,3,5,1. Inverse DCT matrix (IDCT) is the transpose of DCT Matrix To get the sparse matrix of IDCT, all we need to do is take the transpose matrix of the sparse matrices of DCT as : [IDCT Matrix] = The flowgraph of an IDCT (as shown below) is the same as for forward DCT with the direction reversed, i.e. from left to right.
To show that DCT is Orthogonal -
EIGEN AND BASIS IMAGES Like the 1D-DCT, which has basis functions, the D-DCT has basis images. Mapping of a D data array into the D-DCT domain implies decomposing the D data array into the basis images of the DCT. This can be illustrated with D (4x4) DCT. The basis images are numbered as below -
Basic Process of Transform Coding UMCP ENEE408G Slides (created by M.Wu & R.Liu 00) How to Encode Quantized Coeff. in Each Block Basic tools Entropy coding (Huffman, etc.) and run-length coding Predictive coding ~ esp. for DC Ordering zig-zag scan for block-dct to better achieve run-length coding gain DC AC01 Horizontal frequency Vertical frequency AC70 M. Wu: ENEE631 Digital Image Processing (Spring'09) AC07 low-frequency coefficients, then high frequency coefficients AC77 Lec11 Transf. Coding & JPEG [7]