summaryrefslogtreecommitdiffstats
path: root/ext/hermes/yuv2yuv.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/hermes/yuv2yuv.c')
-rw-r--r--ext/hermes/yuv2yuv.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/hermes/yuv2yuv.c b/ext/hermes/yuv2yuv.c
index 0c36da33..4499af83 100644
--- a/ext/hermes/yuv2yuv.c
+++ b/ext/hermes/yuv2yuv.c
@@ -53,3 +53,26 @@ void gst_colorspace_yuy2_to_i420(unsigned char *src, unsigned char *dest, guint
}
}
}
+
+void gst_colorspace_i420_to_yv12(unsigned char *src, unsigned char *dest, guint width, guint height)
+{
+ int size, i;
+ guint8 *destcr, *destcb;
+
+ size = width * height;
+
+ memcpy (dest, src, size);
+
+ src += size;
+ destcr = dest + size;
+ size >>=2;
+ destcb = destcr + size;
+
+ i=size;
+ while (i--)
+ *destcb++ = *src++;
+ i=size;
+ while (i--)
+ *destcr++ = *src++;
+}
+