diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-02-14 19:34:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-02-14 21:33:30 +0100 |
commit | ef96bf294d8dd7064dbc01e81fc5dc9c9e7c6d86 (patch) | |
tree | 96c1b83d070076c9b45c6791da2fe930e53085b7 | |
parent | c0c32a3704128a5712f5ce8bcde01418d3d36ec8 (diff) | |
download | ffmpeg-ef96bf294d8dd7064dbc01e81fc5dc9c9e7c6d86.tar.gz |
swscale: Fix rounding in yuv2mono_1_c_template()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libswscale/output.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index 90e284e91f..658ee2c89f 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -378,14 +378,14 @@ yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0, int i; for (i = 0; i < dstW - 7; i += 8) { - int acc = g[(buf0[i ] >> 7) + d128[0]]; - acc += acc + g[(buf0[i + 1] >> 7) + d128[1]]; - acc += acc + g[(buf0[i + 2] >> 7) + d128[2]]; - acc += acc + g[(buf0[i + 3] >> 7) + d128[3]]; - acc += acc + g[(buf0[i + 4] >> 7) + d128[4]]; - acc += acc + g[(buf0[i + 5] >> 7) + d128[5]]; - acc += acc + g[(buf0[i + 6] >> 7) + d128[6]]; - acc += acc + g[(buf0[i + 7] >> 7) + d128[7]]; + int acc = g[((buf0[i ] + 64) >> 7) + d128[0]]; + acc += acc + g[((buf0[i + 1] + 64) >> 7) + d128[1]]; + acc += acc + g[((buf0[i + 2] + 64) >> 7) + d128[2]]; + acc += acc + g[((buf0[i + 3] + 64) >> 7) + d128[3]]; + acc += acc + g[((buf0[i + 4] + 64) >> 7) + d128[4]]; + acc += acc + g[((buf0[i + 5] + 64) >> 7) + d128[5]]; + acc += acc + g[((buf0[i + 6] + 64) >> 7) + d128[6]]; + acc += acc + g[((buf0[i + 7] + 64) >> 7) + d128[7]]; output_pixel(*dest++, acc); } } |