Mercurial > mplayer.hg
comparison postproc/rgb2rgb_template.c @ 6484:c5cf988c6d6f
pre-yvu9toyv12 converter, only grayscale Y-plane coping :)
author | alex |
---|---|
date | Fri, 21 Jun 2002 17:37:00 +0000 |
parents | f38c7228a094 |
children | e7635c03910f |
comparison
equal
deleted
inserted
replaced
6483:2dd9691fe6b8 | 6484:c5cf988c6d6f |
---|---|
240 d1[i] = (x&0x7FFF7FFF) + (x&0x7FE07FE0); | 240 d1[i] = (x&0x7FFF7FFF) + (x&0x7FE07FE0); |
241 | 241 |
242 } | 242 } |
243 #endif | 243 #endif |
244 #endif | 244 #endif |
245 } | |
246 | |
247 static inline void RENAME(bgr24torgb24)(const uint8_t *src, uint8_t *dst, unsigned src_size) | |
248 { | |
249 unsigned j,i,num_pixels=src_size/3; | |
250 for(i=0,j=0; j<num_pixels; i+=3,j+=3) | |
251 { | |
252 dst[j+0] = src[i+2]; | |
253 dst[j+1] = src[i+1]; | |
254 dst[j+2] = src[i+0]; | |
255 } | |
245 } | 256 } |
246 | 257 |
247 static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, unsigned src_size) | 258 static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, unsigned src_size) |
248 { | 259 { |
249 #ifdef HAVE_MMX | 260 #ifdef HAVE_MMX |
851 SFENCE" \n\t" | 862 SFENCE" \n\t" |
852 :::"memory"); | 863 :::"memory"); |
853 #endif | 864 #endif |
854 } | 865 } |
855 | 866 |
867 static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, | |
868 uint8_t *ydst, uint8_t *udst, uint8_t *vdst, | |
869 unsigned int width, unsigned int height, unsigned int lumStride, unsigned int chromStride) | |
870 { | |
871 /* Y Plane */ | |
872 memcpy(ydst, ysrc, width*height); | |
873 | |
874 /* XXX: implement upscaling for U,V */ | |
875 } | |
876 | |
856 /** | 877 /** |
857 * | 878 * |
858 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a | 879 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a |
859 * problem for anyone then tell me, and ill fix it) | 880 * problem for anyone then tell me, and ill fix it) |
860 * chrominance data is only taken from every secound line others are ignored FIXME write HQ version | 881 * chrominance data is only taken from every secound line others are ignored FIXME write HQ version |