]> git.sesse.net Git - mlt/commitdiff
transition_composite.c: slightly more accurate positioning when using crop panning...
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 15 Jun 2008 19:29:31 +0000 (19:29 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 15 Jun 2008 19:29:31 +0000 (19:29 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1142 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/core/transition_composite.c

index fdd184deed4150878c5c2f09ec25369db81ea200..3930ecd83b871f6b87603200f906bdb413b72a7b 100644 (file)
@@ -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 );
        }
 }