summaryrefslogtreecommitdiff
path: root/indra/llimage/llimagej2c.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2026-05-20 10:20:54 -0400
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2026-05-20 10:20:54 -0400
commit57048769db20f5e84834c8c6dd15466083bd7585 (patch)
tree685d5d7d88aaea6064b49561537bdaeae550db89 /indra/llimage/llimagej2c.cpp
parenta4fdf69c2dae9ed5fafe4d292bfb4cd1ce881441 (diff)
Move the KDU data size estimate into j2ckdu, make the base pure virtual.
Diffstat (limited to 'indra/llimage/llimagej2c.cpp')
-rw-r--r--indra/llimage/llimagej2c.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp
index 512b370bae..8099a18045 100644
--- a/indra/llimage/llimagej2c.cpp
+++ b/indra/llimage/llimagej2c.cpp
@@ -265,32 +265,6 @@ S32 LLImageJ2C::calcHeaderSizeJ2C()
return FIRST_PACKET_SIZE; // Hack. just needs to be >= actual header size...
}
-// Lean pyramid-walk byte estimator suited to packet-by-packet decoders (KDU).
-// Starts at one max-block, walks resolutions by doubling area, sums each
-// layer's compressed-bytes contribution.
-// Reference: https://wiki.lindenlab.com/wiki/THX1138_KDU_Improvements#Byte_Range_Study
-S32 LLImageJ2CImpl::estimateDataSize(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) const
-{
- constexpr S32 precision = 8;
- constexpr S32 max_components = 4;
- S32 width = (w > 0) ? w : 2048;
- S32 height = (h > 0) ? h : 2048;
- const S32 surface = width * height;
- S32 nb_layers = 1;
- S32 s = MAX_BLOCK_SIZE * MAX_BLOCK_SIZE;
- S32 totalbytes = (S32)(s * max_components * precision * rate);
- while (surface > s)
- {
- if (nb_layers <= (5 - discard_level))
- totalbytes += (S32)(s * max_components * precision * rate);
- nb_layers++;
- s *= 4;
- }
- totalbytes /= 8;
- totalbytes += LLImageJ2C::calcHeaderSizeJ2C();
- return totalbytes;
-}
-
//static
S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate)
{