X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ftransition_composite.c;h=174d53258abe83c3121ac802a3fb32556a4a460d;hb=1c14f3554de8f3c4a04f88b26e914b60a5bf0180;hp=f8f78c96b98b4db68af8733bee27b738006b4d23;hpb=f9c7e4e64fe57451a17ef25a727c8d3387ee1737;p=melted diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index f8f78c9..174d532 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -622,20 +622,34 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint stride_dest *= step; int alpha_stride = stride_src / bpp; - if ( line_fn == NULL ) - line_fn = composite_line_yuv; - // now do the compositing only to cropped extents - for ( i = 0; i < height_src; i += step ) + if ( line_fn != NULL ) { - line_fn( p_dest, p_src, width_src, p_alpha, weight, p_luma, softness ); - - p_src += stride_src; - p_dest += stride_dest; - if ( p_alpha ) - p_alpha += alpha_stride; - if ( p_luma ) - p_luma += alpha_stride; + for ( i = 0; i < height_src; i += step ) + { + line_fn( p_dest, p_src, width_src, p_alpha, weight, p_luma, softness ); + + p_src += stride_src; + p_dest += stride_dest; + if ( p_alpha ) + p_alpha += alpha_stride; + if ( p_luma ) + p_luma += alpha_stride; + } + } + else + { + for ( i = 0; i < height_src; i += step ) + { + composite_line_yuv( p_dest, p_src, width_src, p_alpha, weight, p_luma, softness ); + + p_src += stride_src; + p_dest += stride_dest; + if ( p_alpha ) + p_alpha += alpha_stride; + if ( p_luma ) + p_luma += alpha_stride; + } } return ret; @@ -973,6 +987,9 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f // Get the image from the a frame mlt_frame_get_image( a_frame, image, format, width, height, 1 ); + // Get the properties from the transition + mlt_properties properties = mlt_transition_properties( this ); + if ( b_frame != NULL ) { // Get the properties of the a frame @@ -981,9 +998,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f // Get the properties of the b frame mlt_properties b_props = mlt_frame_properties( b_frame ); - // Get the properties from the transition - mlt_properties properties = mlt_transition_properties( this ); - // Structures for geometry struct geometry_s result; @@ -996,7 +1010,10 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f // Optimisation - no compositing required if ( result.mix == 0 || ( result.w == 0 && result.h == 0 ) ) + { + mlt_properties_set_data( properties, "geometries", NULL, 0, NULL, NULL ); return 0; + } // Since we are the consumer of the b_frame, we must pass along these // consumer properties from the a_frame @@ -1019,7 +1036,8 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f int32_t luma_softness = mlt_properties_get_double( properties, "softness" ) * ( 1 << 16 ); uint16_t *luma_bitmap = get_luma( properties, width_b, height_b ); - composite_line_fn line_fn = mlt_properties_get_int( properties, "_MMX" ) ? composite_line_yuv_mmx : composite_line_yuv; + //composite_line_fn line_fn = mlt_properties_get_int( properties, "_MMX" ) ? composite_line_yuv_mmx : NULL; + composite_line_fn line_fn = NULL; for ( field = 0; field < ( progressive ? 1 : 2 ); field++ ) { @@ -1038,6 +1056,9 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f } } + // Force geometries to be recalculated + mlt_properties_set_data( properties, "geometries", NULL, 0, NULL, NULL ); + return 0; }