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.

Conversion from YUV422 to YUV420 using DM365 resizer

Hi,

I am using  IPNC RDK version 5.0 provided by APPRO for DM365 - OV9715 IPNC.

I am integrating OV7955 sensor to it which gives the image in YUV422yuyv format.I am able to get this YUV422 image from the isif module.

I want to encode YUV422 data. Since the encoder doesn't support YUV422yuyv format, i am trying to convert YUV422 to YUV420 using the resizer.

The following is my resizer setting:

   DRV_ReszRunPrm prm;
   DRV_ReszOutPrm outPrm;


    prm.inType = DRV_DATA_FORMAT_YUV422;
    prm.inVirtAddr = OSA_cmemAlloc(bufSize, 32);
    prm.inPhysAddr = OSA_cmemGetPhysAddr(prm.inVirtAddr);
    prm.inStartX = 0;
    prm.inStartY = 0;
    prm.inWidth  = 640;
    prm.inHeight = 480;
    prm.inOffsetH= OSA_align(prm.inWidth, 16);
    prm.inOffsetV= prm.inHeight;
    prm.enableInvAlaw = FALSE;
    prm.enableInvDpcm = FALSE;
    prm.clkDivM = 10;
    prm.clkDivN = 80;


    prm.pOut[0] = &outPrm;
    prm.pOut[1] = NULL;


    outPrm.outType = DRV_DATA_FORMAT_YUV420;
    outPrm.flipH = FALSE;
    outPrm.flipV = FALSE;
    outPrm.outVirtAddr = OSA_cmemAlloc(bufSize, 32);
    outPrm.outPhysAddr = OSA_cmemGetPhysAddr(outPrm.outVirtAddr);
    outPrm.outWidth = 640;
    outPrm.outHeight = 480;
    outPrm.outOffsetH = OSA_align(outPrm.outWidth, 32);
    outPrm.outOffsetV = outPrm.outHeight;

I am attaching the screen shots of both YUV 422 and YUV 420 images.

YUV422:

YUV420:

Can anyone please tell what is the problem? Why is YUV 420 image coming like this? Is the resizer configuration proper?

Thanks and Regards,

Arpitha Mohan

  • Hi,

    After checking, I found that the resizer expects YUV422 to be in UYVY format whereas I was passing YUV422YUYV to the resizer. Please see the link below

    http://e2e.ti.com/support/embedded/linux/f/354/t/63988.aspx

    When I viewed YUV422yuyv image in YUV422uyvy format using the YUV viewer, it is same as YUV420 image which I am getting after the conversion.

    So it means, resizer is taking YUV422yuyv image in YUV422uyvy format as input and converting it into YUV420. Thus, there is no problem with the resizer.The problem is with the input format YUV422yuyv.

    Please correct me if my understanding is wrong.

    YUV422 viewed in YUV422YUYV format

                         

     YUV422 viewed in YUV422UYVY format  

    YUV420 after conversion

                              

    So now since the sensor gives the image in YUV422YUYV and not in YUV422UYVY format, I can neither pass this image directly to resizer nor to the encoder, how do I proceed now?

    How can I encode YUV422yuyv image? Is there any way by which I can convert YUV422YUYV into YUV422uyvy format?

    Regards,

    Arpitha

  • Arpitha,

    As per my understandings Resizer supports both UYVY & YUYV. There no no such restriction on YUYV format. But I remember, there is an option in Resizer to interchange positions of the Luma data and chroma data. i.e. luma followed by chroma or chroma followed by luma. So, may have to configure this properly .

  • Hi Ravi,

    I configured the sensor to output in uyvy instead of yuyv. With this format, resizer works and gives YUV 420 which i am passing to the encoder and getting JPEG image.

    Please see the link below. Here they have mentioned the formats supported by resizer

    http://e2e.ti.com/support/embedded/linux/f/354/t/63988.aspx

    I will look into the possibilities which you have mentioned.

    Thank you

    Regards,

    Arpitha

  • I mean to say that differene b/w uyvy  & yuyv is chroma and luma positions. If you see the video processing front end documentations for DM36x you can find out a register configuration for selecting this.