]> git.sesse.net Git - mlt/commitdiff
filter_rescale.c, producer_avformat.c, producer_libdv.c, producer_consumer.c:
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 28 Dec 2008 02:39:28 +0000 (02:39 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 28 Dec 2008 02:39:28 +0000 (02:39 +0000)
coerce a deinterlace when scaling an interlaced source.

git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1294 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/avformat/producer_avformat.c
src/modules/core/filter_rescale.c
src/modules/core/producer_consumer.c
src/modules/dv/producer_libdv.c

index 14a97bf7d853b361a138a21b807b266e620cb846..df5b0b1eed617cd6e16397eaeb8b85d33cdb3786 100644 (file)
@@ -985,6 +985,8 @@ static void producer_set_up_video( mlt_producer this, mlt_frame frame )
                        // Set the width and height
                        mlt_properties_set_int( frame_properties, "width", codec_context->width );
                        mlt_properties_set_int( frame_properties, "height", codec_context->height );
+                       mlt_properties_set_int( frame_properties, "real_width", codec_context->width );
+                       mlt_properties_set_int( frame_properties, "real_height", codec_context->height );
                        mlt_properties_set_double( frame_properties, "aspect_ratio", aspect_ratio );
 
                        mlt_frame_push_get_image( frame, producer_get_image );
index 6251ca89a8d0097b92758f90f1409cb16721b2c2..25ca5fcff7d38ce347e7101ef7ba51f9c13bd184 100644 (file)
@@ -206,7 +206,12 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        mlt_properties_set_int( properties, "rescale_width", iwidth );
                        mlt_properties_set_int( properties, "rescale_height", iheight );
                }
-       
+
+               // Deinterlace if height is changing to prevent fields mixing on interpolation
+               // One exception: non-interpolated, integral scaling
+               if ( iheight != oheight && ( strcmp( interps, "nearest" ) || ( iheight % oheight != 0 ) ) )
+                       mlt_properties_set_int( properties, "consumer_deinterlace", 1 );
+
                // Get the image as requested
                mlt_frame_get_image( this, image, format, &iwidth, &iheight, writable );
 
index 280705d6097d41c83c8857a29f821c280eb68919..7b36f2138de5b4be487920a2579d61b36283c86c 100644 (file)
@@ -161,8 +161,11 @@ static int get_frame( mlt_producer this, mlt_frame_ptr frame, int index )
                // Inform the normalizers about our video properties
                mlt_properties frame_props = MLT_FRAME_PROPERTIES( *frame );
                mlt_properties_set_double( frame_props, "aspect_ratio", mlt_profile_sar( cx->profile ) );
-               mlt_properties_set_double( frame_props, "width", cx->profile->width );
-               mlt_properties_set_double( frame_props, "height", cx->profile->height );
+               mlt_properties_set_int( frame_props, "width", cx->profile->width );
+               mlt_properties_set_int( frame_props, "height", cx->profile->height );
+               mlt_properties_set_int( frame_props, "real_width", cx->profile->width );
+               mlt_properties_set_int( frame_props, "real_height", cx->profile->height );
+               mlt_properties_set_int( frame_props, "progressive", cx->profile->progressive );
        }
 
        // Calculate the next timecode
index 10f3d46b2b22fcd9b8022298c9854631e7f148fd..6fd012c65a997fe3efc5b04b7a8a39322b97ef7b 100644 (file)
@@ -485,6 +485,8 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                // Update other info on the frame
                mlt_properties_set_int( properties, "width", 720 );
                mlt_properties_set_int( properties, "height", this->is_pal ? 576 : 480 );
+               mlt_properties_set_int( properties, "real_width", 720 );
+               mlt_properties_set_int( properties, "real_height", this->is_pal ? 576 : 480 );
                mlt_properties_set_int( properties, "top_field_first", !this->is_pal ? 0 : ( data[ 5 ] & 0x07 ) == 0 ? 0 : 1 );
        
                // Parse the header for meta info