else
end->position = 1;
- // Assign to properties to ensure we get destroyed
- mlt_properties_set_data( properties, "geometries", start, 0, transition_destroy_keys, NULL );
-
return start;
}
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;
}
-struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transition this, mlt_frame a_frame, float position )
+static struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transition this, mlt_frame a_frame, float position )
{
// Get the properties from the transition
mlt_properties properties = mlt_transition_properties( this );
struct geometry_s *start = mlt_properties_get_data( properties, "geometries", NULL );
// Now parse the geometries
- if ( start == NULL )
+ if ( start == NULL || mlt_properties_get_int( properties, "refresh" ) )
{
// Obtain the normalised width and height from the a_frame
int normalised_width = mlt_properties_get_int( a_props, "normalised_width" );
// Parse the transitions properties
start = transition_parse_keys( this, normalised_width, normalised_height );
+
+ // Assign to properties to ensure we get destroyed
+ mlt_properties_set_data( properties, "geometries", start, 0, transition_destroy_keys, NULL );
+ mlt_properties_set_int( properties, "refresh", 0 );
}
// Do the calculation
return start;
}
+static inline void inline_memcpy( uint8_t *dest, uint8_t *src, int length )
+{
+ uint8_t *end = src + length;
+ while ( src < end )
+ {
+ *dest ++ = *src ++;
+ *dest ++ = *src ++;
+ }
+}
+
mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_position frame_position )
{
// Create a frame to return
w = result.w * width / result.nw;
h = result.h * height / result.nh;
+ if ( y < 0 )
+ {
+ h = h + y;
+ y = 0;
+ }
+
+ if ( y + h > height )
+ h = height - y;
+
x &= 0xfffffffe;
- //w &= 0xfffffffe;
+ w &= 0xfffffffe;
// Now we need to create a new destination image
dest = mlt_pool_alloc( w * h * 2 );
while ( q < r )
{
- memcpy( q, p, w * 2 );
+ inline_memcpy( q, p, w * 2 );
q += w * 2;
p += width * 2;
}
// 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
// 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;
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++ )
{