Add -128 into the YUV to RGB conversion macro

This commit is contained in:
jfmcarreira committed 2015-02-28 03:42:03 +00:00
1 parent f348ba03e9
commit 028bc21f05
1 file changed
+3 -3
+3 -3
View File
@@ -34,9 +34,9 @@ namespace plaYUVer
#define CLAMP(X) X = X < 0 ? 0 : X > 255 ? 255 : X;
#define YUV2RGB( iY, iU, iV, iR, iG, iB ) \
iR = iY + ( ( 1436 * iV ) >> 10 ); \
iG = iY - ( ( 352 * iU + 731 * iV ) >> 10 ); \
iB = iY + ( ( 1812 * iU ) >> 10 ); \
iR = iY + ( ( 1436 * ( iV - 128) ) >> 10 ); \
iG = iY - ( ( 352 * ( iU - 128 ) + 731 * ( iV - 128 ) ) >> 10 ); \
iB = iY + ( ( 1812 * ( iU - 128 ) ) >> 10 ); \
CLAMP(iR) CLAMP(iG) CLAMP(iB)
static inline Void rgbToYuv( Int iR, Int iG, Int iB, Int &iY, Int &iU, Int &iV )