% Elec539 Project 1
% Group RFC - Mara Prandi-Abrams, Anita Anderson, Oscar Pan
% 4/9/99

filename = input('Filename:\n','s');

[Q, masknum]=readbits(filename);

mask=findmask(masknum);
Qval=blkproc(Q, [8 8], 'ichunk', mask);
Qvalzeros = zeros(256)+(-437);
y = find(Qval < 2500);
Qvalzeros(y)=Qval(y);

image=blkproc(Qvalzeros, [8 8], 'idctus2');
%image=blkproc(Qvalzeros, [8 8], 'idct2');   % matlab's idct2
    
figure;
imagesc(image)
colormap(gray)
title('idct');

