Be the first to rate this file! 37 Downloads (last 30 days) File Size: 867 Bytes File ID: #15494

2-D DCT/IDCT for JPEG Compression

by Ahmed Samieh

 

03 Jul 2007 (Updated 04 Jul 2007)

Fast Implementation of 8X8 DCT/IDCT for JPEG Compression

| Watch this File

File Information
Description

to understand the Algorithm go to matlab help in page dct2 and idct2 to get the mathematical expression

for M = N = 8, we can calculate the most of hard values and save it as LUTs to speed up the execution

now compare our special 8X8 functions with the internal general functions

use this code:

A = int32(100*rand(8,8));
tic;for i = 1 : 1000 IDCT_8X8(DCT_8X8(A));end;toc;
tic;for i = 1 : 1000 idct2(dct2(A));end;toc;

i had built the general functions too, but with low speed

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
04 Jul 2007 Ali OZGUL

Here all sub-functions are similarly for program running procedure. Only, per functions are different to graphical-compression's functions;

DCT8X8 function:
 for n = 1 : 8
                s = s + (double(I(m,n)) * cosines(p,m) * cosines(q,n));
            end

IDCT function:
for q = 1 : 8
                s = s + (alpha(p,q) * double(I(p,q)) * cosines(p,m) * cosines(q,n));
            end

If you one-sub program's be running one module than I think very this function is very usefully.

For example: Dcomp.m(I,flag)
if flag==1 than running DCT_8x8.m
           else running IDCT_8x8.m
end

Good works, best regards

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
compression Ahmed Samieh 22 Oct 2008 09:18:13
2d dct Ahmed Samieh 22 Oct 2008 09:18:13
idct Ahmed Samieh 22 Oct 2008 09:18:14
dct2 Ahmed Samieh 22 Oct 2008 09:18:14
jpeg Ahmed Samieh 22 Oct 2008 09:18:14
idct2 Ahmed Samieh 22 Oct 2008 09:18:14
jpeg chinnu jeyanthi 26 Sep 2010 01:42:27
2d dct chinnu jeyanthi 26 Sep 2010 01:46:04
2d dct sinduja ravichandran 07 Feb 2012 12:53:40

Contact us at files@mathworks.com