clear all;
clear classes;
clc;


referencevideos=ReferenceVideoCollection('*.mkv');
coders=VideoCoderCollection;

params.bitrate=2*[100 500 1000];

%coders.add('H264CBR',params);
%coders.add('H264VBR',params);
%coders.add('H265CBR',params);
%coders.add('H265VBR',params);
%coders.add('MPEG2VBR',params);

paramsdcp.compressionlevel=[10 30 50];

coders.add('DCP',paramsdcp);
coders.add('H264IntraVBR',params);
coders.add('H265IntraVBR',params);

videometrics=VideoMetricsCollection;
videometrics.add('AVG-PSNR');
videometrics.add('AVG-SSIM');

CompressedVideos=coders.proc(referencevideos);
CompressedVideos.addmetrics(videometrics);
CompressedVideos.calcmetrics;

%CompressedVideos.fcc;

[refdata,matdata]=CompressedVideos.makestatistics;
save(sprintf('refdata_matdata_video_%d.mat',...
    round(10000*rand)),'refdata','matdata');

makeplots(1,'refdata_matdata_video*.mat');
