mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
video-converter: force yuv conversion for border
Make sure we always do yuv conversion for the border.
This commit is contained in:
parent
dd5fa311a1
commit
757669481c
1 changed files with 7 additions and 6 deletions
|
@ -1202,12 +1202,13 @@ compute_matrix_to_RGB (GstVideoConverter * convert, MatrixData * data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
compute_matrix_to_YUV (GstVideoConverter * convert, MatrixData * data)
|
compute_matrix_to_YUV (GstVideoConverter * convert, MatrixData * data,
|
||||||
|
gboolean force)
|
||||||
{
|
{
|
||||||
GstVideoInfo *info;
|
GstVideoInfo *info;
|
||||||
gdouble Kr = 0, Kb = 0;
|
gdouble Kr = 0, Kb = 0;
|
||||||
|
|
||||||
if (!convert->pack_rgb && !CHECK_MATRIX_NONE (convert)) {
|
if (force || (!convert->pack_rgb && !CHECK_MATRIX_NONE (convert))) {
|
||||||
if (CHECK_MATRIX_INPUT (convert))
|
if (CHECK_MATRIX_INPUT (convert))
|
||||||
info = &convert->in_info;
|
info = &convert->in_info;
|
||||||
else
|
else
|
||||||
|
@ -1581,7 +1582,7 @@ chain_convert (GstVideoConverter * convert, GstLineCache * prev)
|
||||||
color_matrix_debug (&convert->convert_matrix);
|
color_matrix_debug (&convert->convert_matrix);
|
||||||
|
|
||||||
GST_DEBUG ("to YUV matrix");
|
GST_DEBUG ("to YUV matrix");
|
||||||
compute_matrix_to_YUV (convert, &convert->convert_matrix);
|
compute_matrix_to_YUV (convert, &convert->convert_matrix, FALSE);
|
||||||
GST_DEBUG ("current matrix");
|
GST_DEBUG ("current matrix");
|
||||||
color_matrix_debug (&convert->convert_matrix);
|
color_matrix_debug (&convert->convert_matrix);
|
||||||
if (convert->in_bits > convert->out_bits) {
|
if (convert->in_bits > convert->out_bits) {
|
||||||
|
@ -1731,7 +1732,7 @@ chain_convert_to_YUV (GstVideoConverter * convert, GstLineCache * prev)
|
||||||
|
|
||||||
if (!convert->pack_rgb) {
|
if (!convert->pack_rgb) {
|
||||||
color_matrix_set_identity (&convert->to_YUV_matrix);
|
color_matrix_set_identity (&convert->to_YUV_matrix);
|
||||||
compute_matrix_to_YUV (convert, &convert->to_YUV_matrix);
|
compute_matrix_to_YUV (convert, &convert->to_YUV_matrix, FALSE);
|
||||||
|
|
||||||
/* matrix is in 0..255 range, scale to pack bits */
|
/* matrix is in 0..255 range, scale to pack bits */
|
||||||
GST_DEBUG ("chain YUV convert");
|
GST_DEBUG ("chain YUV convert");
|
||||||
|
@ -1938,7 +1939,7 @@ setup_borderline (GstVideoConverter * convert)
|
||||||
|
|
||||||
/* Get Color matrix. */
|
/* Get Color matrix. */
|
||||||
color_matrix_set_identity (&cm);
|
color_matrix_set_identity (&cm);
|
||||||
compute_matrix_to_YUV (convert, &cm);
|
compute_matrix_to_YUV (convert, &cm, TRUE);
|
||||||
color_matrix_convert (&cm);
|
color_matrix_convert (&cm);
|
||||||
|
|
||||||
border_val = GINT32_FROM_BE (convert->border_argb);
|
border_val = GINT32_FROM_BE (convert->border_argb);
|
||||||
|
@ -2354,7 +2355,7 @@ video_converter_compute_matrix (GstVideoConverter * convert)
|
||||||
|
|
||||||
color_matrix_set_identity (dst);
|
color_matrix_set_identity (dst);
|
||||||
compute_matrix_to_RGB (convert, dst);
|
compute_matrix_to_RGB (convert, dst);
|
||||||
compute_matrix_to_YUV (convert, dst);
|
compute_matrix_to_YUV (convert, dst, FALSE);
|
||||||
|
|
||||||
convert->current_bits = 8;
|
convert->current_bits = 8;
|
||||||
prepare_matrix (convert, dst);
|
prepare_matrix (convert, dst);
|
||||||
|
|
Loading…
Reference in a new issue