From 19ca706fe8d6e846b62979f372bda92262a7a797 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 25 Feb 2022 12:30:21 +0100 Subject: [PATCH] deinterlace: greedyh: Move _planar_plane upwards In preparation of refactoring. No functional change. Part-of: --- .../gst/deinterlace/tvtime/greedyh.c | 82 +++++++++++----------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c b/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c index 69f75ee..d8a567b 100644 --- a/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c +++ b/subprojects/gst-plugins-good/gst/deinterlace/tvtime/greedyh.c @@ -717,6 +717,47 @@ greedyh_scanline_C_planar_uv (GstDeinterlaceMethodGreedyH * self, #endif static void +deinterlace_frame_di_greedyh_planar_plane (GstDeinterlaceMethodGreedyH * self, + const guint8 * L1, const guint8 * L2, const guint8 * L3, const guint8 * L2P, + guint8 * Dest, gint RowStride, gint FieldHeight, gint Pitch, gint InfoIsOdd, + ScanlineFunction scanline) +{ + gint Line; + + // 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.) + + if (InfoIsOdd) { + // copy first even line + memcpy (Dest, L1, RowStride); + Dest += RowStride; + } else { + // copy first even line + memcpy (Dest, L1, RowStride); + Dest += RowStride; + // then first odd line + memcpy (Dest, L1, RowStride); + Dest += RowStride; + } + + for (Line = 0; Line < (FieldHeight - 1); ++Line) { + scanline (self, L1, L2, L3, L2P, Dest, RowStride); + Dest += RowStride; + memcpy (Dest, L3, RowStride); + Dest += RowStride; + + L1 += Pitch; + L2 += Pitch; + L3 += Pitch; + L2P += Pitch; + } + + if (InfoIsOdd) { + memcpy (Dest, L2, RowStride); + } +} + +static void deinterlace_frame_di_greedyh_packed (GstDeinterlaceMethod * method, const GstDeinterlaceField * history, guint history_count, GstVideoFrame * outframe, int cur_field_idx) @@ -834,47 +875,6 @@ deinterlace_frame_di_greedyh_packed (GstDeinterlaceMethod * method, } static void -deinterlace_frame_di_greedyh_planar_plane (GstDeinterlaceMethodGreedyH * self, - const guint8 * L1, const guint8 * L2, const guint8 * L3, const guint8 * L2P, - guint8 * Dest, gint RowStride, gint FieldHeight, gint Pitch, gint InfoIsOdd, - ScanlineFunction scanline) -{ - gint Line; - - // 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.) - - if (InfoIsOdd) { - // copy first even line - memcpy (Dest, L1, RowStride); - Dest += RowStride; - } else { - // copy first even line - memcpy (Dest, L1, RowStride); - Dest += RowStride; - // then first odd line - memcpy (Dest, L1, RowStride); - Dest += RowStride; - } - - for (Line = 0; Line < (FieldHeight - 1); ++Line) { - scanline (self, L1, L2, L3, L2P, Dest, RowStride); - Dest += RowStride; - memcpy (Dest, L3, RowStride); - Dest += RowStride; - - L1 += Pitch; - L2 += Pitch; - L3 += Pitch; - L2P += Pitch; - } - - if (InfoIsOdd) { - memcpy (Dest, L2, RowStride); - } -} - -static void deinterlace_frame_di_greedyh_planar (GstDeinterlaceMethod * method, const GstDeinterlaceField * history, guint history_count, GstVideoFrame * outframe, int cur_field_idx) -- 2.7.4