Mercurial > mplayer.hg
comparison postproc/rgb2rgb_template.c @ 2801:318c240363c7
uyvy->uv12 added
author | arpi |
---|---|
date | Sat, 10 Nov 2001 23:28:10 +0000 |
parents | 7847d6b7ad3d |
children | cbb62e07bc0e |
comparison
equal
deleted
inserted
replaced
2800:7847d6b7ad3d | 2801:318c240363c7 |
---|---|
811 asm( EMMS" \n\t" | 811 asm( EMMS" \n\t" |
812 SFENCE" \n\t" | 812 SFENCE" \n\t" |
813 :::"memory"); | 813 :::"memory"); |
814 #endif | 814 #endif |
815 } | 815 } |
816 | |
817 /** | |
818 * | |
819 * height should be a multiple of 2 and width should be a multiple of 16 (if this is a | |
820 * problem for anyone then tell me, and ill fix it) | |
821 */ | |
822 void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, | |
823 unsigned int width, unsigned int height, | |
824 unsigned int lumStride, unsigned int chromStride, unsigned int srcStride) | |
825 { | |
826 int y; | |
827 const int chromWidth= width>>1; | |
828 for(y=0; y<height; y+=2) | |
829 { | |
830 int i; | |
831 for(i=0; i<chromWidth; i++) | |
832 { | |
833 udst[i] = src[4*i+0]; | |
834 ydst[2*i+0] = src[4*i+1]; | |
835 vdst[i] = src[4*i+2]; | |
836 ydst[2*i+1] = src[4*i+3]; | |
837 } | |
838 ydst += lumStride; | |
839 src += srcStride; | |
840 | |
841 for(i=0; i<chromWidth; i++) | |
842 { | |
843 ydst[2*i+0] = src[4*i+1]; | |
844 ydst[2*i+1] = src[4*i+3]; | |
845 } | |
846 udst += chromStride; | |
847 vdst += chromStride; | |
848 ydst += lumStride; | |
849 src += srcStride; | |
850 } | |
851 } | |
852 | |
853 |