From f843d3bee3f3b2e70486bc86fbb965877324eb10 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 25 Feb 2022 12:44:26 +0100 Subject: [PATCH] deinterlace: greedyh: Stop adding 2 to cur_field_idx Just a simplification. Part-of: --- .../gst/deinterlace/tvtime/greedyh.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c b/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c index 3fd9368a53..84daa7e0d8 100644 --- a/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c +++ b/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c @@ -733,23 +733,23 @@ deinterlace_frame_di_greedyh_plane (GstDeinterlaceMethodGreedyH * self, gint InfoIsOdd; gint Line; - L1 = GST_VIDEO_FRAME_COMP_DATA (history[cur_field_idx - 2].frame, plane); - if (history[cur_field_idx - 2].flags & PICTURE_INTERLACED_BOTTOM) + L1 = GST_VIDEO_FRAME_COMP_DATA (history[cur_field_idx].frame, plane); + if (history[cur_field_idx].flags & PICTURE_INTERLACED_BOTTOM) L1 += RowStride; - L2 = GST_VIDEO_FRAME_COMP_DATA (history[cur_field_idx - 1].frame, plane); - if (history[cur_field_idx - 1].flags & PICTURE_INTERLACED_BOTTOM) + L2 = GST_VIDEO_FRAME_COMP_DATA (history[cur_field_idx + 1].frame, plane); + if (history[cur_field_idx + 1].flags & PICTURE_INTERLACED_BOTTOM) L2 += RowStride; L3 = L1 + Pitch; - L2P = GST_VIDEO_FRAME_COMP_DATA (history[cur_field_idx - 3].frame, plane); - if (history[cur_field_idx - 3].flags & PICTURE_INTERLACED_BOTTOM) + L2P = GST_VIDEO_FRAME_COMP_DATA (history[cur_field_idx - 1].frame, plane); + if (history[cur_field_idx - 1].flags & PICTURE_INTERLACED_BOTTOM) L2P += RowStride; // copy first even line no matter what, and the first odd line if we're // processing an EVEN field. (note diff from other deint rtns.) - InfoIsOdd = (history[cur_field_idx - 1].flags == PICTURE_INTERLACED_BOTTOM); + InfoIsOdd = (history[cur_field_idx + 1].flags == PICTURE_INTERLACED_BOTTOM); if (InfoIsOdd) { // copy first even line memcpy (Dest, L1, RowStride); @@ -807,8 +807,6 @@ deinterlace_frame_di_greedyh_packed (GstDeinterlaceMethod * method, return; } - cur_field_idx += 2; - switch (GST_VIDEO_INFO_FORMAT (method->vinfo)) { case GST_VIDEO_FORMAT_YUY2: case GST_VIDEO_FORMAT_YVYU: @@ -852,8 +850,6 @@ deinterlace_frame_di_greedyh_planar (GstDeinterlaceMethod * method, return; } - cur_field_idx += 2; - deinterlace_frame_di_greedyh_plane (self, history, history_count, outframe, cur_field_idx, 0, klass->scanline_planar_y); deinterlace_frame_di_greedyh_plane (self, history, history_count, outframe,