vp8/postproc: fix implicit float conversion

float->int as reported by -Wfloat-conversion

Change-Id: I0089e8847b218c47526bcfbb0fffd9aad7c5adb3
This commit is contained in:
James Zern 2016-07-22 16:01:09 -07:00
parent 5e2791b54d
commit b2542417cd

View File

@ -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