www.pudn.com > Transforms.rar > is.m, change:2005-05-16,size:744b


function OUT = is(IN, iterations);

[a,b] = size(IN);

a = a / 2^(iterations-1);

b = b / 2^(iterations-1);

count = 0;

OUT = IN;

OUT1 = IN;

while count < iterations

index = 1;

j = 1;

k = 1;

while(j <= a),
  
    for k = 1:b,
    
        OUT1(j,k) = IN(index,k) - floor((IN((index) + (a/2),k))/2);
    
        OUT1(j+1,k) = OUT1(j,k) + IN((index) + (a/2),k);
    
  
    end
  
    j = j+2;
  
    index = index+1;

end

k = 1;

j = 1;

index = 1;

while k <= b,
  
    for j = 1:a,
    
        OUT(j,k) = OUT1(j,index) - floor((OUT1(j, (index) + (b/2)))/2);
    
        OUT(j, k+1) = OUT(j,k) + OUT1(j, (index) + (b/2));
  
    end
  
    k = k + 2;
  
    index = index+1;

end

count = count+1;

a = a*2;

b = b*2;

IN = OUT;

end