No BSD License  

Highlights from
Scalable MPEG compression based on DCT coefficients

Scalable MPEG compression based on DCT coefficients

by

 

15 Nov 2006 (Updated )

This application makes 2 layers base Layer and enhancement layer from quantized coefficients

shattest.m
clear all
close all
clc
tic



secCounter=0;
sCounter=0;
sHatArray=[];

w=0;
global I1d P4d P7d I10d B2d B3d B5d B6d B8d B9d
org='foreman.avi';
decoded='foreman1.avi';
dim=128;
framedata=aviread(org,1);
I1=frame2im(framedata);
I1=imresize(I1,[dim dim]);
I1=double(I1);

I1d=aviread(decoded,1);
I1d=frame2im(I1d);
I1d=imresize(I1d,[dim dim]);
%I1d=rgb2gray(I1d);
I1d=double(I1d);


for i=1:10:321
    i
    if i~=1
        j=i-round(i/10);
        [B2,B3,P4,B5,B6,P7,B8,B9,I10]=GOP1(org,j,dim);
        [B2d,B3d,P4d,B5d,B6d,P7d,B8d,B9d,I10d]=GOP2(decoded,j,dim);
    elseif i==1
        j=i;
        [B2,B3,P4,B5,B6,P7,B8,B9,I10]=GOP1(org,j,dim);
        [B2d,B3d,P4d,B5d,B6d,P7d,B8d,B9d,I10d]=GOP2(decoded,j,dim);
    end

    

        
    

			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(B2,B2d,I1,I1d);
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(B3,B3d,B2,B2d); 
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(P4,P4d,B3,B3d); 
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(B5,B5d,P4,P4d); 
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(B6,B6d,B5,B5d);  
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(P7,P7d,B6,B6d);
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(B8,B8d,P7,P7d); 
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(B9,B9d,B8,B8d); 
			w=w+1;
			[originalSI(w),decodedSI(w),originalTI(w),decodedTI(w)]=shat1(I10,I10d,B9,B9d); 

            secCounter=secCounter+1;
            if secCounter==3
                sCounter=sCounter+1;
                result(sCounter) = shat(originalSI,decodedSI,originalTI,decodedTI);
                secCounter=0;
                w=0;
            end

            I1=I10;
            I1d=I10d;
end
toc

Contact us