From d7c316a3c4475397f4ee000b6d8422183aaa7838 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Wed, 3 Mar 2004 22:29:16 +0000 Subject: [PATCH] optimise deinterlace path git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@188 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/core/filter_deinterlace.c | 34 ++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/modules/core/filter_deinterlace.c b/src/modules/core/filter_deinterlace.c index 95cb25f..3a83842 100644 --- a/src/modules/core/filter_deinterlace.c +++ b/src/modules/core/filter_deinterlace.c @@ -75,22 +75,26 @@ static void deinterlace_yuv( uint8_t *pdst, uint8_t *psrc, int width, int height static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) { - // Get the input image - int error = mlt_frame_get_image( this, image, format, width, height, 1 ); - - // Only continue if we have no error and the right colour space - if ( error == 0 && *format == mlt_image_yuv422 ) + int error = 0; + + // Check that we want progressive and we aren't already progressive + if ( *format == mlt_image_yuv422 && + !mlt_properties_get_int( mlt_frame_properties( this ), "progressive" ) && + mlt_properties_get_int( mlt_frame_properties( this ), "consumer_deinterlace" ) ) + { + // Get the input image + error = mlt_frame_get_image( this, image, format, width, height, 1 ); + + // Deinterlace the image + deinterlace_yuv( *image, *image, *width * 2, *height ); + + // Make sure that others know the frame is deinterlaced + mlt_properties_set_int( mlt_frame_properties( this ), "progressive", 1 ); + } + else { - // Check that we want progressive and we aren't already progressive - if ( !mlt_properties_get_int( mlt_frame_properties( this ), "progressive" ) && - mlt_properties_get_int( mlt_frame_properties( this ), "consumer_deinterlace" ) ) - { - // Deinterlace the image - deinterlace_yuv( *image, *image, *width * 2, *height ); - - // Make sure that others know the frame is deinterlaced - mlt_properties_set_int( mlt_frame_properties( this ), "progressive", 1 ); - } + // Get the input image + error = mlt_frame_get_image( this, image, format, width, height, writable ); } return error; -- 1.7.4.4