Add -128 into the YUV to RGB conversion macro
This commit is contained in:
1 parent
f348ba03e9
commit
028bc21f05
1 file changed
+3
-3
@@ -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 )
|
||||
|
||||
Reference in new issue
Block a user