summaryrefslogtreecommitdiff
path: root/src/lib/image.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-05-24 23:29:39 +0100
committerCarl Hetherington <cth@carlh.net>2019-05-24 23:29:39 +0100
commit92784c9c28c48859578cd6e75aa01d5657d0c341 (patch)
tree595a34ecd2c59bf9d3dbcfa0c6f0a91b17ecfa5b /src/lib/image.cc
parent6c78f6d31a457ad34fb14b7c926fb418b4d6790d (diff)
Basic ability to set video range (JPEG/MPEG) at least for YUV content. May not work for RGB. See #1509.
Diffstat (limited to 'src/lib/image.cc')
-rw-r--r--src/lib/image.cc6
1 files changed, 3 insertions, 3 deletions
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>
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
);