Mercurial > mplayer.hg
changeset 27530:dbdc77f8b041
More accurate rounding for 8bit inputs.
author | michael |
---|---|
date | Tue, 09 Sep 2008 23:39:32 +0000 |
parents | ffb573fae5e8 |
children | 905724de832e |
files | libswscale/swscale.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libswscale/swscale.c Tue Sep 09 23:30:06 2008 +0000 +++ b/libswscale/swscale.c Tue Sep 09 23:39:32 2008 +0000 @@ -2671,9 +2671,9 @@ g= ((i>>1)&3)*85; r= (i&1 )*255; } - y= av_clip_uint8(((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16 ); - u= av_clip_uint8(((RU*r + GU*g + BU*b)>>RGB2YUV_SHIFT) + 128); - v= av_clip_uint8(((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128); + y= av_clip_uint8((RY*r + GY*g + BY*b + ( 33<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT); + u= av_clip_uint8((RU*r + GU*g + BU*b + (257<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT); + v= av_clip_uint8((RV*r + GV*g + BV*b + (257<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT); pal[i]= y + (u<<8) + (v<<16); } src2[1]= (uint8_t*)pal;