diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2002-06-21 18:29:13 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2002-06-21 18:29:13 +0000 |
commit | 9251ed656ad51ab6ae43b4076de16c9b335fa23d (patch) | |
tree | ab4a9b68c3ea7542fa0f239e8eae81ab636b7c7e /ext/hermes/yuv2yuv.c | |
parent | 43d17ede7a099635c0af06fb7840e37ac58face6 (diff) | |
download | gst-plugins-bad-9251ed656ad51ab6ae43b4076de16c9b335fa23d.tar.gz gst-plugins-bad-9251ed656ad51ab6ae43b4076de16c9b335fa23d.tar.bz2 gst-plugins-bad-9251ed656ad51ab6ae43b4076de16c9b335fa23d.zip |
Fixed problem with color conversion
Original commit message from CVS:
Fixed problem with color conversion
Added conversion between YV12 and I420
Diffstat (limited to 'ext/hermes/yuv2yuv.c')
-rw-r--r-- | ext/hermes/yuv2yuv.c | 23 |
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++; +} + |