Hi 

I have been looking at go's implementation YCbCr to RGB conversion and 
there are a few details that are not clear to me.

The implementation follows the JFIF spec
 
// The JFIF specification says:
// R = Y' + 1.40200*(Cr-128)
// G = Y' - 0.34414*(Cb-128) - 0.71414*(Cr-128)
// B = Y' + 1.77200*(Cb-128)
// http://www.w3.org/Graphics/JPEG/jfif3.pdf says Y but means Y'.

It seems that all constants above are multiplied by 2^16 to allow the 
calculation to be performed with integer arithmetic, before being shifted 
back into an 8 bit range. But Y' is multiplied by  0x010100 which is 
equivalent to Y' * 2^16 + Y' * 2^8. I can't see why Y' in this case is 
scaled differently to the other components of the equation.


If anyone could shed some light, it would be greatly appreciated.

Thanks

Piers

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to