diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-07-18 00:09:09 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-07-18 00:09:09 +0000 |
commit | a1f3ffa3ce52d207bd5b8afddcd0ad56c56d8f3b (patch) | |
tree | 7420e7c9b20536d7b0189371479df0c1e172b578 /libswscale | |
parent | 96e8987e5bc98e27c8583b4db7e948e9654b2d95 (diff) | |
download | ffmpeg-a1f3ffa3ce52d207bd5b8afddcd0ad56c56d8f3b.tar.gz |
Make C code in yuv2yuv1() do accurate rounding, this could be split
depending on SWS_ACCURATE as well if someone wants.
Originally committed as revision 27323 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale_template.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 45cd491d53..1280ba6c02 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -1020,7 +1020,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr int i; for (i=0; i<dstW; i++) { - int val= lumSrc[i]>>7; + int val= (lumSrc[i]+64)>>7; if (val&256){ if (val<0) val=0; @@ -1033,8 +1033,8 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, int16_t *lumSrc, int16_t *chr if (uDest) for (i=0; i<chrDstW; i++) { - int u=chrSrc[i]>>7; - int v=chrSrc[i + VOFW]>>7; + int u=(chrSrc[i ]+64)>>7; + int v=(chrSrc[i + VOFW]+64)>>7; if ((u|v)&256){ if (u<0) u=0; |