diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-25 20:49:52 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2011-05-26 00:56:06 +0200 |
commit | 7dc303a60ef7205d88a11ddbcb251f3237a3945e (patch) | |
tree | 0f3e736869148829aed51852766a949d2e26ca75 /libswscale/x86/rgb2rgb_template.c | |
parent | 8c51620f219db0f408d2833c3e5d56cedaf0d95a (diff) | |
download | ffmpeg-7dc303a60ef7205d88a11ddbcb251f3237a3945e.tar.gz |
swscale: Eliminate rgb24toyv12_c() duplication.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libswscale/x86/rgb2rgb_template.c')
-rw-r--r-- | libswscale/x86/rgb2rgb_template.c | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c index a083fc8674..ce635dfde4 100644 --- a/libswscale/x86/rgb2rgb_template.c +++ b/libswscale/x86/rgb2rgb_template.c @@ -1976,52 +1976,7 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ SFENCE" \n\t" :::"memory"); - for (; y<height; y+=2) { - long i; - for (i=0; i<chromWidth; i++) { - unsigned int b = src[6*i+0]; - unsigned int g = src[6*i+1]; - unsigned int r = src[6*i+2]; - - 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; - ydst[2*i] = Y; - - b = src[6*i+3]; - g = src[6*i+4]; - r = src[6*i+5]; - - Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16; - ydst[2*i+1] = Y; - } - ydst += lumStride; - src += srcStride; - - for (i=0; i<chromWidth; i++) { - unsigned int b = src[6*i+0]; - unsigned int g = src[6*i+1]; - unsigned int r = src[6*i+2]; - - unsigned int Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16; - - ydst[2*i] = Y; - - b = src[6*i+3]; - g = src[6*i+4]; - r = src[6*i+5]; - - Y = ((RY*r + GY*g + BY*b)>>RGB2YUV_SHIFT) + 16; - ydst[2*i+1] = Y; - } - udst += chromStride; - vdst += chromStride; - ydst += lumStride; - src += srcStride; - } + rgb24toyv12_c(src, ydst, udst, vdst, width, height-y, lumStride, chromStride, srcStride); } static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest, |