jpeg91_decoder

PURPOSE ^

It decompress a file created using 'jpeg91_encoder' and it recovers the image

SYNOPSIS ^

function [ImR] = jpeg91_decoder(directorio,fichero)

DESCRIPTION ^

 It decompress a file created using 'jpeg91_encoder' and it recovers the image

 USE: [ImR] = jpeg91_decoder(directorio,fichero)

 where:

 directorio -> Folder where the file to decompress is
 fichero    -> Name of the .zip file (whithout extension) to decompress

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % It decompress a file created using 'jpeg91_encoder' and it recovers the image
0002 %
0003 % USE: [ImR] = jpeg91_decoder(directorio,fichero)
0004 %
0005 % where:
0006 %
0007 % directorio -> Folder where the file to decompress is
0008 % fichero    -> Name of the .zip file (whithout extension) to decompress
0009 
0010 function [ImR] = jpeg91_decoder(directorio,fichero)
0011 Lb = 16;
0012 Li = 256;
0013 
0014 cd(directorio)
0015 unzip([fichero '.zip']);
0016 ristra = read_code_jpeg91([fichero '.bin']);
0017 
0018 delete([fichero '.bin']);
0019 TheCode = zeros(256,255);
0020 
0021 norm = [3 ristra(1)];
0022 extr_err = ristra(2:3);
0023 QE = reshape(ristra(4:3+256),16,16);
0024 B = ristra(260);
0025 
0026 ristra = ristra(261:end);
0027 
0028 [TheCode] = inv_rle(ristra);
0029 
0030 NumNiv = 2^B;
0031 MM = 0.8;
0032 
0033 TheRealCode = TheCode * MM / NumNiv;
0034 
0035 Nc = round(0.9 * 40);
0036 qe = (extr_err(2) - extr_err(1)) * QE / (Nc - 1) + extr_err(1);
0037 
0038 Lmq = iimdpcm(qe,1,100);
0039 
0040 fprintf('Recovering the image:\n');
0041 z = 1;
0042 dctc1 = zeros(Li,Li);
0043 for i = 1:Lb:(Li-1)
0044     for j = 1:Lb:(Li-1)
0045 
0046         b = TheRealCode(z,:)';
0047         b = [0; b];
0048         b = dezigzag(b);
0049 
0050         dctc1(i:(i+(Lb-1)),j:(j+(Lb-1))) = b;
0051         z = z + 1;
0052     end
0053 end
0054 
0055 dctc1i = icontra2(dctc1,Lmq,4,norm);
0056 
0057 ImR = real(idct2r(dctc1i,4));

Generated on Fri 07-Mar-2014 13:29:20 by m2html © 2005