This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM642 H263 Video Loopback Project.

Hi,

I'm working on H.263 Video Loopback project and try to do some overlay on the picture.

Looking at the code, I see code where a frame is processed but I don't see sections where it delineates a pixel. Thus I can resize the picture, make it a grayscale image etc but I cannot figure out how blank out a certain area on the frame.

I'm learning the TI drivers for video and hence I'm not sure where I'm missing the point.

Any help would be appreciated,

Sincerely,

 

  • The demo works on frames only and does not deal with each individual pixels. However, the pixel data is readily available in the video frames. You can simply use the buffer pointer and index it as an array to access the pixel data.

    Regards,

    Xaingdong

  • Hi,

    Thank you for your reply. I found the places in code where pixel level information is bein accessed.

    The following is the code snippet where, the Frame is captured and the pixel level information is found in the "in1" array. This code snippet is from tskVideoInput.c

    in1.Y_data =  (unsigned char *)capFrameBuf->frame.iFrm.y1;
    in1.Cb_data = (unsigned char *)capFrameBuf->frame.iFrm.cb1;
    in1.Cr_data = (unsigned char *)capFrameBuf->frame.iFrm.cr1;

    I'm trying to reduce the brightness of the image, hence I manipulated the "in1.Y_data" so that all the values are halved but made sure that none of the values went below the minimum of 16. However when

    for (cnt=10;cnt<(FRM_WIDTH*FRM_HEIGHT);cnt++) 
    {  
       *(in1.Y_data + cnt) = (*(in1.Y_data + cnt) > 32)?(*(in1.Y_data + cnt) >>= 1):(*(in1.Y_data + cnt));   

    }   

    This code is placed just after "in1.Cr_data = (unsigned char *)capFrameBuf->frame.iFrm.cr1; " I have attached the picture that is observed. As  you almost 60% of  the image is reduced in brightness which is intended but the other 40% lost the color information which wasn't desireable. Any thoughts as to why this is happening ?

    Sincerely,

    George Vince

     

    5736.Doc1.doc

  • Hi George,

    Can you try using the below code in place of the ternary operation just to rule out any compiler issue?

    if (*(in1.Y_data + cnt) >32)  *(in1.Y_data + cnt) >>=1;

    Thx,

    Mark

     

  • Goorge,

    Make sure you change Y for both fields. It seems that you just use the pointer of y1 and try to change it for the whole frame. From the image, it looks like the data is stored in field format. This means you should change only half of the data for y1 and the other half for y2.

    Regards,

    Xiangdong