Commit 1d87532f authored by fbarchard@google.com's avatar fbarchard@google.com

Make color_test using if statements for clamping values from 0 to 255.

BUG=none
TESTED=libyuvTest.TestFullYUV

Review URL: https://webrtc-codereview.appspot.com/47479004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1316 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 24152b24
......@@ -185,7 +185,13 @@ static void YToRGB(int y, int* r, int* g, int* b) {
static int RoundToByte(double f) {
int i = static_cast<int>(f + 0.5);
return (i & ~0xff) ? (int)(((int32)(-i) >> 31) & 0xff) : i;
if (i < 0) {
i = 0;
}
if (i > 255) {
i = 255;
}
return i;
}
static void YUVToRGBReference(int y, int u, int v, int* r, int* g, int* b) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment