summaryrefslogtreecommitdiff
path: root/postproc/rgb2rgb_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2001-12-20 17:30:59 +0000
committerMichael Niedermayer <michaelni@gmx.at>2001-12-20 17:30:59 +0000
commitaa21f0c389d739f613d56c389e7ffe6b2dac6829 (patch)
tree8550938ebe032a1623ff51dffadabb84727e67de /postproc/rgb2rgb_template.c
parent393fe8dd8ee2bd70f509587f3d212c2dd183837e (diff)
rgb24toyv12 bugfix
Originally committed as revision 3634 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc/rgb2rgb_template.c')
-rw-r--r--postproc/rgb2rgb_template.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c
index ff3ee83b44..ac6e237c17 100644
--- a/postproc/rgb2rgb_template.c
+++ b/postproc/rgb2rgb_template.c
@@ -916,9 +916,9 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
unsigned int g= src[6*i+1];
unsigned int r= src[6*i+2];
- unsigned int Y = RY*r + GY*g + BY*b + 16;
- unsigned int V = RV*r + GV*g + BV*b + 128;
- unsigned int U = RU*r + GU*g + BU*b + 128;
+ unsigned int Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
+ unsigned int V = ((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128;
+ unsigned int U = ((RU*r + GU*g + BU*b)>>RGB2YUV_SHIFT) + 128;
udst[i] = U;
vdst[i] = V;
@@ -928,7 +928,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
g= src[6*i+4];
r= src[6*i+5];
- Y = RY*r + GY*g + BY*b + 16;
+ Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
ydst[2*i+1] = Y;
}
ydst += lumStride;
@@ -940,7 +940,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
unsigned int g= src[6*i+1];
unsigned int r= src[6*i+2];
- unsigned int Y = RY*r + GY*g + BY*b + 16;
+ unsigned int Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
ydst[2*i] = Y;
@@ -948,7 +948,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
g= src[6*i+4];
r= src[6*i+5];
- Y = RY*r + GY*g + BY*b + 16;
+ Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16;
ydst[2*i+1] = Y;
}
udst += chromStride;