DSPRelated.com
Forums

Simple DCT problem

Started by Davy October 8, 2005
Hi all,

I am new to DCT and now testing my FDCT and IDCT program.
I found some of my high frequency DCT part is higher than low frequency
DCT part.
And I don't know whether it is correct.

Where can I find example of 8*8 DCT input and output to test my
code,thanks!

BTW,
my code's DCT input:
55  60  58  55  60  58  55  60
58  55  60  58  55  60  58  55
60  58  55  60  58  55  60  58
55  60  58  55  60  58  55  60
58  55  60  58  55  60  58  55
60  58  55  60  58  55  60  58
55  60  58  55  60  58  55  60
58  55  60  58  55  60  58  55
my code's DCT output:
461  0  -1  0  -1  -1  1  0
0  0  0  0  0  -2  0  0
-1  0  -1  0  -2  -1  2  0
0  0  0  0  0  -2  -1  0
-1  0  -2  0  -3  -3  4  0
1  -2  1  -2  3  -11  -3  1
1  0  2  1  4  3  -5  0
0  0  0  0  0  1  0  0

Any suggestions will be appreciated! 
All the best,
Davy

Davy wrote:

> Hi all, > > I am new to DCT and now testing my FDCT and IDCT program. > I found some of my high frequency DCT part is higher than low frequency > DCT part. > And I don't know whether it is correct. > > Where can I find example of 8*8 DCT input and output to test my > code,thanks! > > BTW, > my code's DCT input: > 55 60 58 55 60 58 55 60 > 58 55 60 58 55 60 58 55 > 60 58 55 60 58 55 60 58 > 55 60 58 55 60 58 55 60 > 58 55 60 58 55 60 58 55 > 60 58 55 60 58 55 60 58 > 55 60 58 55 60 58 55 60 > 58 55 60 58 55 60 58 55 > my code's DCT output: > 461 0 -1 0 -1 -1 1 0 > 0 0 0 0 0 -2 0 0 > -1 0 -1 0 -2 -1 2 0 > 0 0 0 0 0 -2 -1 0 > -1 0 -2 0 -3 -3 4 0 > 1 -2 1 -2 3 -11 -3 1 > 1 0 2 1 4 3 -5 0 > 0 0 0 0 0 1 0 0 > > Any suggestions will be appreciated!
And what does the inverse of the DCT give from the above?
> All the best, > Davy
Test it initially with simple patterns that you can work out by hand. Walking ones will give you a fairly easy test pattern for DCT that should quickly show if your implementation is OK. 1 0 0 0 0 0 0 0 etc. Regards, Martin Brown
> > Where can I find example of 8*8 DCT input and output to test my > > code,thanks!
Simplest way is to use the inbuilt dct&idct functions of MATLAB to obtain a test vector. Good Luck. Parthasarathy
Hi all,

I use Matlab's dct(dct(x')') and test my code. All OK!

All the best,
Davy

to test use the source code proposed by 
http://skal.planet-d.net/coding/dct.html

note :
- there is lot's of different implementation of the DCT.
- some are very fast but less accurate
- if you deal with an mpeg video std implementation only idct is 
describe and should respect I3E-1394 precision. DCT is the encoding part 
and it's not normalized !!!
- you should find on the web an IEEE-1394 idct tester which test if your 
implentation respect the standard requirement.

good luck

Davy wrote:
> Hi all, > > I am new to DCT and now testing my FDCT and IDCT program. > I found some of my high frequency DCT part is higher than low frequency > DCT part. > And I don't know whether it is correct. > > Where can I find example of 8*8 DCT input and output to test my > code,thanks! > > BTW, > my code's DCT input: > 55 60 58 55 60 58 55 60 > 58 55 60 58 55 60 58 55 > 60 58 55 60 58 55 60 58 > 55 60 58 55 60 58 55 60 > 58 55 60 58 55 60 58 55 > 60 58 55 60 58 55 60 58 > 55 60 58 55 60 58 55 60 > 58 55 60 58 55 60 58 55 > my code's DCT output: > 461 0 -1 0 -1 -1 1 0 > 0 0 0 0 0 -2 0 0 > -1 0 -1 0 -2 -1 2 0 > 0 0 0 0 0 -2 -1 0 > -1 0 -2 0 -3 -3 4 0 > 1 -2 1 -2 3 -11 -3 1 > 1 0 2 1 4 3 -5 0 > 0 0 0 0 0 1 0 0 > > Any suggestions will be appreciated! > All the best, > Davy >
Hi Bernie,

Thank you :-)

I use Chen's algorithm (takes 16 Mul). It is 8 times faster than MPEG's
float algorithm on my P3 machine.

Best regards,
Davy