int stride_dest = width_dest * bpp;
// Adjust to consumer scale
- int x = rint( 0.5 + geometry.item.x * width_dest / geometry.nw );
- int y = rint( 0.5 + geometry.item.y * height_dest / geometry.nh );
+ int x = rint( geometry.item.x * width_dest / geometry.nw );
+ int y = rint( geometry.item.y * height_dest / geometry.nh );
int uneven_x = ( x % 2 );
// optimization points - no work to do
{
// TODO: Clean up quick and dirty compressed/existence check
FILE *test;
- sprintf( temp, "%s/lumas/%s/%s", mlt_factory_prefix( ), mlt_environment( "MLT_NORMALISATION" ), strchr( resource, '%' ) + 1 );
+ sprintf( temp, "%s/lumas/%s/%s", mlt_environment( "MLT_DATA" ), mlt_environment( "MLT_NORMALISATION" ), strchr( resource, '%' ) + 1 );
test = fopen( temp, "r" );
if ( test == NULL )
strcat( temp, ".png" );
double consumer_ar = mlt_properties_get_double( b_props, "consumer_aspect_ratio" );
double background_ar = mlt_properties_get_double( b_props, "output_ratio" );
double output_ar = background_ar != 0.0 ? background_ar : consumer_ar;
- int scaled_width = rint( 0.5 + ( input_ar == 0.0 ? output_ar : input_ar ) / output_ar * real_width );
+ int scaled_width = rint( ( input_ar == 0.0 ? output_ar : input_ar ) / output_ar * real_width );
int scaled_height = real_height;
+// fprintf(stderr, "%s: scaled %dx%d norm %dx%d real %dx%d output_ar %f => %f\n", __FILE__,
+// scaled_width, scaled_height, normalised_width, normalised_height, real_width, real_height,
+// background_ar, output_ar);
// Now ensure that our images fit in the normalised frame
if ( scaled_width > normalised_width )
{
- scaled_height = rint( 0.5 + scaled_height * normalised_width / scaled_width );
+ scaled_height = rint( scaled_height * normalised_width / scaled_width );
scaled_width = normalised_width;
}
if ( scaled_height > normalised_height )
{
- scaled_width = rint( 0.5 + scaled_width * normalised_height / scaled_height );
+ scaled_width = rint( scaled_width * normalised_height / scaled_height );
scaled_height = normalised_height;
}
{
if ( scaled_height < normalised_height && scaled_width * normalised_height / scaled_height <= normalised_width )
{
- scaled_width = rint( 0.5 + scaled_width * normalised_height / scaled_height );
+ scaled_width = rint( scaled_width * normalised_height / scaled_height );
scaled_height = normalised_height;
}
else if ( scaled_width < normalised_width && scaled_height * normalised_width / scaled_width < normalised_height )
{
- scaled_height = rint( 0.5 + scaled_height * normalised_width / scaled_width );
+ scaled_height = rint( scaled_height * normalised_width / scaled_width );
scaled_width = normalised_width;
}
}
alignment_calculate( geometry );
// Adjust to consumer scale
- *width = rint( 0.5 + geometry->sw * *width / geometry->nw );
- *height = rint( 0.5 + geometry->sh * *height / geometry->nh );
+ *width = rint( geometry->sw * *width / geometry->nw );
+ *height = rint( geometry->sh * *height / geometry->nh );
+// fprintf(stderr, "%s: scaled %dx%d norm %dx%d resize %dx%d\n", __FILE__,
+// geometry->sw, geometry->sh, geometry->nw, geometry->nh, *width, *height);
ret = mlt_frame_get_image( b_frame, image, &format, width, height, 1 );
composite_calculate( this, &result, a_frame, position );
// Need to scale down to actual dimensions
- x = rint( 0.5 + result.item.x * width / result.nw );
- y = rint( 0.5 + result.item.y * height / result.nh );
- w = rint( 0.5 + result.item.w * width / result.nw );
- h = rint( 0.5 + result.item.h * height / result.nh );
+ x = rint( result.item.x * width / result.nw );
+ y = rint( result.item.y * height / result.nh );
+ w = rint( result.item.w * width / result.nw );
+ h = rint( result.item.h * height / result.nh );
if ( x % 2 )
{
// Since we are the consumer of the b_frame, we must pass along these
// consumer properties from the a_frame
- mlt_properties_set_double( b_props, "consumer_deinterlace", mlt_properties_get_double( a_props, "consumer_deinterlace" ) );
+ mlt_properties_set_int( b_props, "consumer_deinterlace", mlt_properties_get_int( a_props, "consumer_deinterlace" ) || mlt_properties_get_int( properties, "deinterlace" ) );
mlt_properties_set( b_props, "consumer_deinterlace_method", mlt_properties_get( a_props, "consumer_deinterlace_method" ) );
mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
if ( mlt_properties_get_int( properties, "titles" ) )
{
- result.item.w = rint( 0.5 + *width * ( result.item.w / result.nw ) );
+ result.item.w = rint( *width * ( result.item.w / result.nw ) );
result.nw = result.item.w;
- result.item.h = rint( 0.5 + *height * ( result.item.h / result.nh ) );
+ result.item.h = rint( *height * ( result.item.h / result.nh ) );
result.nh = *height;
result.sw = width_b;
result.sh = height_b;