changeset 2801:318c240363c7

uyvy->uv12 added
author arpi
date Sat, 10 Nov 2001 23:28:10 +0000
parents 7847d6b7ad3d
children 09d5c9834580
files postproc/rgb2rgb.c postproc/rgb2rgb_template.c
diffstat 2 files changed, 76 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/rgb2rgb.c	Sat Nov 10 20:39:23 2001 +0000
+++ b/postproc/rgb2rgb.c	Sat Nov 10 23:28:10 2001 +0000
@@ -813,3 +813,41 @@
         :::"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;
+	}
+}
+
+
--- a/postproc/rgb2rgb_template.c	Sat Nov 10 20:39:23 2001 +0000
+++ b/postproc/rgb2rgb_template.c	Sat Nov 10 23:28:10 2001 +0000
@@ -813,3 +813,41 @@
         :::"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;
+	}
+}
+
+