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.

vpfe previewer setup clarifications

I am starting to work with the dm6435 previewer block and have a few questions.

1) I notice that both the input & output settings have requirements for line offsets to be 32 byte aligned.  (RADR_OFFSET & WADR_OFFSET)  Does this mean that my input line size should be larger than my output buffer line size by a multiple of 32?  I assume I would then have to set my start/end pixels based on which blocks are enabled to match these alignments.  (HORZ_INFO)  I dug through the psp driver code and couldn't see where this would be handled by the driver, so I guess the application would have to handle this?

2) Could someone explain the use of the gradient thresholds in the CFA register?  I assume these are part of the ti proprietary bayer demosaic, and I see the default values set in the dm6437evm example.  Is there ever any reason to change this value?

3) I assume that the contrast value is just a gain applied to the Y channel of all pixels during conversion and the brightness is just an offset added to the Y channel.  Is this correct?

Thanks for any info.

  • I have a follow up question.

    I have an initial implementation working and got an image out of the previewer block, but the luminance component is not in the location I expected.  I have the y-cb-y-cr ordering selected, and confirmed that the PCR register bits 17-18 are 0 to reflect this setting.  But instead of seeing the Y component in the first & third bytes it is in the 2nd & 4th bytes.  Am I misinterpreting the data sheet (spru977c page 147) or is this a bug?  I double checked that my input & output buffers are both 32 byte aligned, but don't know what else to look for.

     

  • 1) In general, the image is smaller than line offset, unless you can allow to drop some portion of the image or the image width is multiple of 32. In memory, you can have some blank bytes between the lines and by doing this, you can keep all the pixels.

    2) Unless you are imaging engineer and you have big time to dig into, we are not recommended to design your own CFAI as we provide good default parameters. If you have any problem with the default data, then please post the problem.

    3) Yes, Contrast is applying Gain on Y and Brightness is applying Offset on Y.

    Regards,

    Sang-Yong

     

     

     

  • As the memory is 16bit little endian interface, Cb show up at the first byte (which is the one we usually use) followed by Y0.

    Regards,

    Sang-Yong

     

  • Ah, thank you for the information.  I think the documentation and examples could be much more explicit on the component order.  I had assumed a 32 bit little endian addressing scheme like the rest of the dsp which led to my confusion.

    I am now getting previewer results with good looking luma, but the chroma is wacky.  (this is from CCS display, after separating components from previewer output)

    When I take the same raw bayer image and run it through a simple demosaic, I get this (downres &  jpeg):

    I left the csc0:2 registers in their default states.

    RGB blend matrix is identity (rgb_mat1, 3, & 5 = 0x100)

    Only stage enabled in previewer is cfa interpolation.

    CFA register is 0x28 for both vert & hor gradients (taken from example).

    I pulled the cfa coefficients from the psp_bios_prev_st_on_the_fly example.  I did notice that the cfa array length is specified as 760 in spru977, but the array used in the example is size 576.  Is this any issue?

    FYI, my bayer pattern is:

    R G

    G B

    Any ideas on how to get the chroma correct would be appreciated.

  • I tinkered with things and finally achieved a true color image result.

    First, I used the color space conversion settings from the ti example.

    I also changed the order of the cfa constants.  From spru977, I had assumed that the input bayer pattern was as above, with 0,0 being in the upper left.  Either this is incorrect, or the previewer example that I took the cfa constants from was inconsistent with the document.  Either way, I have my image now.

  • [0,0] is upper left.

    Please note that if your starting color is not same as the one in our reference, then the reference parameters don't work properly.

     

    regards,

    Sang-Yong