

filename = 'miss_am.qcif';
endframe =72;
movietype=0;
outputfile = 'miss_am';
stepsize=32;


Y = ReadVideo(filename, endframe, movietype);

cd SAVEALL
stepsize=48;
eval(['load NoMC_2D_DCT_' num2str(stepsize) outputfile]);
Y_2DDCT_encoded=Y_encoded;

stepsize=24;
eval(['load MC_2D_DCT_' num2str(stepsize) outputfile]);
Y_block_encoded=Y_encoded;

eval(['load NoMC_3D_DCT_' num2str(stepsize) outputfile]);
Y_DCT_encoded=Y_encoded;

eval(['load NoMC_3D_PCA_DCT_' num2str(stepsize) outputfile]);
Y_PCA_encoded=Y_encoded;

stepsize=64;
eval(['load Volume_MC_3D_DCT_STD' num2str(stepsize) '_6' outputfile]);
Y_volume_encoded=Y_encoded;

stepsize=32;
eval(['load Volume_MC_3D_DCT_STD' num2str(stepsize) '_6' outputfile]);
Y_volume_encoded=Y_encoded;

cd G:\data_Burak\ee392j\project\FINAL\SAVEALL\
mkdir Image_Foreman_32
Write_Directory ='G:\data_Burak\ee392j\project\FINAL\SAVEALL\Image_Miss_AM_32';

cd G:\data_Burak\ee392j\project\FINAL\SAVEALL\Image_Miss_AM_32
mkdir Image3DMC_STD
mkdir Image2DDCT
mkdir Image3DDCT
mkdir Image2DMC
mkdir ImagePCA

for i=10:endframe
    
    %imwrite(uint8(Y_volume_encoded{1,i}),[ Write_Directory '\Image3DMC_STD\image' sprintf('%.4d',i) '.bmp'],'bmp');
    if (i<49)
        imwrite(uint8(Y_PCA_encoded{1,i}),[ Write_Directory '\ImagePCA\image' sprintf('%.4d',i) '.bmp'],'bmp');
    end
    %imwrite(uint8(Y_DCT_encoded{1,i}),[ Write_Directory '\Image3DDCT\image' sprintf('%.4d',i) '.bmp'],'bmp');
    %imwrite(uint8(Y_block_encoded{1,i}),[ Write_Directory '\Image2DMC\image' sprintf('%.4d',i) '.bmp'],'bmp');
    %imwrite(uint8(Y_2DDCT_encoded{1,i}),[ Write_Directory '\Image2DDCT\image' sprintf('%.4d',i) '.bmp'],'bmp');
    
    %keyboard;
end




if (0)
for i=10:endframe
    figure(5);
    subplot(2,2,1);
    imagesc(Y{1,i});
    colormap(gray);
    title('original');
    subplot(2,2,4);
    imagesc(Y_block_encoded{1,i});
    title('2D - MC ');
    colormap(gray);
    subplot(2,2,3);
    imagesc(Y_volume_encoded{1,i});
    title('3D - MC ');
    colormap(gray);    
    subplot(2,2,2);
    imagesc(Y_DCT_encoded{1,i});
    title('3D - DCT ');
    colormap(gray);
    h=figure(5); 
    MM(:,1) = getframe(h);
    Matlab_Frame = MM(:,1);
    imwrite(Matlab_Frame.cdata,[ Write_Directory '\Image' sprintf('%.4d',i) '.bmp'],'bmp');
    %keyboard;
end
end

