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.

dm368 VPFE YCbCr capture - how to remove an offset for Cb and Cr?

Hello,

I'm trying to do a video capture on EVMDM368 board from AcuteLogic PE1005S camera.
Camera inputs are connected to imager interface.

I would like to use existing streaming application. 
I made custom driver, which simply sets CPLD to use imager as input (CPLD register 3), 
set if_type = INTERFACE_TYPE_YCBCR_SYNC_16 of struct decoder_device, report std id=V4L2_STD_720P_60
Camera output set to 720P 60 as well. 
I'm getting picture, luma seems correct, but colors are wrong and "too green".
Seem like byte order is ok - setting ISIF.CCDCFG.YCINSWP to 1 adds vertical stripes as expected.

 
camera data sheet says:
----------------------------------------------------------------------------------------
3.5.1 Image data output format
16bit bus is used to provide YPbPr 4:2:2 formatted image data multiplexed as follows.

YC[15:8] Pb0 Pr0 Pb1
YC[7:0] Y0 Y1 Y2

Color cording is based on SMPTE 274M however, color difference data set to center (offset +128).
Y = 0.2126R’+0.7152G’+0.0722B’
Pb = 0.500B’- 0.1146R’- 0.3854G’ + 128
Pr = 0.500R’- 0.4542G’- 0.0458B’ + 128
R’,G’,B’ shows the original signals of non-linear domain after gamma correction.
----------------------------------------------------------------------------------------

Camera documentation uses strange terminology for many parts, so I could "translate" it to the following:
Camera output format is 16 bit YCbCr 4:2:2, byte order is YUYV, color differences have an offset 128.

Seem like in my case I have unwanted offsets in color differences present. How How can I get rid of this offset?

Thank you,
Leonid