diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/dcp_video.cc | 25 | ||||
| -rw-r--r-- | src/lib/player_video.cc | 2 |
2 files changed, 7 insertions, 20 deletions
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index fdbd5774f..775298091 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -104,12 +104,13 @@ DCPVideo::convert_to_xyz(shared_ptr<const PlayerVideo> frame) { shared_ptr<dcp::OpenJPEGImage> xyz; - if (frame->colour_conversion()) { - auto conversion = [](AVPixelFormat fmt) { - return fmt == AV_PIX_FMT_XYZ12LE ? AV_PIX_FMT_XYZ12LE : AV_PIX_FMT_RGB48LE; - }; + auto conversion = [](AVPixelFormat fmt) { + return fmt == AV_PIX_FMT_XYZ12LE ? AV_PIX_FMT_XYZ12LE : AV_PIX_FMT_RGB48LE; + }; + + auto image = frame->image(conversion, VideoRange::FULL, false); - auto image = frame->image(conversion, VideoRange::FULL, false); + if (frame->colour_conversion()) { xyz = dcp::rgb_to_xyz( image->data()[0], image->size(), @@ -117,20 +118,6 @@ DCPVideo::convert_to_xyz(shared_ptr<const PlayerVideo> frame) frame->colour_conversion().get() ); } else { - auto conversion = [](AVPixelFormat fmt) { - auto const descriptor = av_pix_fmt_desc_get(fmt); - if (!descriptor) { - return fmt; - } - - if (descriptor->flags & AV_PIX_FMT_FLAG_RGB) { - return AV_PIX_FMT_RGB48LE; - } - - return AV_PIX_FMT_XYZ12LE; - }; - - auto image = frame->image(conversion, VideoRange::FULL, false); xyz = make_shared<dcp::OpenJPEGImage>(image->data()[0], image->size(), image->stride()[0]); } diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index 63811fb69..a3868856b 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -177,7 +177,7 @@ PlayerVideo::make_image(function<AVPixelFormat (AVPixelFormat)> pixel_format, Vi total_crop.bottom /= r; } - dcp::YUVToRGB yuv_to_rgb = dcp::YUVToRGB::REC601; + dcp::YUVToRGB yuv_to_rgb = dcp::YUVToRGB::REC709; if (_colour_conversion) { yuv_to_rgb = _colour_conversion.get().yuv_to_rgb(); } |
