cours-m1-eea/455-Codage_Sources/TP/TP3/Manip1.m
2019-01-15 15:56:28 +01:00

51 lines
No EOL
1 KiB
Matlab

% Aymeric Arnould, Tom Colinot
% TP3
% Codage INTRA (1/3)
clear all;
file = fopen('Foreman.qcif','r');
% Affichage d'une image de la séquence
% [compY,compU,compV]=yuv_readimage(file,'qcif');
%
% figure(1)
% colormap(gray)
% subplot(131); imagesc(compY); title('Y')
% subplot(132); imagesc(compU'); title('U')
% subplot(133); imagesc(compV'); title('V')
% Codage d'une séquence d'image successives
[compY,compU,compV]=yuv_readimage(file,'qcif');
Y=zeros(size(compY,1),size(compY,2),5);
Yc= zeros(size(compY,1),size(compY,2),5);
PSNR=[];
bpp=[];
gamma = 1;
for i=1:5
[compY,compU,compV]=yuv_readimage(file,'qcif');
[I_rec,b,r] = encodeINTRA(compY,gamma);
Y(:,:,i) = compY;
Yc(:,:,i) = I_rec;
PSNR(i)=b;
bpp(i) = r;
end
gamma
mean(PSNR)
mean(bpp)*size(compY,1)*size(compY,2)*15
% Affichage des images de bases et des images codées de la séquence
% figure(1)
% colormap(gray)
% for i=1:5
% subplot(1,5,i); imagesc(Y(:,:,i));
% end
%
% figure(2)
% colormap(gray)
% for i=1:5
% subplot(1,5,i); imagesc(Yc(:,:,i));
% end