diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-04-13 02:21:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-04-13 02:21:12 +0000 |
commit | b1ec5875a63d5cf61629ff69fb337c6d96e7b964 (patch) | |
tree | e0833e6b05c1dbcd15ead4f768153b1b47b94241 /postproc/rgb2rgb_template.c | |
parent | 74d3583521de27a6c6018a647362a1974f3e2b58 (diff) | |
download | ffmpeg-b1ec5875a63d5cf61629ff69fb337c6d96e7b964.tar.gz |
yuv422p -> yuy2 (untested)
Originally committed as revision 5589 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc/rgb2rgb_template.c')
-rw-r--r-- | postproc/rgb2rgb_template.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c index 87493ebc1c..5c3a4e88d9 100644 --- a/postproc/rgb2rgb_template.c +++ b/postproc/rgb2rgb_template.c @@ -638,14 +638,9 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, unsign } } -/** - * - * height should be a multiple of 2 and width should be a multiple of 16 (if this is a - * problem for anyone then tell me, and ill fix it) - */ -static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, +static inline void RENAME(yuvPlanartoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, unsigned int width, unsigned int height, - unsigned int lumStride, unsigned int chromStride, unsigned int dstStride) + unsigned int lumStride, unsigned int chromStride, unsigned int dstStride, int vertLumPerChroma) { int y; const int chromWidth= width>>1; @@ -696,7 +691,7 @@ static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, dst[4*i+3] = vsrc[i]; } #endif - if(y&1) + if((y&(vertLumPerChroma-1))==(vertLumPerChroma-1) ) { usrc += chromStride; vsrc += chromStride; @@ -716,6 +711,30 @@ asm( EMMS" \n\t" * height should be a multiple of 2 and width should be a multiple of 16 (if this is a * problem for anyone then tell me, and ill fix it) */ +static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int dstStride) +{ + //FIXME interpolate chroma + RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 2); +} + +/** + * + * width should be a multiple of 16 + */ +static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + unsigned int width, unsigned int height, + unsigned int lumStride, unsigned int chromStride, unsigned int dstStride) +{ + RENAME(yuvPlanartoyuy2)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStride, 1); +} + +/** + * + * height should be a multiple of 2 and width should be a multiple of 16 (if this is a + * problem for anyone then tell me, and ill fix it) + */ static inline void RENAME(yuy2toyv12)(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) |