Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (43 sloc) 1.25 KB
diff --git a/gst/ffmpegcolorspace/imgconvert.c-orig b/gst/ffmpegcolorspace/imgconvert.c
index c670e25..51b5899 100644
--- a/gst/ffmpegcolorspace/imgconvert.c-orig
+++ b/gst/ffmpegcolorspace/imgconvert.c
@@ -827,6 +827,34 @@ img_copy (AVPicture * dst, const AVPicture * src,
}
}
+static void
+yuv422_to_uyvy422 (AVPicture * dst, const AVPicture * src, int width, int height)
+{
+ const uint8_t *in, *in1;
+ uint8_t *out, *out1;
+ int w;
+
+ in1 = src->data[0];
+ out1 = dst->data[0];
+
+ for (; height > 0; height--) {
+ in = in1;
+ out = out1;
+
+ for (w = width; w >= 2; w -= 2) {
+ out[0] = in[1];
+ out[1] = in[0];
+ out[2] = in[3];
+ out[3] = in[2];
+ out += 4;
+ in += 4;
+ }
+
+ in1 += src->linesize[0];
+ out1 += dst->linesize[0];
+ }
+}
+
/* XXX: totally non optimized */
static void
@@ -3162,6 +3190,7 @@ static ConvertEntry convert_table[] = {
{PIX_FMT_YUVJ444P, PIX_FMT_RGB24, yuvj444p_to_rgb24},
+ {PIX_FMT_YUV422, PIX_FMT_UYVY422, yuv422_to_uyvy422},
{PIX_FMT_YUV422, PIX_FMT_YUV420P, yuv422_to_yuv420p},
{PIX_FMT_YUV422, PIX_FMT_YUV422P, yuv422_to_yuv422p},
{PIX_FMT_YUV422, PIX_FMT_GRAY8, yvyu422_to_gray},