How to read the CIF Video File Format
Here is a C code to read 2 frames from the CIF file
unsigned char ybuffer0[240][352]; // the y buffer
unsigned char crbuffer0[120][176]; // the cr buffer
unsigned char cbbuffer0[120][176]; // the cb buffer
unsigned char ybuffer1[240][352]; // the y buffer
unsigned char crbuffer1[120][176]; // the cr buffer
unsigned char cbbuffer1[120][176]; // the cb buffer
int fd; // pointer to the input file
int read2frames()
{
// Open the input file
fd = open ("foreman_qcif_0001.yuv", O_RDONLY) ;
// Read the first frame
read (fd, ybuffer0, 240*352);
read (fd, crbuffer0, 120*176);
read (fd, cbbuffer0, 120*176);
// Close the input file
close(fd);
// Open the input file
fd = open ("foreman_qcif_0002.yuv", O_RDONLY) ;
// Read the second frame
read (fd, ybuffer1, 240*352);
read (fd, crbuffer1, 120*176);
read (fd, cbbuffer1, 120*176);
// Close the input file
close(fd);
}


