From 24e526a11157073eb0c511bf8858934644d65e52 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Sun, 12 Oct 2025 02:05:02 +1000 Subject: [PATCH] Corrected calcDataSizeJ2C change so it compiles on macOS and Linux --- indra/llimage/llimagej2c.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 23ef3d74e8..827ac022dc 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -302,15 +302,15 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r // --- Use 7.1.11 basis with fixes implied by LL PRs --- (void)comp; // retained for parity with the viewer signature - const S32 hard_cap = 12; // sanity cap - const S64 base_layer_area = static_cast(MAX_BLOCK_SIZE) * static_cast(MAX_BLOCK_SIZE); // 64x64 blocks at discard 5 + constexpr S32 hard_cap = 12; // sanity cap + constexpr S64 base_layer_area = static_cast(MAX_BLOCK_SIZE) * static_cast(MAX_BLOCK_SIZE); // 64x64 blocks at discard 5 + constexpr S64 bits_per_tile = static_cast(max_components) * static_cast(precision); const S32 discard_layers = std::max(5 - discard_level, 0); const double rate64 = static_cast(rate); const S64 header_bytes = static_cast(calcHeaderSizeJ2C()); - const S64 bits_per_tile = static_cast(max_components) * static_cast(precision); // helper lambda: layer area to estimated bit budget - auto scaled_bits = [rate64, bits_per_tile](S64 layer_area) -> S64 + auto scaled_bits = [rate64](S64 layer_area) -> S64 { const S64 layer_bits = layer_area * bits_per_tile; return static_cast(std::llround(static_cast(layer_bits) * rate64));