Blue spots

Hello, a customer is getting blue spots or tones in his image

using ADV7180 who is using YCbCr converter to RGB565. They think the data from the converter is ok but they are seeing some blue tones or dots in the screen, please see the attachment in red circles.

They would like our support, here is the configuration they are using:

 

CAMERA_IO_Write(DeviceAddr,   INPUT_CONTROL,          BYTE(0x04));   /* '04' select ain 3, autodetect composite standart*/

  CAMERA_IO_Write(DeviceAddr,   VIDEO_SELECTION,      BYTE(0xCC));   /* '04' select ain 3, autodetect composite standart*/

  CAMERA_IO_Write(DeviceAddr,   VS_FIELD_CTL_1,       BYTE(0x12));   /* '12'  *******default*/

  CAMERA_IO_Write(DeviceAddr,   VS_FIELD_CTL_2,       BYTE(0xC1)); /* 'C1' default*/

  CAMERA_IO_Write(DeviceAddr,   VS_FIELD_CTL_3,       BYTE(0xC0)); /* 'C0' default*/

  CAMERA_IO_Write(DeviceAddr,   NTSC_VBIT_BEGIN,      BYTE(0x20));   /* '20' 25 default*/

  CAMERA_IO_Write(DeviceAddr,   NTSC_VBIT_END,        BYTE(0xC0)); /* 04 default 41 */

  CAMERA_IO_Write(DeviceAddr,   NTSC_VBIT_TOGGLE,     BYTE(0x00));   /* 63 default 84*/

  CAMERA_IO_Write(DeviceAddr,   POLARITY,             BYTE(0x01));   /*default*/

  CAMERA_IO_Write(DeviceAddr,   VS_FIELD_PIN_CTL,     BYTE(0x05));   /*default*/    //0 for field 0x01 for vsync

  CAMERA_IO_Write(DeviceAddr,   LOCK_COUNT,           BYTE(0xF6));

  CAMERA_IO_Write(DeviceAddr,   MANDATE_ONE,          BYTE(0x80));

  CAMERA_IO_Write(DeviceAddr,   MANDATE_TWO,          BYTE(0x81));

  CAMERA_IO_Write(DeviceAddr,   MANDATE_ONE,          BYTE(0x00));

  CAMERA_IO_Write(DeviceAddr,   MANDATE_THREE,        BYTE(0x0D));

  CAMERA_IO_Write(DeviceAddr,   BRIGHTNESS,           BYTE(0xFF));

 

 

#define YCbCr2R(Y, Cb, Cr)  clamp((1.1644*(Y)) + (1.5961*(Cr)) - (222.9210)) #define YCbCr2G(Y, Cb, Cr)  clamp((1.1644*(Y)) - (0.8129*(Cr)) - (0.3913*(Cb)) + (135.6050)) #define YCbCr2B(Y, Cb, Cr)  clamp((1.1644*(Y)) + (2.0173*(Cb)) - (276.8360))

 

inline uint16_t YCbCrToRGB565(uint8_t y, uint8_t Cb, uint8_t Cr) {

     uint16_t res = 0x0000;

     volatile uint16_t r = (YCbCr2R(y,Cb,Cr));

     volatile uint16_t g = (YCbCr2G(y,Cb,Cr));

     volatile uint16_t b = (YCbCr2B(y,Cb,Cr));

 

     r&=0x00F8;

     r=(r>>3);

     g&=0x00FC;

     g=(g>>2);

     b&=0x00F8;

     b=(b>>3);

    res = (b | (g << 5) | (r << 11));

     return res;

}

 

Best regards,

Gustavo Garcia

FSE