X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ftransition_composite.c;h=4ffb3d5dd5469e765924dcd187e209a7b5c9f58b;hb=37149069e20cb4042ba1eb722a35b59cb946966e;hp=466c7742a390605c1c5a3cdc27dd70b6811d9b90;hpb=c0a066993bcef05ec6d3ef253e84e657e32f3dde;p=melted diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index 466c774..4ffb3d5 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -546,8 +546,8 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint int y = geometry.y * height_dest / geometry.nh; // Align x to a full YUYV group - x &= 0xfffffffe; - width_src &= 0xfffffffe; + x = ( x | 1 ) ^ 1; + width_src = ( width_src | 1 ) ^ 1; // optimization points - no work to do if ( width_src <= 0 || height_src <= 0 ) @@ -845,7 +845,7 @@ static int get_b_frame_image( mlt_transition this, mlt_frame b_frame, uint8_t ** *width = geometry->sw * *width / geometry->nw; *height = geometry->sh * *height / geometry->nh; - x &= 0xfffffffe; + x = ( x | 1 ) ^ 1; // optimization points - no work to do if ( *width < 1 || *height < 1 ) @@ -896,6 +896,16 @@ static struct geometry_s *composite_calculate( struct geometry_s *result, mlt_tr 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 @@ -950,8 +960,8 @@ mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_pos if ( y + h > height ) h = height - y; - x &= 0xfffffffe; - w &= 0xfffffffe; + x = ( x | 1 ) ^ 1; + w = ( w | 1 ) ^ 1; // Now we need to create a new destination image dest = mlt_pool_alloc( w * h * 2 ); @@ -963,7 +973,7 @@ mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_pos while ( q < r ) { - memcpy( q, p, w * 2 ); + inline_memcpy( q, p, w * 2 ); q += w * 2; p += width * 2; }