1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| function [IMG] = projeti( pas , D , dict , ligne , col)
if(mod(ligne,8)~=0)
ligne2 = ligne+8-mod(ligne,8);
else
ligne2 = ligne;
end
if(mod(col,8)~=0)
col2=col+8-mod(col,8);
else
col2=col;
end
maxhor=col2/8;
maxver=ligne2/8;
indh=1;
indv=1;
mat=cell(maxver,maxhor);
Q=quantum(pas);
disp('veuillez patientez pendant la decompression . . . ');
D=octeti(D);
disp('entree huffman');
C=huffmandeco(D,dict);
disp('huffman termine');
j=1;
i=1;
B=zeros(1,2);
max=size(C,2);
while (i<=max)
if ((C(i)~=0) || (C(i+1)~=0))
B(j)=C(i);
j=j+1;
i=i+1;
else
i=i+2;
F=RLEi(B);
j=1;
if(size(F,2)~=64)
error('tkh');
end
G=zigzagi(F);
G=G.*Q;
G=DCTi(G);
G=round(G);
mat{indv,indh}=G;
B=zeros(1,2);
if (indh~=maxhor)
indh=indh+1;
else
indh=1;
indv=indv+1;
end
end
end
IMG=cell2mat(mat);
IMG=IMG+128;
end |
Partager