summaryrefslogtreecommitdiff
path: root/postproc/rgb2rgb_template.c
diff options
context:
space:
mode:
authorArpi <arpi@thot.banki.hu>2001-11-10 23:28:10 +0000
committerArpi <arpi@thot.banki.hu>2001-11-10 23:28:10 +0000
commit81c0590e6c88b6c0752e52ef77e003cef3eaadf5 (patch)
tree11be4e9f26861b74adac1f121483cba251c3c3c1 /postproc/rgb2rgb_template.c
parentcff6ecd7e07f66e91aa61dd55932e0b4a44d1a3a (diff)
uyvy->uv12 added
Originally committed as revision 2802 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
Diffstat (limited to 'postproc/rgb2rgb_template.c')
-rw-r--r--postproc/rgb2rgb_template.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/postproc/rgb2rgb_template.c b/postproc/rgb2rgb_template.c
index 67f33de38b..2157de908f 100644
--- a/postproc/rgb2rgb_template.c
+++ b/postproc/rgb2rgb_template.c
@@ -813,3 +813,41 @@ asm( EMMS" \n\t"
:::"memory");
#endif
}
+
+/**
+ *
+ * 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)
+ */
+void uyvytoyv12(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)
+{
+ int y;
+ const int chromWidth= width>>1;
+ for(y=0; y<height; y+=2)
+ {
+ int i;
+ for(i=0; i<chromWidth; i++)
+ {
+ udst[i] = src[4*i+0];
+ ydst[2*i+0] = src[4*i+1];
+ vdst[i] = src[4*i+2];
+ ydst[2*i+1] = src[4*i+3];
+ }
+ ydst += lumStride;
+ src += srcStride;
+
+ for(i=0; i<chromWidth; i++)
+ {
+ ydst[2*i+0] = src[4*i+1];
+ ydst[2*i+1] = src[4*i+3];
+ }
+ udst += chromStride;
+ vdst += chromStride;
+ ydst += lumStride;
+ src += srcStride;
+ }
+}
+
+