diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-22 02:47:32 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-22 16:49:53 +0200 |
commit | 4fced11df73fb1921f60660b5b0f319bb4e723ec (patch) | |
tree | 32034cff84bdd38de6a60b5e063670bfdcd8f95a /libavcodec/utvideoenc.c | |
parent | 36999606902ce5c53636552ec46df5a38fd3bd6b (diff) | |
download | ffmpeg-streaming-4fced11df73fb1921f60660b5b0f319bb4e723ec.zip ffmpeg-streaming-4fced11df73fb1921f60660b5b0f319bb4e723ec.tar.gz |
utvideoenc: optimize and simplify mangle_rgb_planes
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utvideoenc.c')
-rw-r--r-- | libavcodec/utvideoenc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index f3ba739..95205ea 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -196,16 +196,13 @@ static void mangle_rgb_planes(uint8_t *src, int step, int stride, int width, int height) { int i, j; - uint8_t r, g, b; + unsigned g; for (j = 0; j < height; j++) { for (i = 0; i < width * step; i += step) { - r = src[i]; - g = src[i + 1]; - b = src[i + 2]; - - src[i] = r - g + 0x80; - src[i + 2] = b - g + 0x80; + g = src[i + 1] + 0x80; + src[i] -= g; + src[i + 2] -= g; } src += stride; } |