]> git.sesse.net Git - mlt/commitdiff
fix rounding causes by -ffast-math
authorMaksym Veremeyenko <verem@m1stereo.tv>
Fri, 17 Feb 2012 01:26:42 +0000 (17:26 -0800)
committerDan Dennedy <dan@dennedy.org>
Fri, 17 Feb 2012 01:26:42 +0000 (17:26 -0800)
src/modules/core/transition_composite.c

index ca90471869413c270e297222bc82335039da574c..cab4f253cdf4d104d8c72e8829a90648bcf7b797 100644 (file)
@@ -460,8 +460,8 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint
        int stride_src = geometry.sw * bpp;
        int stride_dest = width_dest * bpp;
        int i_softness = ( 1 << 16 ) * softness;
-       int weight = ( ( 1 << 16 ) - 1 ) * geometry.item.mix / 100;
-       uint32_t luma_step = ( ( 1 << 16 ) - 1 ) * geometry.item.mix / 100 * ( 1.0 + softness );
+       int weight = ( ( ( 1 << 16 ) - 1 ) * geometry.item.mix + 50 ) / 100;
+       uint32_t luma_step = ( ( ( 1 << 16 ) - 1 ) * geometry.item.mix + 50 ) / 100 * ( 1.0 + softness );
 
        // Adjust to consumer scale
        int x = rint( geometry.item.x * width_dest / geometry.nw );