From 8296cdbfd58b6a6d59bd118e9e7e974f721c6066 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 9 Mar 2015 12:13:44 +0100 Subject: [PATCH] video-converter: only convert to/from rgb when needed Only use the YUV->RGB matrix when we have YUV as input and only use the matrix when we need to make YUV output. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=745780 --- gst-libs/gst/video/video-converter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index c22ed19f3e..a64c265c18 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -1066,7 +1066,7 @@ compute_matrix_to_RGB (GstVideoConverter * convert, MatrixData * data) 1 / ((float) scale[1]), 1 / ((float) scale[2])); } - if (!CHECK_MATRIX_NONE (convert)) { + if (!convert->unpack_rgb && !CHECK_MATRIX_NONE (convert)) { if (CHECK_MATRIX_OUTPUT (convert)) info = &convert->out_info; @@ -1074,7 +1074,6 @@ compute_matrix_to_RGB (GstVideoConverter * convert, MatrixData * data) if (gst_video_color_matrix_get_Kr_Kb (info->colorimetry.matrix, &Kr, &Kb)) color_matrix_YCbCr_to_RGB (data, Kr, Kb); } - color_matrix_debug (data); } @@ -1084,7 +1083,7 @@ compute_matrix_to_YUV (GstVideoConverter * convert, MatrixData * data) GstVideoInfo *info; gdouble Kr = 0, Kb = 0; - if (!CHECK_MATRIX_NONE (convert)) { + if (!convert->pack_rgb && !CHECK_MATRIX_NONE (convert)) { if (CHECK_MATRIX_INPUT (convert)) info = &convert->in_info; else