DM6437 Previewer YUV422 Conversion Issue


I am using the DM6437 Previewer module to convert on the fly a RAW image to YUV422. The input RAW image from the video port is 8-bits wide (PCR.width = 8 bits). I tried using the parameters provided with the PSP Previewer sample application, which look like this for the major ones:

  PrevParams->features = (PSP_PREVIEWER_CFA);
  PrevParams->sizeParam.pixelSize = PSP_PREVIEWER_INWIDTH_8BIT;
  PrevParams->rgbBlendingParam.blending[0][0] = 0x1A1;
  PrevParams->rgbBlendingParam.blending[0][1] = 0xF8A;
  PrevParams->rgbBlendingParam.blending[0][2] = 0xFD5;
  PrevParams->rgbBlendingParam.blending[1][0] = 0xFA1;
  PrevParams->rgbBlendingParam.blending[1][1] = 0x1C4;
  PrevParams->rgbBlendingParam.blending[1][2] = 0xF9B;
  PrevParams->rgbBlendingParam.blending[2][0] = 0xFBD;
  PrevParams->rgbBlendingParam.blending[2][1] = 0xFB1;
  PrevParams->rgbBlendingParam.blending[2][2] = 0x192;
  PrevParams->rgbBlendingParam.offset[0]      = 0;
  PrevParams->rgbBlendingParam.offset[1]      = 0;
  PrevParams->rgbBlendingParam.offset[2]      = 0;
  PrevParams->rgb2ycbcrParam.coeff[0][0] = 0x04C;
  PrevParams->rgb2ycbcrParam.coeff[0][1] = 0x096;
  PrevParams->rgb2ycbcrParam.coeff[0][2] = 0x01D;
  PrevParams->rgb2ycbcrParam.coeff[1][0] = 0x3D4;
  PrevParams->rgb2ycbcrParam.coeff[1][1] = 0x3AC;
  PrevParams->rgb2ycbcrParam.coeff[1][2] = 0x082;
  PrevParams->rgb2ycbcrParam.coeff[2][0] = 0x082;
  PrevParams->rgb2ycbcrParam.coeff[2][1] = 0x395;
  PrevParams->rgb2ycbcrParam.coeff[2][2] = 0x3EB;
  PrevParams->rgb2ycbcrParam.coeff[0][0] = 0x100;
  PrevParams->rgb2ycbcrParam.coeff[0][1] = 0x00;
  PrevParams->rgb2ycbcrParam.coeff[0][2] = 0x0;
  PrevParams->rgb2ycbcrParam.yOffset     = 0;
  PrevParams->rgb2ycbcrParam.cbOffset    = 0;
  PrevParams->rgb2ycbcrParam.crOffset    = 0;
  PrevParams->contrast   = 0x10;
  PrevParams->brightness = 0x20;

When using these params, I get an output image that is correct, but the Y component tops at around 159 instead of 255 even with a saturated input image (all pixels at 255). If I remove the brightness offset (PrevParams->brightness = 0), the Y component tops at 127.

Here are some observations:

- I could validate that the video port actually sends saturated 255 RGB values since I am also using the H3A module connected on the video port which shows that pixels are at 255.

- I tried to configure the Previewer with very basic parameters that would just copy a single pixel intensity in Y:
  1- CFA disabled which causes missing RGB components to take the same value as the known component
  2- Identity RGB blending matrix to remove any gain on RGB components
  3- RGB to YCbCr matrix filled with zeros except for the rgb2ycbcrParam.coeff[0][0] which gives a gain of 1 (0x100).
  Even with all these params that should only copy a single pixel intensity in Y, there is a /2 factor in the output (max Y is 127).

Accordingly to the VPFE user guide, I can't explain where this /2 division appears. Would anybody have a clue for helping me identifying the source of this problem?



1 Reply