import from custom branch of UXP: libjxl: exclude terse static assert from building (f428ae64)

This commit is contained in:
2025-03-14 00:51:13 +08:00
parent 2cab0774aa
commit 623d347978
6 changed files with 12 additions and 0 deletions
@@ -200,8 +200,10 @@ static std::vector<uint16_t> CreateTableCurve(bool tone_map) {
// TODO(sboukortt): make this variable?
static constexpr float kPQIntensityTarget = 10000;
#if 0
static_assert(N <= 4096); // ICC MFT2 only allows 4K entries
static_assert(tf == ExtraTF::kPQ || tf == ExtraTF::kHLG);
#endif
static constexpr Vector3 kLuminances{1.f / 3, 1.f / 3, 1.f / 3};
Rec2408ToneMapperBase tone_mapper(
+2
View File
@@ -106,7 +106,9 @@ void SingleFromSingleAccurate(const size_t xsize,
Status int_to_float(const pixel_type* const JXL_RESTRICT row_in,
float* const JXL_RESTRICT row_out, const size_t xsize,
const int bits, const int exp_bits) {
#if 0
static_assert(sizeof(pixel_type) == sizeof(float));
#endif
if (bits == 32) {
JXL_ENSURE(exp_bits == 8);
memcpy(row_out, row_in, xsize * sizeof(float));
@@ -70,7 +70,9 @@ void EncodeKeyword(const Tag& keyword, uint8_t* data, size_t size, size_t pos) {
}
Status AppendKeyword(const Tag& keyword, PaddedBytes* data) {
#if 0
static_assert(std::tuple_size<Tag>{} == 4);
#endif
return data->append(keyword);
}
+2
View File
@@ -147,8 +147,10 @@ class Plane : public detail::PlaneBase {
static StatusOr<Plane> Create(JxlMemoryManager* memory_manager,
const size_t xsize, const size_t ysize,
const size_t pre_padding = 0) {
#if 0
static_assert(sizeof(T) == 1 || sizeof(T) == 2 || sizeof(T) == 4 ||
sizeof(T) == 8);
#endif
uint32_t xsize32 = static_cast<uint32_t>(xsize);
uint32_t ysize32 = static_cast<uint32_t>(ysize);
JXL_ENSURE(xsize32 == xsize);
@@ -42,7 +42,9 @@ static inline pixel_type Scale(uint64_t value, uint64_t bit_depth) {
// return (value * ((static_cast<pixel_type_w>(1) << bit_depth) - 1)) / denom;
// We only call this function with kSmallCube or kLargeCube - 1 as denom,
// allowing us to avoid a division here.
#if 0
static_assert(denom == 4);
#endif
return (value * ((static_cast<uint64_t>(1) << bit_depth) - 1)) >> 2;
}
+2
View File
@@ -77,7 +77,9 @@ struct QuantEncodingInternal {
template <size_t A>
static constexpr QuantEncodingInternal Library() {
#if 0
static_assert(A < kNumPredefinedTables);
#endif
return QuantEncodingInternal(Tag<kQuantModeLibrary>(), A);
}
constexpr QuantEncodingInternal(Tag<kQuantModeLibrary> /* tag */,