X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage.cc;h=b473403e42ed50fdfe295815b2ed922aa7f5c76a;hb=4d11fe7cea71b0564df9a21a3cc706509d12b0d1;hp=c176c2d65fe0d3cfb4e176086c798eaf13c52bbe;hpb=ecc7a69054d8f2e9e8b8d1037a91f7f4a83df140;p=dcpomatic.git diff --git a/src/lib/image.cc b/src/lib/image.cc index c176c2d65..b473403e4 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -129,7 +129,7 @@ Image::planes () const */ shared_ptr Image::crop_scale_window ( - Crop crop, dcp::Size inter_size, dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_format, bool out_aligned, bool fast + Crop crop, dcp::Size inter_size, dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, VideoRange video_range, AVPixelFormat out_format, bool out_aligned, bool fast ) const { /* Empirical testing suggests that sws_scale() will crash if @@ -198,8 +198,8 @@ Image::crop_scale_window ( */ sws_setColorspaceDetails ( scale_context, - sws_getCoefficients (lut[yuv_to_rgb]), 0, - sws_getCoefficients (lut[yuv_to_rgb]), 0, + sws_getCoefficients (lut[yuv_to_rgb]), video_range == VIDEO_RANGE_VIDEO ? 0 : 1, + sws_getCoefficients (lut[yuv_to_rgb]), 1, 0, 1 << 16, 1 << 16 );