mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 01:06:46 +08:00
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
This commit is contained in:
parent
24152b2435
commit
1d87532f00
@ -185,7 +185,13 @@ static void YToRGB(int y, int* r, int* g, int* b) {
|
|||||||
|
|
||||||
static int RoundToByte(double f) {
|
static int RoundToByte(double f) {
|
||||||
int i = static_cast<int>(f + 0.5);
|
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) {
|
static void YUVToRGBReference(int y, int u, int v, int* r, int* g, int* b) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user