X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ftransition_composite.c;h=f8f78c96b98b4db68af8733bee27b738006b4d23;hb=8312a94c9a728e98e59ab12da1adbfe79d85ac7e;hp=1cfed9be2dd7ac5559ee4217caa971e1264d38f5;hpb=8ecadc338cf97d53f77f67854ea6705ed5eabc2a;p=melted diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index 1cfed9b..f8f78c9 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -40,6 +40,7 @@ typedef void ( *composite_line_fn )( uint8_t *dest, uint8_t *src, int width_src, struct geometry_s { + int frame; float position; float mix; int nw; // normalised width @@ -154,14 +155,28 @@ static void geometry_calculate( struct geometry_s *output, struct geometry_s *in position = ( position - in->position ) / ( out->position - in->position ); // Calculate this frames geometry - output->nw = in->nw; - output->nh = in->nh; - output->x = in->x + ( out->x - in->x ) * position; - output->y = in->y + ( out->y - in->y ) * position; - output->w = in->w + ( out->w - in->w ) * position; - output->h = in->h + ( out->h - in->h ) * position; - output->mix = in->mix + ( out->mix - in->mix ) * position; - output->distort = in->distort; + if ( in->frame != out->frame - 1 ) + { + output->nw = in->nw; + output->nh = in->nh; + output->x = in->x + ( out->x - in->x ) * position; + output->y = in->y + ( out->y - in->y ) * position; + output->w = in->w + ( out->w - in->w ) * position; + output->h = in->h + ( out->h - in->h ) * position; + output->mix = in->mix + ( out->mix - in->mix ) * position; + output->distort = in->distort; + } + else + { + output->nw = out->nw; + output->nh = out->nh; + output->x = out->x; + output->y = out->y; + output->w = out->w; + output->h = out->h; + output->mix = out->mix; + output->distort = out->distort; + } // DRD> These break on negative values. I do not think they are needed // since yuv_composite takes care of YUYV group alignment @@ -239,7 +254,8 @@ static struct geometry_s *transition_parse_keys( mlt_transition this, int norma // Parse and add to the list geometry_parse( temp, ptr, value, normalised_width, normalised_height ); - // Assign the position + // Assign the position and frame + temp->frame = frame; temp->position = position; // Allow the next to be appended after this one @@ -552,7 +568,7 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint } // crop overlay beyond right edge of frame - else if ( x + width_src > width_dest ) + if ( x + width_src > width_dest ) width_src = width_dest - x; // crop overlay off the top edge of the frame @@ -561,8 +577,9 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint y_src = -y; height_src -= y_src; } + // crop overlay below bottom edge of frame - else if ( y + height_src > height_dest ) + if ( y + height_src > height_dest ) height_src = height_dest - y; // offset pointer into overlay buffer based on cropping @@ -817,7 +834,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 -= x % 2; + x &= 0xfffffffe; // optimization points - no work to do if ( *width < 1 || *height < 1 ) @@ -995,7 +1012,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f uint8_t *dest = *image; uint8_t *src = image_b; uint8_t *alpha = mlt_frame_get_alpha_mask( b_frame ); - int progressive = mlt_properties_get_int( a_props, "progressive" ) || + int progressive = mlt_properties_get_int( a_props, "consumer_progressive" ) || mlt_properties_get_int( properties, "progressive" ); int field;