Standard equation for generating DCT coefficients in JPEG compression process is DCT formula given by:
I have red that this implementation is expensive (slow), and there is much faster way. Is there explicit formula for this faster way of generating DCT coefficients?
The discrete cosine transform (DCT) is the most popularly used signal processing tool for compressing images and sounds, found in standards such as JPEG and MP3. (Less often used methods include wavelet transforms, polyphase filters, Hadamard transforms, etc.)
Advantages and Disadvantages of the DCT The transformation is orthogonal (inverse is transpose and energy is preserved), fast algorithms can be used for computation, and the output for (near) constant matrices generally consists of a large number of (near) zero values.
DCT Definition The discrete cosine transform (DCT) represents an image as a sum of sinusoids of varying magnitudes and frequencies. The dct2 function computes the two-dimensional discrete cosine transform (DCT) of an image.
> DCT is preferred over DFT in image compression algorithms like JPEG > because DCT is a real transform which results in a single real number per > data point. In contrast, a DFT results in a complex number (real and > imaginary parts) which requires double the memory for storage.
Yes, this general version is slow, very slow indeed. There are much faster approximation out there.
Fastest software DCT transformation can be found within the BinDCT family.
They only need some basic additions and shifts, and are therefore very fast, at the expense of some precision.
An excellent presentation of it : On the Process of Realizing the Best BinDCT Configuration for Image Compression (especially slide 12)
Modern video codecs such MPEG4-AVC use the Hadamard Transform instead of the DCT as spatial transform.
The Hadamard Transform is an exact low complexity transform and gives results similar to the DCT (it can be considered an approximate of the DCT) but requires no multiplication. As a result, implementations of the HT are very fast.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With