summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2016-07-22 16:01:09 -0700
committerJames Zern <jzern@google.com>2016-07-22 16:01:52 -0700
commitb2542417cd4dc81c49faa242c3bfdacab853ba6c (patch)
tree48e2f5ef66a0290e3e37acef1a3f5890efbb7c15
parent5e2791b54da066cc8543c066813373c9274ff53f (diff)
downloadlibvpx-b2542417cd4dc81c49faa242c3bfdacab853ba6c.tar
libvpx-b2542417cd4dc81c49faa242c3bfdacab853ba6c.tar.gz
libvpx-b2542417cd4dc81c49faa242c3bfdacab853ba6c.tar.bz2
libvpx-b2542417cd4dc81c49faa242c3bfdacab853ba6c.zip
vp8/postproc: fix implicit float conversion
float->int as reported by -Wfloat-conversion Change-Id: I0089e8847b218c47526bcfbb0fffd9aad7c5adb3
-rw-r--r--vp8/common/postproc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c
index 3a3b334a5..b0e89eeca 100644
--- a/vp8/common/postproc.c
+++ b/vp8/common/postproc.c
@@ -24,13 +24,16 @@
#include <stdlib.h>
#include <stdio.h>
-#define RGB_TO_YUV(t) \
- ((0.257 * (float)(t >> 16)) + (0.504 * (float)(t >> 8 & 0xff)) + \
- (0.098 * (float)(t & 0xff)) + 16), \
- (-(0.148 * (float)(t >> 16)) - (0.291 * (float)(t >> 8 & 0xff)) + \
- (0.439 * (float)(t & 0xff)) + 128), \
- ((0.439 * (float)(t >> 16)) - (0.368 * (float)(t >> 8 & 0xff)) - \
- (0.071 * (float)(t & 0xff)) + 128)
+#define RGB_TO_YUV(t) \
+ (unsigned char)((0.257 * (float)(t >> 16)) + \
+ (0.504 * (float)(t >> 8 & 0xff)) + \
+ (0.098 * (float)(t & 0xff)) + 16), \
+ (unsigned char)(-(0.148 * (float)(t >> 16)) - \
+ (0.291 * (float)(t >> 8 & 0xff)) + \
+ (0.439 * (float)(t & 0xff)) + 128), \
+ (unsigned char)((0.439 * (float)(t >> 16)) - \
+ (0.368 * (float)(t >> 8 & 0xff)) - \
+ (0.071 * (float)(t & 0xff)) + 128)
/* global constants */
#if CONFIG_POSTPROC_VISUALIZER