function [res] = Evaluate_Valid_Srgb(srgbSubmitFile)

% submitted results
fprintf('Loading submitted results...\n');
srgbData = load(srgbSubmitFile);

% benchmark folders
benchGtDir = 'C:\SIDD_Blocks'; // change this to point at GT data
nImages = 40; 

% benchmark GT blocks
fprintf('Loading benchmark GT blocks... \n');
GT = load(fullfile(benchGtDir, 'BenchmarkValidationBlocksSrgb', ...
    'BenchmarkValidationBlocksSrgb.mat'));

% block positions
nBlocks = 32; 

% Evaluate raw-RGB
PsnrSrgb = zeros(nImages, nBlocks);
SsimSrgb = zeros(nImages, nBlocks);
fprintf('Evaluating sRGB...');

t0 = tic;

for i = 1 : nImages
    
    for b = 1 : nBlocks
                
        %gtBlock = GT.BenchmarkValidationBlocksSrgb{i, b};
        gtBlock = GT.BenchmarkValidationBlocksSrgb(i, b, :, :, :);
        gtBlock = im2single(gtBlock);
        gtBlock = reshape(gtBlock, size(gtBlock, 3), ...
            size(gtBlock, 4), size(gtBlock, 5));
        
        PsnrSrgb(i, b) = psnr(im2single(srgbData.DenoisedBlocksSrgb{i, b}),...
            gtBlock);
        SsimSrgb(i, b) = ssim(im2single(srgbData.DenoisedBlocksSrgb{i, b}),...
            gtBlock);
        
    end
end
t0 = toc(t0);
disp(['time = ', num2str(t0)]);
PsnrSrgb = mean(PsnrSrgb(:));
SsimSrgb = mean(SsimSrgb(:));

fprintf('PSNR (sRGB) = %2.2f, SSIM (sRGB) = %.3f, Time (sRGB) = %.3f \n', ...
    PsnrSrgb, SsimSrgb, srgbData.TimeMPSrgb);

res = [round(PsnrSrgb, 2), round(SsimSrgb, 3), round(srgbData.TimeMPSrgb, 2)];
fnm = [srgbSubmitFile(1:end-4), '.txt'];
fid = fopen(fnm, 'w');
fprintf(fid, ['PSNR_Srgb,SSIM_Srgb,TimeSrgb(s)\n']);
fclose(fid);
dlmwrite(fnm, res, '-append');
