summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-24 12:46:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-24 13:32:53 +0200
commit0c3b4efc76a84e1dc79f21e860db7d16681ccbbc (patch)
tree9c4f2c51266ed3aaaef69a52e584613b35b306a7 /libavformat
parent28134d6a0e1462c7bc6807284738ed552ef6d2a5 (diff)
downloadffmpeg-streaming-0c3b4efc76a84e1dc79f21e860db7d16681ccbbc.zip
ffmpeg-streaming-0c3b4efc76a84e1dc79f21e860db7d16681ccbbc.tar.gz
avformat/movenc: Remove float use from rgb_to_yuv()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 9cad1ae..dc9570b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4877,9 +4877,9 @@ static uint32_t rgb_to_yuv(uint32_t rgb)
g = (rgb >> 8) & 0xFF;
b = (rgb ) & 0xFF;
- y = av_clip_uint8( 16. + 0.257 * r + 0.504 * g + 0.098 * b);
- cb = av_clip_uint8(128. - 0.148 * r - 0.291 * g + 0.439 * b);
- cr = av_clip_uint8(128. + 0.439 * r - 0.368 * g - 0.071 * b);
+ y = av_clip_uint8(( 16000 + 257 * r + 504 * g + 98 * b)/1000);
+ cb = av_clip_uint8((128000 - 148 * r - 291 * g + 439 * b)/1000);
+ cr = av_clip_uint8((128000 + 439 * r - 368 * g - 71 * b)/1000);
return (y << 16) | (cr << 8) | cb;
}
OpenPOWER on IntegriCloud