From b307d355162ff46d06eb62ec71a74ccf9877c605 Mon Sep 17 00:00:00 2001 From: Evgenii Kliuchnikov Date: Thu, 5 Dec 2024 15:15:48 +0000 Subject: [PATCH] Cherry-pie topping: lint + fix includes + cherry-pick-in-forked-code --- lib/cms/jxl_cms.cc | 2 +- lib/extras/packed_image_convert.cc | 9 +-------- tools/tracking_memory_manager.cc | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/cms/jxl_cms.cc b/lib/cms/jxl_cms.cc index ca879451..b3d5e535 100644 --- a/lib/cms/jxl_cms.cc +++ b/lib/cms/jxl_cms.cc @@ -35,7 +35,7 @@ #else // JPEGXL_ENABLE_SKCMS #include "lcms2.h" #include "lcms2_plugin.h" -#include "lib/jxl/base/span.h" +#include "lib/base/span.h" #endif // JPEGXL_ENABLE_SKCMS #define JXL_CMS_VERBOSE 0 diff --git a/lib/extras/packed_image_convert.cc b/lib/extras/packed_image_convert.cc index e93962e9..97b8480d 100644 --- a/lib/extras/packed_image_convert.cc +++ b/lib/extras/packed_image_convert.cc @@ -343,14 +343,7 @@ Status ConvertFromExternalNoSizeCheck(const uint8_t* data, size_t xsize, size_t bytes_per_pixel = format.num_channels * bytes_per_channel; size_t pixel_offset = c * bytes_per_channel; // Only for uint8/16. - float scale = 1.0f; - if (format.data_type == JXL_TYPE_UINT8) { - // We will do an integer multiplication by 257 in LoadFloatRow so that a - // UINT8 value and the corresponding UINT16 value convert to the same float - scale = 1.0f / (257 * ((1ull << bits_per_sample) - 1)); - } else { - scale = 1.0f / ((1ull << bits_per_sample) - 1); - } + float scale = 1.0f / ((1ull << bits_per_sample) - 1); const bool little_endian = format.endianness == JXL_LITTLE_ENDIAN || diff --git a/tools/tracking_memory_manager.cc b/tools/tracking_memory_manager.cc index 279153d0..704ec0e6 100644 --- a/tools/tracking_memory_manager.cc +++ b/tools/tracking_memory_manager.cc @@ -9,8 +9,8 @@ #include #include "lib/base/memory_manager.h" -#include "lib/extras/memory_manager_internal.h" #include "lib/base/status.h" +#include "lib/extras/memory_manager_internal.h" namespace jpegxl { namespace tools {