qdct52

PURPOSE ^

SYNOPSIS ^

function [dctc,co,cod,ncero,entrop,entrocod]=qdct52(tf,niveles,fronteras,fc,cc,crit,residuo,calentr)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 
0002 function [dctc,co,cod,ncero,entrop,entrocod]=qdct52(tf,niveles,fronteras,fc,cc,crit,residuo,calentr)
0003 
0004 s=size(tf);
0005 s=s(1);
0006 
0007 fre=topolar3(fc,s);
0008 cond=fre>residuo;
0009 
0010 tfs=tf;
0011 tfs=tfs.*cond;
0012 
0013 tfc=zeros(s,s);
0014 cod=zeros(s,s);
0015 for i1=1:s,
0016     for j1=1:s,
0017        d=floor(sqrt((i1-1).^2+(j1-1).^2));
0018        [tfc(i1,j1),cod(i1,j1)]=asignbbb(abs(tfs(i1,j1)),niveles(d+1,:),fronteras(d+1,:),crit);
0019 
0020     end
0021 end
0022 
0023 clear niveles
0024 clear fronteras
0025 
0026 c1=(tf>=0);
0027 c2=(tf<0);
0028 tfc=c1.*tfc-c2.*tfc;
0029 cod=c1.*cod-c2.*cod;
0030 
0031 anticond=cond<1;
0032 dctc=cc.*anticond.*tf+cond.*tfc;
0033 
0034 co=cod;
0035 
0036 if calentr==1
0037    codigo=zigzag(dctc);
0038    [codigo,nceros]=rle2(codigo);
0039 
0040    entrop=length(codigo)*entropiv(codigo)+length(nceros)*entropiv(nceros);
0041    entrop=entrop/s^2;
0042    cod=zigzag(cod);
0043 
0044    [cod,ncero]=rle2(cod);
0045 
0046       entrocod=length(cod)*entropiv(cod)+length(ncero)*entropiv(ncero);
0047    entrocod=entrocod/s^2;
0048 else
0049    entrop=0;
0050    cod=0;
0051    ncero=0;
0052    entrop=0;
0053    entrocod=0;
0054 end

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