Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I want Dct c source code

Status
Not open for further replies.

rangababu

Newbie level 5
Joined
Dec 8, 2006
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,328
dct c code

hello everybody please help me providing dct code in c language in 1-d& 2-d are required for me

thank u
 

dct code

for(i=0;i<8;i++)
for(j=0;j<8;j++)
{
if(i==0)
s=sqrt(1.0/8.0);
else
s=sqrt(2.0/8.0);

if(j==0)
d=sqrt(1.0/8.0);
else
d=sqrt(2.0/8.0);

for(k=0;k<8;k++)
for(l=0;l<8;l++)
{

b[j]+=a[k][l]*cos(((2*k+1)*i*pi)/(2*8))*cos(((2*l+1)*j*pi)/(2*8));
}
b[j]*=s*d;

}

Added after 1 minutes:

This is just for an 8x8 block,
and those smileys are 2x8

Added after 26 seconds:

sorry, smileys are just 8
 
dct c source

that is the exact program . but this wil give you only basic cosine functions you have to multiply it to you information file by taking 8 bytes of the file at a time then you will get the dct of the file.

this is 2 d DCT . you can use i d DCT by simpling taking out one "for" loop from the 2 "for " loop pairs the in the program

try it all the best
--pradeep--
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top