+ // NB: Locks needed here since the properties are being modified
+ int invert = mlt_properties_get_int( properties, "invert" );
+ mlt_service_lock( MLT_TRANSITION_SERVICE( self ) );
+ composite_calculate( self, &result, invert ? b_frame : a_frame, position );
+ mlt_service_unlock( MLT_TRANSITION_SERVICE( self ) );
+
+ // Manual option to deinterlace
+ if ( mlt_properties_get_int( properties, "deinterlace" ) )
+ {
+ mlt_properties_set_int( a_props, "consumer_deinterlace", 1 );
+ mlt_properties_set_int( b_props, "consumer_deinterlace", 1 );
+ }
+
+ // TODO: Dangerous/temporary optimisation - if nothing to do, then do nothing
+ if ( mlt_properties_get_int( properties, "no_alpha" ) &&
+ result.item.x == 0 && result.item.y == 0 && result.item.w == *width && result.item.h == *height && result.item.mix == 100 )
+ {
+ mlt_frame_get_image( b_frame, image, format, width, height, 1 );
+ if ( !mlt_frame_is_test_card( a_frame ) )
+ mlt_frame_replace_image( a_frame, *image, *format, *width, *height );
+ return 0;
+ }
+
+ if ( a_frame == b_frame )
+ {
+ double aspect_ratio = mlt_frame_get_aspect_ratio( b_frame );
+ get_b_frame_image( self, b_frame, &image_b, &width_b, &height_b, &result );
+ alpha_b = mlt_frame_get_alpha_mask( b_frame );
+ mlt_properties_set_double( a_props, "aspect_ratio", aspect_ratio );
+ }
+
+ // Get the image from the a frame
+ mlt_frame_get_image( a_frame, invert ? &image_b : image, format, width, height, 1 );
+ alpha_a = mlt_frame_get_alpha_mask( a_frame );
+