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 14a97bf..df5b0b1 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 6251ca8..25ca5fc 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 280705d..7b36f21 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 10f3d46..6fd012c 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