From: ddennedy Date: Sun, 15 Jun 2008 19:29:31 +0000 (+0000) Subject: transition_composite.c: slightly more accurate positioning when using crop panning... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1f47e5f4e04fb5c415bf5630c4e85a52b7b8b5da;p=mlt transition_composite.c: slightly more accurate positioning when using crop panning and horizontal position is adjusted to align chroma channels. git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1142 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index fdd184de..3930ecd8 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -555,13 +555,13 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint int alpha_b_stride = stride_src / bpp; int alpha_a_stride = stride_dest / bpp; - // Snap to even columns to prevent "chroma swap" - p_src += uneven_x_src * 2; - width_src -= 2 * uneven_x_src; - alpha_b += uneven_x_src; - p_dest += uneven_x * 2; - width_src -= 2 * uneven_x; - alpha_a += uneven_x; + // Align chroma of source and destination + if ( uneven_x != uneven_x_src ) + { + p_src += 2; + width_src -= 2; + alpha_b += 1; + } // now do the compositing only to cropped extents for ( i = 0; i < height_src; i += step ) @@ -880,8 +880,8 @@ static void crop_calculate( mlt_transition this, mlt_properties properties, stru // Compute the pan struct mlt_geometry_item_s crop_item; mlt_geometry_fetch( crop, &crop_item, position ); - result->x_src = crop_item.x; - result->y_src = crop_item.y; + result->x_src = rint( crop_item.x ); + result->y_src = rint( crop_item.y ); } }