From 4bda59f88d148a41b412705d4739342123a192d9 Mon Sep 17 00:00:00 2001 From: Stijn Last Date: Fri, 15 Sep 2023 09:12:25 +0200 Subject: [PATCH] deinterlace: greedy, improve quality scanlines->m1 = same line of the previous field scanlines->t0 = line above of the current field scanlines->b0 = line below of the current field scanlines->mp = same line of the next field Deinterlacing a field weaved frame: When deinterlacing the top field, the next bottom field is available (part of the same frame). but when deinterlacing the bottom field, the next top field (part of the next frame) is not available and scanlines->mp equals NULL. In this case it's better to use greedy algorithm using the prevous field (twice) rather then linear interpolation of the current field. Part-of: --- .../gst-plugins-good/gst/deinterlace/tvtime/greedy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedy.c b/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedy.c index 5a01cc6f3c..aa88e90312 100644 --- a/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedy.c +++ b/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedy.c @@ -74,7 +74,7 @@ deinterlace_greedy_interpolate_scanline_orc (GstDeinterlaceSimpleMethod * self, { guint max_comb = GST_DEINTERLACE_METHOD_GREEDY_L (self)->max_comb; - if (scanlines->m1 == NULL || scanlines->mp == NULL) { + if (scanlines->m1 == NULL) { deinterlace_line_linear (out, scanlines->t0, scanlines->b0, size); } else { deinterlace_line_greedy (out, scanlines->m1, scanlines->t0, scanlines->b0, @@ -89,7 +89,7 @@ deinterlace_greedy_interpolate_scanline_orc_planar_u (GstDeinterlaceSimpleMethod { guint max_comb = GST_DEINTERLACE_METHOD_GREEDY_L (self)->max_comb; - if (scanlines->m1 == NULL || scanlines->mp == NULL) { + if (scanlines->m1 == NULL) { deinterlace_line_linear (out, scanlines->t0, scanlines->b0, size); } else { deinterlace_line_greedy (out, scanlines->m1, scanlines->t0, scanlines->b0, @@ -104,7 +104,7 @@ deinterlace_greedy_interpolate_scanline_orc_planar_v (GstDeinterlaceSimpleMethod { guint max_comb = GST_DEINTERLACE_METHOD_GREEDY_L (self)->max_comb; - if (scanlines->m1 == NULL || scanlines->mp == NULL) { + if (scanlines->m1 == NULL) { deinterlace_line_linear (out, scanlines->t0, scanlines->b0, size); } else { deinterlace_line_greedy (out, scanlines->m1, scanlines->t0, scanlines->b0,