rm tp du drive
This commit is contained in:
parent
12fc5b2b5c
commit
a074ea93c2
8 changed files with 0 additions and 353 deletions
|
@ -1,51 +0,0 @@
|
|||
% 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
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
% Aymeric Arnould, Tom Colinot
|
||||
% TP3
|
||||
% Codage INTRA (2/3)
|
||||
% Question 7 - PSNR moyen en fonction du débit moyen
|
||||
|
||||
%clear all;
|
||||
PSNRmoy=[];
|
||||
bpsmoy=[];
|
||||
gamma=1:10;
|
||||
|
||||
|
||||
for k=1:size(gamma,2)
|
||||
g=gamma(k);
|
||||
file = fopen('Foreman.qcif','r');
|
||||
|
||||
PSNR=[];
|
||||
bpp=[];
|
||||
|
||||
for i=1:5
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
[~,b,r] = encodeINTRA(compY,g);
|
||||
PSNR(i)=b;
|
||||
bpp(i) = r;
|
||||
end
|
||||
|
||||
PSNRmoy(k)=mean(PSNR);
|
||||
bpsmoy(k)=mean(bpp)*size(compY,1)*size(compY,2)*15;
|
||||
end
|
||||
|
||||
figure(1)
|
||||
subplot(131); plot(gamma,PSNRmoy); xlabel('gamma'); ylabel('PSNR moyen');
|
||||
subplot(132); plot(gamma,bpsmoy); xlabel('gamma'); ylabel('Debit moyen (bps)');
|
||||
subplot(133); plot(bpsmoy,PSNRmoy); xlabel('Debit moyen (bps)'); ylabel('PSNR moyen');
|
|
@ -1,25 +0,0 @@
|
|||
% 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
|
|
@ -1,44 +0,0 @@
|
|||
% Aymeric Arnould, Tom Colinot
|
||||
% TP3
|
||||
% Codage INTER (1/3)
|
||||
% Questions 9 à 11
|
||||
|
||||
clear all;
|
||||
|
||||
n=5; %Nombre d'images à coder
|
||||
gamma=1; %Pas
|
||||
|
||||
file = fopen('Foreman.qcif','r');
|
||||
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Y=zeros(size(compY,1),size(compY,2),n); %images avant codage
|
||||
Yc= zeros(size(compY,1),size(compY,2),n); %images codées
|
||||
|
||||
%Codage de la première image
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(compY,gamma);
|
||||
Y(:,:,1) = compY;
|
||||
Yc(:,:,1) = I_rec;
|
||||
|
||||
%Pour les images suivantes, soustraction de l'image n-1 à l'image n avant
|
||||
%codage
|
||||
for k=2:n
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Yk = compY - Yc(:,:,k-1); % différences par rapport à l'image décodée précédente
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(Yk,gamma);
|
||||
|
||||
Y(:,:,k) = Yk;
|
||||
Yc(:,:,k) = I_rec + Yc(:,:,k-1); % reconstruction à l'aide de l'image décodée précédente
|
||||
end
|
||||
|
||||
% Affichage des images de bases et des images codées de la séquence
|
||||
figure(1)
|
||||
colormap(gray)
|
||||
for i=1:n
|
||||
subplot(1,n,i); imagesc(Y(:,:,i));
|
||||
end
|
||||
|
||||
figure(2)
|
||||
colormap(gray)
|
||||
for i=1:n
|
||||
subplot(1,n,i); imagesc(Yc(:,:,i));
|
||||
end
|
|
@ -1,52 +0,0 @@
|
|||
% Aymeric Arnould, Tom Colinot
|
||||
% TP3
|
||||
% Codage INTER (2/3)
|
||||
% Questions 12
|
||||
|
||||
%clear all;
|
||||
|
||||
n=5; %Nombre d'images à coder
|
||||
gamma=1:10; %Pas
|
||||
|
||||
PSNRmoy=[];
|
||||
bpsmoy=[];
|
||||
|
||||
|
||||
|
||||
for i=1:length(gamma)
|
||||
g = gamma(i);
|
||||
|
||||
file = fopen('Foreman.qcif','r');
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
PSNR_seq=[];
|
||||
bpp_seq=[];
|
||||
|
||||
%Codage de la première image
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(compY,g);
|
||||
Y(:,:,1) = compY;
|
||||
Yc(:,:,1) = I_rec;
|
||||
PSNR_seq(1) = PSNR;
|
||||
bpp_seq(1) = bpp;
|
||||
|
||||
%Pour les images suivantes, soustraction de l'image n-1 à l'image n avant
|
||||
%codage
|
||||
for k=2:n
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Yk = compY - Yc(:,:,k-1); % différences par rapport à l'image décodée précédente
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(Yk,g);
|
||||
|
||||
Y(:,:,k) = Yk;
|
||||
Yc(:,:,k) = I_rec + Yc(:,:,k-1); % reconstruction à l'aide de l'image décodée précédente
|
||||
PSNR_seq(k) = PSNR;
|
||||
bpp_seq(k) = bpp;
|
||||
end
|
||||
|
||||
PSNRmoy(i) = mean(PSNR_seq);
|
||||
bpsmoy(i) = mean(bpp_seq)*size(compY,1)*size(compY,2)*15;
|
||||
|
||||
end
|
||||
|
||||
figure(1);
|
||||
subplot(131); plot(gamma,PSNRmoy); xlabel('gamma'); ylabel('PSNR moyen');
|
||||
subplot(132); plot(gamma,bpsmoy); xlabel('gamma'); ylabel('Debit moyen (bps)');
|
||||
subplot(133); plot(bpsmoy,PSNRmoy); xlabel('Debit moyen (bps)'); ylabel('PSNR moyen');
|
|
@ -1,47 +0,0 @@
|
|||
% Aymeric Arnould, Tom Colinot
|
||||
% TP3
|
||||
% Codage INTER (3/3)
|
||||
% Question 13 - Qualité visuelle (INTER) pour différentes valeurs du débit
|
||||
|
||||
clear all;
|
||||
|
||||
n=5;
|
||||
gamma=[0.1 1 3 5]; %Pas de quantification
|
||||
|
||||
file = fopen('Foreman.qcif','r');
|
||||
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Y=zeros(size(compY,1),size(compY,2),n); %images avant codage
|
||||
Yc= zeros(size(compY,1),size(compY,2),n); %images codées
|
||||
|
||||
|
||||
|
||||
for i=1:size(gamma,2)
|
||||
g=gamma(i);
|
||||
|
||||
file = fopen('Foreman.qcif','r');
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
%Codage de la première image
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(compY,g);
|
||||
Y(:,:,1) = compY;
|
||||
Yc(:,:,1) = I_rec;
|
||||
|
||||
figure(1)
|
||||
colormap(gray)
|
||||
|
||||
|
||||
for k=2:n
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Yk = compY - Yc(:,:,k-1); % différences par rapport à l'image décodée précédente
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(Yk,g);
|
||||
|
||||
Y(:,:,k) = Yk;
|
||||
Yc(:,:,k) = I_rec + Yc(:,:,k-1); % reconstruction à l'aide de l'image décodée précédente
|
||||
end
|
||||
|
||||
|
||||
d=bpp*size(compY,1)*size(compY,2)*15;
|
||||
|
||||
subplot(1,length(gamma)+1,1); imagesc(compY); title('Image non compressee');
|
||||
subplot(1,length(gamma)+1,i+1); imagesc(Yc(:,:,end)); title(strcat('gamma=',num2str(g),',','Debit=',num2str(d), 'bps'));
|
||||
end
|
|
@ -1,43 +0,0 @@
|
|||
% Aymeric Arnould, Tom Colinot
|
||||
% TP3
|
||||
% Compensation de mouvement (1/2)
|
||||
% Codage d'une séquence
|
||||
|
||||
clear all
|
||||
|
||||
n=5; %Nombre d'images à coder
|
||||
gamma=1;
|
||||
blksize = 16; %taille des blocs
|
||||
SearchRange = 8; %portée des vecteurs mouvements
|
||||
|
||||
file = fopen('Foreman.qcif','r');
|
||||
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Y= zeros(size(compY,1),size(compY,2),n); %images de base
|
||||
Yc= zeros(size(compY,1),size(compY,2),n); %images (dé)codées
|
||||
Yp= zeros(size(compY,1),size(compY,2),n); %images prédites
|
||||
|
||||
%Codage de la première image
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(compY,gamma);
|
||||
Y(:,:,1) = compY;
|
||||
Yc(:,:,1) = I_rec;
|
||||
|
||||
for k = 2:n
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Y(:,:,k) = compY;
|
||||
compYr = Yc(:,:,k-1);
|
||||
[compPred,~,~,~] = PicturePred(compY,compYr,blksize,SearchRange);
|
||||
[I_rec,~,~] = encodeINTRA(compY-compPred,gamma);
|
||||
|
||||
Yc(:,:,k) = compPred + I_rec;
|
||||
Yp(:,:,k) = compPred;
|
||||
end
|
||||
|
||||
% Affichage des images de bases et des images codées de la séquence
|
||||
figure(1)
|
||||
colormap(gray)
|
||||
for i=1:n
|
||||
subplot(3,5,i); imagesc(Y(:,:,i));
|
||||
subplot(3,5,i+n); imagesc(Yp(:,:,i));
|
||||
subplot(3,5,i+2*n); imagesc(Y(:,:,i)-Yp(:,:,i));
|
||||
end
|
|
@ -1,58 +0,0 @@
|
|||
% Aymeric Arnould, Tom Colinot
|
||||
% TP3
|
||||
% Compensation de mouvement (2/2)
|
||||
% PSNR moyen et débit moyen
|
||||
|
||||
%clear all
|
||||
|
||||
n=5; %Nombre d'images à coder
|
||||
gamma=1:10;
|
||||
blksize = 16; %taille des blocs
|
||||
SearchRange = 8; %portée des vecteurs mouvements
|
||||
|
||||
PSNRmoy=[];
|
||||
bpsmoy=[];
|
||||
bpsmoy2=[];
|
||||
|
||||
for i=1:length(gamma)
|
||||
g=gamma(i);
|
||||
file = fopen('Foreman.qcif','r');
|
||||
|
||||
PSNR_seq=[];
|
||||
bpp_seq=[];
|
||||
bppMV_seq=[];
|
||||
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
Yc= zeros(size(compY,1),size(compY,2),n); %images (dé)codées
|
||||
|
||||
%Codage de la première image
|
||||
[I_rec,PSNR,bpp] = encodeINTRA(compY,g);
|
||||
Yc(:,:,1) = I_rec;
|
||||
PSNR_seq(1) = PSNR;
|
||||
bpp_seq(1) = bpp;
|
||||
|
||||
for k = 2:n
|
||||
[compY,~,~]=yuv_readimage(file,'qcif');
|
||||
compYr = Yc(:,:,k-1);
|
||||
[compPred,~,~,bppMV] = PicturePred(compY,compYr,blksize,SearchRange);
|
||||
[I_rec,~,bpp] = encodeINTRA(compY-compPred,g);
|
||||
|
||||
Yc(:,:,k) = compPred + I_rec;
|
||||
|
||||
PSNR_seq(k) = PSNR;
|
||||
bpp_seq(k) = bpp;
|
||||
bppMV_seq(k-1) = bppMV;
|
||||
end
|
||||
|
||||
PSNRmoy(i) = mean(PSNR_seq);
|
||||
bpsmoy(i) = mean(bpp_seq)*size(compY,1)*size(compY,2)*15; %en ne tenant pas compte de bppMV
|
||||
bpsmoy2(i) = (mean(bppMV_seq)+mean(bpp_seq))*size(compY,1)*size(compY,2)*15; %en tenant compte de bppMV
|
||||
|
||||
fclose('all');
|
||||
|
||||
end
|
||||
|
||||
figure(2);
|
||||
subplot(131); plot(gamma,PSNRmoy); xlabel('gamma'); ylabel('PSNR moyen');
|
||||
subplot(132); plot(gamma,bpsmoy,gamma,bpsmoy2); xlabel('gamma'); ylabel('Debit moyen (bps)'); legend('Sans bppMV','Avec bppMV');
|
||||
subplot(133); plot(bpsmoy,PSNRmoy,bpsmoy2,PSNRmoy); xlabel('Debit moyen (bps)'); ylabel('PSNR moyen'); legend('Sans bppMV','Avec bppMV');
|
Loading…
Reference in a new issue