From 969906f2dd6c5c144781861f53e2a0f6baefb9a3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 3 Oct 2021 21:22:14 +0200 Subject: Don't scale chroma subsampled images to sizes that don't align with the subsampling (#1872). There's a slightly odd effect when scaling e.g. YVU420 images to odd and then even widths - there's a small but visible luminance shift. I don't know why this happens, but keeping the scaling sizes locked to the subsampling seems to help. --- src/lib/util.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/lib/util.h') diff --git a/src/lib/util.h b/src/lib/util.h index 013eabe12..10c5678ff 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -18,16 +18,20 @@ */ + /** @file src/util.h * @brief Some utility functions and classes. */ + #ifndef DCPOMATIC_UTIL_H #define DCPOMATIC_UTIL_H -#include "types.h" -#include "dcpomatic_time.h" + #include "audio_mapping.h" +#include "dcpomatic_time.h" +#include "pixel_quanta.h" +#include "types.h" #include #include #include @@ -41,6 +45,7 @@ #undef check + namespace dcp { class PictureAsset; class SoundAsset; @@ -119,7 +124,7 @@ extern std::string day_of_week_to_string (boost::gregorian::greg_weekday d); extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, std::shared_ptr decoder); extern bool show_jobs_on_console (bool progress); extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function); -extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container); +extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta); extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm); extern boost::filesystem::path default_font_file (); extern std::string to_upper (std::string s); -- cgit v1.2.3