Cáscara de Korn

The Transformed into cosine discrete or TCD (of the English: DCT or Discrete Cosine Transform ) is a transformation close to the discrete Transformée of Fourier (DFT). The core of projection is a cosine and thus generates real coefficients, contrary to the DFT, whose core is exponential complex and who thus generates complex coefficients. One can however express the DCT according to the DFT, which is then applied to the symmetrized signal.

The most current alternative of the transform as a discrete cosine is the standard DCT, often simply called " DCT". Its reverse, which corresponds to the type is often simply called " IDCT".

Applications

  • the DCT, and in particular the DCT- is very much used in treatment of the signal and the image, and especially in compression. The DCT indeed has an excellent property of " regroupement" energy: information is primarily carried by the coefficients low frequencies. For the natural images, the DCT is the transformation which approaches the most Transformée of Karhunen-Loève which provides an optimal decorrelation of the coefficients for a Markovian signal . In practice, the processes of compression thus make the assumption that a natural image can be modelled like the realization of a Markovian process and approximate the Transformée of Karhunen-Loève, too complex in calculation and dependant on the data, by a DCT. The interest of a transformation sees a figure particularly of course (see opposite). Only a small number of coefficients are not-null, and can be used to rebuild the image by opposite transform (IDCT) during decompression. The profit in term of compression comes from the suppression of the coefficients null or close to zero. This kind of mechanism is used in the standards JPEG and MPEG, which uses a DCT 2D on blocks of pixels of size 8x8 (for reasons of complexity).

  • the formats of compression of sound with loss AAC, Vorbis and MP3 use a modified version of this technique, the Transformée into a discrete cosine modified, TCDM (English MDCT).

  • the DCT is also employed for the resolution of systems of differential equations by spectral methods.

Definition

The DCT is a linear function invertible R NR R NR or in an equivalent way a square matrix NR × NR invertible. There exist several light alternatives of the DCT. Here the four most known types.

The development of the calculation algorithms fast of transforms DCT are based on the possibility of breaking up the matrix of definition in the form of a product of matrices whose calculation is simpler, and makes it possible to reduce the number of scalar multiplications, while benefitting from the remarkable identities of periodicity and Symétrie S of the sinusoidal functions. Thus, one can break up very transformed DCT of R NR in simpler transforms by breaking up NR into factors first produces, and while composing of the under-transforms in R N where N is one of these factors. In particular, of many optimizations were developed when NR is a power of 2.

That amounts rewriting the matrix NR × NR in the form of product of submatrices identical (laid out in regular Pavage and thus using real coefficients common or only differentiated by their sign) and of matrices to unit or null coefficients (- 1, 0 or 1), these last not requiring multiplication.

DCT-

X_k = \ frac {1} {2} \ left (x_0 + (- 1) ^k x_ {N-1} \ right) + \ sum_ {n=1} ^ {N2} {x_n \ cos \ left \ frac {\ pi} {N-1} N K \ right}

One can make this transform orthogonal (with a multiplicative constant near) by multiplying X 0 and X NR -1 by √2 and reciprocally X 0 and X NR -1 by 1/√2. This standardization breaks however the correspondence with a DFT.

One can note that the DCT- is not defined for N \ the 2, contrary to the other types which are defined for all NR positive.

DCT-

X_k = \ sum_ {n=0} ^ {N-1} {x_n \ cos \ left \ frac {\ pi} {NR} \ left (N + \ frac {1} {2} \ right) K \ right}

This alternative DCT most current and is used. It is generally simply called " DCT". Same manner that for the DCT-, one can make this transformation orthogonal by multiplying X 0 by 1/√2. This standardized form is very much used in practice but breakage the correspondence with DFT.

Example for NR 8

An optimized development of this transform for the case N=8 (used in JPEG and MPEG) is obtained by rewriting the transform in matric form and by factorizing the decomposition, to reduce the number of scalar multiplications necessary. For example the following decomposition is used for factorization by the algorithm of Chen, here orthogonalized (see remark above):

; Constant coefficients of calculation

\begin{pmatrix} C_1 \\ C_2 \\ C_3 \\ C_4 \\ C_5 \\ C_6 \\ C_7 \end{pmatrix}

\ sqrt {\ frac {2} {NR}}. \begin{pmatrix}

\ cos {\ frac {\ pi} {16}} \ \ \ cos {\ frac {2 \ pi} {16}} \ \ \ cos {\ frac {3 \ pi} {16}} \ \ \ cos {\ frac {4 \ pi} {16}} \ \ \ cos {\ frac {5 \ pi} {16}} \ \ \ cos {\ frac {6 \ pi} {16}} \ \ \ cos {\ frac {7 \ pi} {16}} \ \ \end{pmatrix} \approx \begin{pmatrix} 0,49039 \\ 0,46194 \\ 0,41573 \\ 0,35355 \\ 0,27779 \\ 0,19134 \\ 0,09755 \end{pmatrix} ; DCT (8) (fast method of calculating)
\ begin {pmatrix} X_0 \ \ X_2 \ \ X_4 \ \ X_6 \ end {pmatrix} = \begin{bmatrix} C_4 & C_4 & C_4 & C_4 \ \ C_2 & C_6 & - C_6 & - C_2 \ \ C_4 & - C_4 & - C_4 & C_4 \ \ C_6 & - C_2 & C_2 & - C_6 \end{bmatrix} . \ begin {pmatrix} x_0 + x_7 \ \ x_1 + x_6 \ \ x_2 + x_5 \ \ x_3 + x_4 \ end {pmatrix}
\ begin {pmatrix} X_1 \ \ X_3 \ \ X_5 \ \ X_7 \ end {pmatrix} = \begin{bmatrix} C_1 & C_3 & C_5 & C_7 \ \ C_3 & - C_7 & - C_1 & - C_5 \ \ C_5 & - C_1 & C_7 & C_3 \ \ C_7 & - C_5 & C_3 & - C_1 \end{bmatrix} . \ begin {pmatrix} x_0 - x_7 \ \ x_1 - x_6 \ \ x_2 - x_5 \ \ x_3 - x_4 \ end {pmatrix}

The formula optimized for a unidimensional DCT is often used such as it is for its use in two-dimensional space (by transposition and composition); this formula makes it possible to reduce in a spectacular way calculation of 1024 multiplications (basic formula) to 256 multiplications only in the treatment of a block image 8x8 (two master keys of 32 multiplications for each line of 8 values); however, of optimizations are still possible by optimizing the composition it even of the two master keys (horizontal and vertical) to only reduce still by 256 to 91 multiplications (even less according to more recent research).

It will be also noted that the first stamps above allows also a rewriting of many common multiplications (and thus makes the formula of it above requires much less than the 32 multiplications, makes 16 of them if one gathers the common under-expressions). One could still break up the first matrix easily because it is itself a transform DCT in R 4 , decomposable in two submatrices of R 2 .

Many studies showed how this transform can be optimized according to the constraints, in particular when the transform is used for the compression, because the transform makes it possible to concentrate the essence of energy in the coefficients obtained X of index weak, the others concentrating little energy have a weak contribution on the initial space signal and are reduced to zero at the time of the stages of quantification. Thus, the precision necessary to represent the last coefficients is weaker even null, and the constant coefficients C used for the calculation of the scalar multiplications can be the subject specific of optimization, by fixing their precision, and by using techniques of multiplication by a reduced number of addition-shifts without needing to use a generic multiplication.

Nevertheless, this calculation algorithm (presented such as it is, it calculates the unidimensional DCT at 8 points with 16 multiplications) is at the base of all following optimizations by factorization of the submatrices. The algorithm of Loeffler is currently most effective having been published (with 11 multiplications for the same DCT at 8 points instead of 16 with the algorithm of Chen, however certain coefficients undergo two multiplications and that could make the algorithm less stable). It was even shown that the theoretical number minimum of multiplications necessary for transformation DCT to 8 points cannot be lower than 11, with the result that the algorithms with 11 scalar multiplications are optimum in term of rough performance (they are different only in term from stability according to the order in which the multiplications are carried out, and precision consequently necessary for the intermediate products).

However the algorithm of Loeffler gathers 8 of the 11 scalar multiplications on the exits, which makes it possible to gather these multiplications with the following stage of quantification (what in fact all interest): for a transform 2D 8×8, one needs 8×11 multiplications for the transform of the lines, and only 8×3 multiplications for the columns, is a total of 112 multiplications (instead of 256 with the algorithm of Chen) if the 64 last scalar multiplications are carried out with the quantification. More details are available in the standards of compression JPEG and MPEG.

DCT-

X_k = \ frac {1} {2} x_0 + \ sum_ {n=1} ^ {N-1} {x_n \ cos \ left \ frac {\ pi} {NR} N \ left (K + \ frac {1} {2} \ right) \ right}

The DCT- is the opposite transform of the DCT-II. It is more known under the name of " DCT Inverse" and its acronym (English) " IDCT".

Same manner that for the DCT-I, one can make this transformation orthogonal by multiplying X 0 by √2. This standardized form is very much used in practice but breakage the correspondence with DFT.

Example for NR 8

By taking again the example above, one obtains a decomposition reverses (here orthogonalized) also used in the algorithm of Chen:

; IDCT (8) (fast method of calculating)

\begin{pmatrix} x_0 \\ x_1 \\ x_2 \\ x_3 \end{pmatrix}

\begin{bmatrix} C_4 & C_2 & C_4 & C_6 \ \ C_4 & C_6 & - C_4 & - C_2 \ \ C_4 & - C_6 & - C_4 & C_2 \ \ C_4 & - C_2 & C_4 & - C_6 \end{bmatrix} . \begin{pmatrix} X_0 \\ X_2 \\ X_4 \\ X_6 \end{pmatrix} + \begin{bmatrix} C_1 & C_3 & C_5 & C_7 \ \ C_3 & - C_7 & - C_1 & - C_5 \ \ C_5 & - C_1 & C_7 & C_3 \ \ C_7 & - C_5 & C_3 & - C_1 \end{bmatrix} . \begin{pmatrix} X_1 \\ X_3 \\ X_5 \\ X_7 \end{pmatrix}
\begin{pmatrix} x_4 \\ x_5 \\ x_6 \\ x_7 \end{pmatrix}

\begin{bmatrix} C_4 & C_2 & C_4 & C_6 \ \ C_4 & C_6 & - C_4 & - C_2 \ \ C_4 & - C_6 & - C_4 & C_2 \ \ C_4 & - C_2 & C_4 & - C_6 \end{bmatrix} . \begin{pmatrix} X_0 \\ X_2 \\ X_4 \\ X_6 \end{pmatrix} - \begin{bmatrix} C_1 & C_3 & C_5 & C_7 \ \ C_3 & - C_7 & - C_1 & - C_5 \ \ C_5 & - C_1 & C_7 & C_3 \ \ C_7 & - C_5 & C_3 & - C_1 \end{bmatrix} . \begin{pmatrix} X_1 \\ X_3 \\ X_5 \\ X_7 \end{pmatrix}

There too the scalar evaluation of this matric product contains many common under-expressions allowing of the reductions of the number of scalar multiplications necessary.

DCT-V

X_k = \ sum_ {n=0} ^ {N-1} {x_n \ cos \ left \ frac {\ pi} {NR} \ left (n+ \ frac {1} {2} \ right) \ left (K + \ frac {1} {2} \ right) \ right}

The DCT-V is an orthogonal matrix .

References

Random links:Joseph Floc' H | Commune of Arjeplog | Marcus Tullius Cicero (wire) | Station Tauzia (Tram of Bordeaux) | Belgian boxing ring R16 | Coquille_de_Korn