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

makeLayers(c)
function [X,B,E]= makeLayers(c)


%I=imread('cameraman.tif');
%I=dct2(I);
scanzz=zeros(8,8);
%enhansLayer=zeros(8,8);
b=1;
l=1;
v=0;
cSize=size(c);
Blimit=6;
Elimit=57;
for i=1:8:cSize(1,1)
    for j=1:8:cSize(1,2)
        v=v+1;
        scanzz=zigzag(c(i:i+7,j:j+7));
        DC(v)=scanzz(1);
        baseLayer(v,1:Blimit)=scanzz(2:Blimit+1);
        enhansLayer(v,l:Elimit)=scanzz(Blimit+2:Blimit+Elimit+1);
             
    end
end
B=[];
zzBSize=size(baseLayer);
for i=1:zzBSize(1,1)
    [val,run]=rle(baseLayer(i,1:Blimit));
    temp = huffEncode1(val,run);
    B=[B temp];
end
E=[];    
zzESize=size(enhansLayer);
for i=1:zzESize(1,1)
    [val,run]=rle(enhansLayer(i,1:Elimit));
    temp = huffEncode1(val,run);
    E=[E temp];
end

dcSize=length(DC);
diffDC(1)=DC(1);
for i=2:dcSize
    diffDC(i)=DC(i)-DC(i-1);
end

X=huffEncodeDC(diffDC);





%layer=deRunLength(diffDC,valVectorBase,lenVectorBase,valVectorEnhan,lenVectorEnhan);
%figure;imshow(layer)
% diffDC(1)=baseLayer(1,1);
% for i=2:1024
%     diffDC(i)=baseLayer(i,1)-baseLayer(i-1,1);
% 
%     [val len]=rle(baseLayer(i,2:20));
%     
%     valVectorBase(i-1,1:19)=val;
%     lenVectorBase(i-1,1:19)=len;
% end
% for i=1:1024
%     [val len]=rle(enhansLayer(i,1:44));
%     size(val)
%     valVectorEnhan(i,1:44)=val;
%     lenVectorEnhan(i,1:44)=len;
% end
%     

Contact us