epifanio03_decoder

PURPOSE ^

SYNOPSIS ^

function [ristra,dctq,TheRealCode,ImR,DC] = epifanio03_decoder(directorio,fichero)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 function [ristra,dctq,TheRealCode,ImR,DC] = epifanio03_decoder(directorio,fichero)
0003 trayfich = 'estarereB';
0004 
0005 load(trayfich);
0006 Lb = 16;
0007 Li = 256;
0008 
0009 cd(directorio)
0010 unzip([fichero '.zip']);
0011 ristra = read_code_epifanio03([fichero '.bin']);
0012 
0013 delete([fichero '.bin']);
0014 TheCode = zeros(256,255);
0015 
0016 normaliz = [1 0];
0017 extr_err = ristra(1:2);
0018 QE = reshape(ristra(3:2+256),16,16);
0019 uCP = ristra(259);
0020 
0021 ristra = ristra(260:end);
0022 
0023 [TheCode] = inv_rle(ristra);
0024 
0025 NumNiv = 2^uCP;
0026 M = 10;
0027 
0028 TheRealCode = TheCode * M / NumNiv;
0029 
0030 Nc = round(0.9 * 40);
0031 qe = (extr_err(2) - extr_err(1)) * QE / (Nc - 1) + extr_err(1);
0032 
0033 Lmq = iimdpcm(qe,1,100);
0034 DC = 16 * Lmq;
0035 
0036 fprintf('Recovering the image:\n');
0037 fprintf('  Inverting from r to dct\n');
0038 z = 1;
0039 invgrad = inv(grad);
0040 for i = 1:Lb:(Li-1)
0041     for j = 1:Lb:(Li-1)
0042 
0043         signo1 = sign(TheRealCode(z,:)');
0044         signo1(signo1 == 0) = 1;
0045         signo1 = [1; signo1];
0046 
0047         irrq = signo1 .* adctm + signo1 .* (invgrad * V2 * [0; abs(TheRealCode(z,:)')]);
0048         irrq = dezigzag(irrq);
0049 
0050         dc(2:Lb,1) = irrq(2:Lb,1) * DC(round(i/Lb)+1,round(j/Lb)+1) / 2;
0051         dc(1,2:Lb) = irrq(1,2:Lb) * DC(round(i/Lb)+1,round(j/Lb)+1) / 2;
0052         dc(2:Lb,2:Lb) = irrq(2:Lb,2:Lb) * DC(round(i/Lb)+1,round(j/Lb)+1) / 4;
0053         dc(1,1) = DC(round(i/Lb)+1,round(j/Lb)+1);
0054 
0055         dctq(i:(i+(Lb-1)),j:(j+(Lb-1))) = dc;
0056         z = z + 1;
0057     end
0058 end
0059 fprintf('  Inverting from dct to spatial domain\n');
0060 ImR = real(idct2r(dctq,4));
0061

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