clear all;
clear classes;
clc;


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

mpegparams.bitrate=[3000 5000 7000 10000];
params.bitrate=[500 1000 2000 5000];

coders.add('MPEG2VBR',mpegparams);
coders.add('H264VBR',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_session_v0_%d.mat',...
    round(10000*rand)),'refdata','matdata');

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