Commit 2080e015 authored by michael's avatar michael

rgb24toyv12 bugfix


git-svn-id: file:///var/local/repositories/mplayer/trunk/postproc@3634 b3059339-0415-0410-9bf9-f77b7e298cf2
parent 943542bd
...@@ -30,6 +30,9 @@ extern void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t * ...@@ -30,6 +30,9 @@ extern void yv12toyuy2(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *
extern void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, extern void yuy2toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
unsigned int width, unsigned int height, unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int srcStride); unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
extern void rgb24toyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
unsigned int width, unsigned int height,
unsigned int lumStride, unsigned int chromStride, unsigned int srcStride);
#define MODE_RGB 0x1 #define MODE_RGB 0x1
#define MODE_BGR 0x2 #define MODE_BGR 0x2
......
...@@ -916,9 +916,9 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ ...@@ -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 g= src[6*i+1];
unsigned int r= src[6*i+2]; 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;
unsigned int V = RV*r + GV*g + BV*b + 128; unsigned int V = ((RV*r + GV*g + BV*b)>>RGB2YUV_SHIFT) + 128;
unsigned int U = RU*r + GU*g + BU*b + 128; unsigned int U = ((RU*r + GU*g + BU*b)>>RGB2YUV_SHIFT) + 128;
udst[i] = U; udst[i] = U;
vdst[i] = V; vdst[i] = V;
...@@ -928,7 +928,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ ...@@ -928,7 +928,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
g= src[6*i+4]; g= src[6*i+4];
r= src[6*i+5]; 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[2*i+1] = Y;
} }
ydst += lumStride; ydst += lumStride;
...@@ -940,7 +940,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ ...@@ -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 g= src[6*i+1];
unsigned int r= src[6*i+2]; 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; ydst[2*i] = Y;
...@@ -948,7 +948,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ ...@@ -948,7 +948,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
g= src[6*i+4]; g= src[6*i+4];
r= src[6*i+5]; 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[2*i+1] = Y;
} }
udst += chromStride; udst += chromStride;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment