static inline int calculate_mix( uint16_t *luma, int j, int softness, int weight, int alpha, uint32_t step )
{
- return ( ( luma ? smoothstep( luma[ j ], luma[ j ] + softness, step ) : weight ) * alpha ) >> 8;
+ return ( ( luma ? smoothstep( luma[ j ], luma[ j ] + softness, step ) : weight ) * ( alpha + 1 ) ) >> 8;
}
static inline uint8_t sample_mix( uint8_t dest, uint8_t src, int mix )
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 + 50 ) / 100;
+ int weight = ( ( 1 << 16 ) * geometry.item.mix + 50 ) / 100;
uint32_t luma_step = ( ( ( 1 << 16 ) - 1 ) * geometry.item.mix + 50 ) / 100 * ( 1.0 + softness );
// Adjust to consumer scale
p_src += x_src * bpp + y_src * stride_src;
// offset pointer into frame buffer based upon positive coordinates only!
- p_dest += ( x < 0 ? 0 : x ) * bpp + ( y < 0 ? 0 : y ) * stride_dest;
+ p_dest += x * bpp + y * stride_dest;
// offset pointer into alpha channel based upon cropping
alpha_b += x_src + y_src * stride_src / bpp;
if ( uneven_x != uneven_x_src )
{
p_src += 2;
- width_src -= 2;
alpha_b += 1;
}
mlt_transition transition_composite_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
{
- mlt_transition self = calloc( sizeof( struct mlt_transition_s ), 1 );
+ mlt_transition self = calloc( 1, sizeof( struct mlt_transition_s ) );
if ( self != NULL && mlt_transition_init( self, NULL ) == 0 )
{
mlt_properties properties = MLT_TRANSITION_PROPERTIES( self );