Hi,

If you are you somewhere in DM355 video line I'm not sure how you could use 3 
byte YUV.
Usually the YUV dump will be as UYVY - 32 bytes for 2 pixels which could be 
converted to 48 bytes for 2 pixels if you are converting it to RGB-24Bit.
Or were using a customized 3byte YUV?

Best Regards,
Deepak Shankar V
________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of 
Ondrej Pindroch
Sent: Tuesday, June 02, 2009 5:32 PM
To: davinci-linux-open-source
Subject: Problem to convert YUV to RGB

Hi
I need to produce BMP image as output from previewer. It is all fine except 
converting YUV to RGB.
I have made function which take 3 bytes YUV data and stores 3bytes RGB. I need 
to do it in fixed point arithmetic.
Below is my code of this function. I have no idea what is wrong.

int convertYUVtoRGB (struct RGBhodnoty *RGBvals,struct YUVhodnoty *YUVvals)
{
    short Yshort,Ushort,Vshort;
    Yshort = (short)YUVvals->val_Y;
    if (YUVvals->val_U > 127) Ushort = (short)YUVvals->val_U - 256;
    else Ushort = (short)YUVvals->val_U;
    if (YUVvals->val_V > 127) Vshort = (short)YUVvals->val_V - 256;
    else Vshort = (short)YUVvals->val_V;

    RGBvals->val_R = (char) (((298*(Yshort-16) + 409*(Vshort)  + 128)>>8) & 
0xFF);
    RGBvals->val_G = (char) (((298*(Yshort-16) - 100*(Ushort) - 208*(Vshort) + 
128) >>8) & 0xFF);
    RGBvals->val_B = (char) (((298*(Yshort-16) + 516*(Ushort)  + 128)>>8) & 
0xFF);
    return 0;
}

Please help!

Ondrej Pindroch
SoftHard Technology ltd.


DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have 
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to