Thursday, June 25, 2009

Philips 7113 Encoder

Used SAA71133 to convert analog video to digital. This chip is a video decoder chip and it simply converts an analog video signal into digital which in this case is passed to DSP for processing. It is not a mpeg encoder.The output is standard ITU656 YUV 4:2:2 (BT656).

If the output video format is:
Cb_Y_Cr_Y_Cb_Y_Cr_Y_Cb_Y_Cr_Y_…
Cb_Y_Cr_Y_Cb_Y_Cr_Y_Cb_Y_Cr_Y_

We can use following to get Y:

unsigned char *src; // source video
unsigned char *dst; // Y channel
unsigned char *ptr;
...
...
for(j=0; j<height; j+= 2)
{
ptr = src + LINESIZE * j;
for(i=0; i<width; i+=8)
{
dst[0] = (ptr[1] + ptr[3])/2;
dst[1] = (ptr[5] + ptr[7])/2;
dst[2] = (ptr[9] + ptr[11])/2;
dst[3] = (ptr[13] + ptr[15])/2;
dst += 4;
ptr += 16;
}
}

No comments:

Post a Comment