clear
[Y] = yuv_import('tr1_25fps.yuv',[768 432],250);
tr1=[Y];
[Y] = yuv_import('tr2_25fps.yuv',[768 432],250);
tr2=[Y];
[Y] = yuv_import('tr3_25fps.yuv',[768 432],250);
tr3=[Y];
[Y] = yuv_import('tr4_25fps.yuv',[768 432],250);
tr4=[Y];
[Y] = yuv_import('tr5_25fps.yuv',[768 432],250);
tr5=[Y];
[Y] = yuv_import('tr6_25fps.yuv',[768 432],250);
tr6=[Y];
[Y] = yuv_import('tr7_25fps.yuv',[768 432],250);
tr7=[Y];
[Y] = yuv_import('tr8_25fps.yuv',[768 432],250);
tr8=[Y];
[Y] = yuv_import('tr9_25fps.yuv',[768 432],250);
tr9=[Y];
[Y] = yuv_import('tr10_25fps.yuv',[768 432],250);
tr10=[Y];
[Y] = yuv_import('tr11_25fps.yuv',[768 432],250);
tr11=[Y];
[Y] = yuv_import('tr12_25fps.yuv',[768 432],250);
tr12=[Y];
[Y] = yuv_import('tr13_25fps.yuv',[768 432],250);
tr13=[Y];
[Y] = yuv_import('tr14_25fps.yuv',[768 432],250);
tr14=[Y];
[Y] = yuv_import('tr15_25fps.yuv',[768 432],250);
tr15=[Y];
[Y] = yuv_import('tr16_25fps.yuv',[768 432],250);
tr16=[Y];
for i=1:250
    img1=tr1{1,i};
    img2=tr2{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b2=mean(a); %% b2 means SSIM
end
for i=1:250
    img1=tr1{1,i};
    img2=tr3{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b3=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr4{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b4=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr5{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b5=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr6{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b6=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr7{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b7=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr8{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b8=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr9{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b9=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr10{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b10=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr11{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b11=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr12{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b12=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr13{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b13=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr14{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b14=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr15{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b15=mean(a);
end
for i=1:250
    img1=tr1{1,i};
    img2=tr16{1,i};
    [mssim] = ssim_index(img1, img2);
    a(i)=[mssim];
    b16=mean(a);
end   
trmssim=[b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16];
savefile='trmssim.mat';
save(savefile,'trmssim');

    