- int colorspace = mlt_properties_get_int( properties, "colorspace" );
- int no_scale_luma = 0;
- if ( *format == mlt_image_yuv422 && mlt_properties_get_int( properties, "skip_luma_scale" )
- && ( output_format == mlt_image_rgb24 || output_format == mlt_image_rgb24a ) )
+ if ( *format == mlt_image_yuv422 && mlt_properties_get( properties, "force_full_luma" )
+ && ( output_format == mlt_image_rgb24 || output_format == mlt_image_rgb24a ) )
+ {
+ // By removing the frame property we only permit the luma to skip scaling once.
+ // Thereafter, we let swscale scale the luma range as it pleases since it seems
+ // we do not have control over the RGB to YUV conversion.
+ force_full_luma = mlt_properties_get_int( properties, "force_full_luma" );
+ mlt_properties_set( properties, "force_full_luma", NULL );
+ }
+ if ( !av_convert_image( output, *image, out_fmt, in_fmt, width, height,
+ colorspace, profile->colorspace, force_full_luma ) )