function y = vcif2(i,n)
% function vcif(i,n)
% View the n-th frame (luminance) of the input CIF format sequence i
% CIF format has 352 pixels (horizontally) and 288 pixels(vertically)
%
% Usage: 
% y1 = vcif2('tennis_cif.yuv',1);   % Read the first frame (luminance)
% y2 = vcif2('tennis_cif.yuv',2);   % Read the first frame (luminance)

% Author: Dr. W.D.Pan

figure;
FS= 352*288;    % Size of the luminance components for one frame
FSC= 352*144;   % Size of the succedding chrominance components for one frame

fid= fopen(i);
fseek(fid, (n-1)*(FS + FSC), 'bof');    % Point to a particular frame

cur = fread(fid,FS,'uchar');
y = reshape(cur,352,288)';
imagesc(y);
colormap(gray);
axis off;
fclose(fid);
