Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

The Equation of YUV to RGB

egg126
Beginner
689 Views
Hi, all

What's the Equation of IPP to implement the YUV to RGB

ippiYUV420ToRGB_8u_P3C3(const Ipp8u* const pSrc[3], Ipp8u* pDst, IppiSize imgSize);

There are difference of my result with IPP. So I want to know what's the equation of IPP to implementation...

Thanks for your reply.
0 Kudos
4 Replies
pvonkaenel
New Contributor III
689 Views
Quoting - egg126
Hi, all

What's the Equation of IPP to implement the YUV to RGB

ippiYUV420ToRGB_8u_P3C3(const Ipp8u* const pSrc[3], Ipp8u* pDst, IppiSize imgSize);

There are difference of my result with IPP. So I want to know what's the equation of IPP to implementation...

Thanks for your reply.

I don't know how the internals are implemented, but if you're getting different results then you might not be using the correct conversion routine. Are you sure you have a YUV source and not a YCbCr source? If you're working with video then it's probably YCbCr.

Peter
0 Kudos
egg126
Beginner
689 Views
Quoting - pvonkaenel

I don't know how the internals are implemented, but if you're getting different results then you might not be using the correct conversion routine. Are you sure you have a YUV source and not a YCbCr source? If you're working with video then it's probably YCbCr.

Peter

Yes, that's YUV Source, and the I find in ippiman, the Equation is:
R' = Y' + 1.140*V'
G' = Y' - 0.394*U' - 0.581*V'
B' = Y' + 2.032*U'

But my result is different, so I want to know How IPP implement this Equation in Integer Operation.

Also, I find the YCbCr to RGB is available. That's ippiYCbCrToRGB_8u_C3R
And the Equation is:

R' = 1.164*(Y' - 16) + 1.596*(Cr' - 128)
G' = 1.164*(Y' - 16) - 0.813*(Cr' - 128) - 0.392*(Cb' - 128)
B' = 1.164*(Y' - 16) + 2.017*(Cb' - 128)

And, at present, I want to know How to implement them(YUV2RGB, YCbCr2RGB) in Integer Operation.

Thanks very much...
0 Kudos
egg126
Beginner
689 Views
Is there anybody know how to optimization this equation in Integer Operation.

R' = Y' + 1.140*V'
G' = Y' - 0.394*U' - 0.581*V'
B' = Y' + 2.032*U'

and

R' = 1.164*(Y' - 16) + 1.596*(Cr' - 128)
G' = 1.164*(Y' - 16) - 0.813*(Cr' - 128) - 0.392*(Cb' - 128)
B' = 1.164*(Y' - 16) + 2.017*(Cb' - 128)


And Iuse floating point operation, but the result is different with IPP, the gap is just 1, therefore, I think this is round error, however, I don't know, How IPP round this equation?

Thanks very much.
0 Kudos
Vladimir_Dudnik
Employee
689 Views
IPP use SSE optimized fixed point calculations in YUVToRGB conversion for 8-bit input and output data. This is much faster comparing with SSE floating point calculations (which will require integer to float and back conversion) but introduce rounding error.

Regards,
Vladimir

0 Kudos
Reply