%DECOMPRESS all videos of BVI-SR database.
function decompress()% decodes all the losslessly compressed .mp4 files in the
%   two subfolders and reconstructs them as .yuv files in the same
%   places.
%
%   Please use them for BVI-SR database ONLY.
%
%   Copyright 2018 University of Bristol, UK.
%   Please contact fan.zhang@bristol.ac.uk for more information.
%   Associated function.

inputPath{1} = '.\ORIG\';
inputPath{2} = '.\TEST\';

for i = 1:2
    filelist = dir([inputPath{i} '*.mp4']);
    
    for s = 1:size(filelist(:),1)
        idx = strfind(filelist(s).name,'.mp4');
        filename = filelist(s).name(1:idx(1)-1);
        
        
        system(['.\\ffmpeg-hi10-heaac.exe ' ...
            ['-i ' inputPath{i} filelist(s).name ' ']...
            inputPath{i} filename '.yuv']);
    end
end