cours-m1-eea/455-Codage_Sources/TP/TP3/Manip3.m

26 lines
687 B
Mathematica
Raw Normal View History

2019-01-15 15:56:28 +01:00
% Aymeric Arnould, Tom Colinot
% TP3
% Codage INTRA (3/3)
% Question 8 - Qualité visuelle (INTRA) pour différentes valeurs du débit
clear all;
gamma=[0.1 1 3 5]; %Pas de quantification
file = fopen('Foreman.qcif','r');
[compY,~,~]=yuv_readimage(file,'qcif');
figure(1)
subplot(2,length(gamma)+1,1); imagesc(compY); title('Image non compressee');
colormap(gray)
for k=1:size(gamma,2)
g=gamma(k);
[Yc,~,bpp] = encodeINTRA(compY,g);
d=bpp*size(compY,1)*size(compY,2)*15;
subplot(2,length(gamma)+1,k+1); imagesc(Yc); title(strcat('gamma=',num2str(g),',','Debit=',num2str(d), 'bps'));
subplot(2,length(gamma)+1,length(gamma)+k+2); imagesc(compY-Yc);
end