#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