I am having a very hard time to implement the DCT algorithm. I have quite a few requirements like it has to work with NxN matrix or at least power of 2, it has to be 2D, it has to produce same output as FFTW fftwf_plan_r2r_2d(FFTW_REDFT10) it has to use real data and I need DCT I, II and III. And it has to be fast!
1) I could use FFT to compute DCT and wikipedia mentions this:
"One can also compute DCTs via FFTs combined with O(N) pre- and post-processing steps. In general, O(N log N) methods to compute DCTs are known as fast cosine transform (FCT) algorithms."
What are those 2 steps?
2) If I use Apples vDSP library is that even a good idea? since it needs an array twice as big as the DCT array (2N with radix2). And also vDSP is 1D only so I would end up doing it for each row and column to get a 2D result.
3) Is it possible to use an algorithm that works on 8x8 blocks and adapt it for my needs?
I am very new to learning about DSP so any help is appreciated! Thanks!
ps: Does anyone have any sample code for what I need? would help me a lot