I have to process a digital video data file. It is organized as frames. Each data in a frame is a byte. each frame has 3 components of data y, u and v. Y data has a size of w bytes*h bytes. U & V have a size of w/2*h/2 bytes each.
Each frame is organised as ydata ,udata,followed by vdata. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
So each frame has data of 3*w*h/2 bytes.
<o></o>
There are several frames of data , one followed by another in data file xxx.yuv (pick a qcif.yuv file here). <o></o>
<o></o>
Read the file. Use pointers to assign ydata udata and vdata from the file.<o></o>
<o></o>
Read the first frame as it is . No processing to be done. <o></o>
<o></o>
Read the next framelook at only two-dimensional ydata.<o></o>
Difference with y data of the previous frame. <o></o>
<o></o>
Look at them as 4 bytes width * 4 bytes height block differences . <o></o>
If each byte difference is less than a value given say (4), in all 4*4 block , generate flag bit 0 for that 4*4 block, otherwise 1 , and continue to the next block.do this for the first 10 frames. <o></o>
<o></o>
Generate flag array data for 2nd 3rd ..... 10th frame.<o></o>
<o></o>
For 2nd frame , 1st frame will be reference, for 3rd ,2nd frame etc? <o></o>
<o></o>
, the output is the flag array (0/1 for each 4*4 block) <o></o>
<o></o>
For 2.....10 frames . <o></o>
(let say the image size is w=176 ,h=144 , the frame size =3*176*144/2. Ydata size is 176*144 bytes.there are 1584, 4*4 blocks in the y data frame etc.the flag array size for each frame is 1584).
<o></o>
Each frame is organised as ydata ,udata,followed by vdata. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
So each frame has data of 3*w*h/2 bytes.
<o></o>
There are several frames of data , one followed by another in data file xxx.yuv (pick a qcif.yuv file here). <o></o>
<o></o>
Read the file. Use pointers to assign ydata udata and vdata from the file.<o></o>
<o></o>
Read the first frame as it is . No processing to be done. <o></o>
<o></o>
Read the next framelook at only two-dimensional ydata.<o></o>
Difference with y data of the previous frame. <o></o>
<o></o>
Look at them as 4 bytes width * 4 bytes height block differences . <o></o>
If each byte difference is less than a value given say (4), in all 4*4 block , generate flag bit 0 for that 4*4 block, otherwise 1 , and continue to the next block.do this for the first 10 frames. <o></o>
<o></o>
Generate flag array data for 2nd 3rd ..... 10th frame.<o></o>
<o></o>
For 2nd frame , 1st frame will be reference, for 3rd ,2nd frame etc? <o></o>
<o></o>
, the output is the flag array (0/1 for each 4*4 block) <o></o>
<o></o>
For 2.....10 frames . <o></o>
(let say the image size is w=176 ,h=144 , the frame size =3*176*144/2. Ydata size is 176*144 bytes.there are 1584, 4*4 blocks in the y data frame etc.the flag array size for each frame is 1584).
<o></o>
Comment