function [PSNRY,PSNRU,PSNRV,MSEY,MSEU,MSEV]=yuv_compare(Y1, U1, V1, fileName, width, height, startFrom)
%Compares two YUV sequences by computing PSNR
%[PSNRY,PSNRU,PSNRV,MSEY,MSEU,MSEV]=yuv_compare(yuvfile1,yuvfile2,dims)
%
%Input:
% yuvfile1 - first YUV sequence file
% yuvfile2 - second YUV sequence file
% dims - frame dimensions
% frames1 - [optional, default = all frames] frames in yuvfile1 to compare
% frames2 - [optional, default = frames1] frames in yuvfile2 to compare
%
%Output:
% PSNRY, PSNRU, PSNRV - PSNR values of the sequence for each frame, for Y, 
%                       U and V, respectively
% MSEY, MSEU, MSEV - the same, but MSE
%
%Uses: 
% seq_frames.m
% yuv_import.m 
% iq_measures.m (Quality Assessment toolbox - computation of MSE and PSNR)
%
%Example:
% [PY, PU, PV]=yuv_compare('compressed.yuv','original.yuv',[352 288]);
 
    [Y2, U2, V2] = yuv_import(fileName,[width, height],1,startFrom);
    %if (numel(Y2{1}) ~= prod(frm)) 
    %    break;
    %end; %there's no more frames in the sequence 2 
    [MSEY,PSNRY] = iq_measures(Y1,Y2{1});
    [MSEU,PSNRU] = iq_measures(U1,U2{1});
    [MSEV,PSNRV] = iq_measures(V1,V2{1});    
end
