summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xorg/server/module/rdpCapture.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/xorg/server/module/rdpCapture.c b/xorg/server/module/rdpCapture.c
index 69a5f147..72b95535 100644
--- a/xorg/server/module/rdpCapture.c
+++ b/xorg/server/module/rdpCapture.c
@@ -177,13 +177,14 @@ rdpCopyBox_a8r8g8b8_to_yuvalp(int ax, int ay,
y = (r * 19595 + g * 38470 + b * 7471) >> 16;
u = (r * -11071 + g * -21736 + b * 32807) >> 16;
v = (r * 32756 + g * -27429 + b * -5327) >> 16;
- y = y - 128;
- y = max(y, -128);
- u = max(u, -128);
- v = max(v, -128);
- y = min(y, 127);
- u = min(u, 127);
- v = min(v, 127);
+ u = u + 128;
+ v = v + 128;
+ y = max(y, 0);
+ u = max(u, 0);
+ v = max(v, 0);
+ y = min(y, 255);
+ u = min(u, 255);
+ v = min(v, 255);
*(yptr++) = y;
*(uptr++) = u;
*(vptr++) = v;