diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-09-10 16:39:56 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-09-10 16:39:56 +0000 |
commit | 6b79dbce0c7529199ce1c6cc7d552d43146362cc (patch) | |
tree | 0a35510d19fa63d5bf2feb1c836c05383acb6006 /libswscale | |
parent | ba83d862993188862c38c7c9790f574e7b0f2b25 (diff) | |
download | ffmpeg-6b79dbce0c7529199ce1c6cc7d552d43146362cc.tar.gz |
Change RGB2YUV_SHIFT from 16 to 15 to make it able to work
with 16bit signed constants (like SIMD might use).
Originally committed as revision 27568 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 2 | ||||
-rw-r--r-- | libswscale/swscale_template.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 72ba001d50..52d235960b 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -152,7 +152,7 @@ unsigned swscale_version(void) || isBGR(x) \ ) -#define RGB2YUV_SHIFT 16 +#define RGB2YUV_SHIFT 15 #define BY ((int)( 0.098*(1<<RGB2YUV_SHIFT)+0.5)) #define BV ((int)(-0.071*(1<<RGB2YUV_SHIFT)+0.5)) #define BU ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5)) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index f969fc6cb2..ea111418ff 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -1891,10 +1891,8 @@ static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, uint8_t * \ g>>=shg;\ \ - dstU[i]= (((RU)>>1)*r + ((GU)>>1)*g + ((BU)>>1)*b + (257<<((S)-1)))>>(S);\ - dstV[i]= (((RV)>>1)*r + ((GV)>>1)*g + ((BV)>>1)*b + (257<<((S)-1)))>>(S);\ -/* dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<(S)))>>((S)+1);\ - dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<(S)))>>((S)+1);*/\ + dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<(S)))>>((S)+1);\ + dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<(S)))>>((S)+1);\ }\ } |