diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-07-24 11:24:12 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-07-24 11:24:12 +0800 |
| commit | fc46ce4c0c7d81349d55933fb4bef3260f79ac8b (patch) | |
| tree | 42b81558404432b253684661136dcd38722f59a7 /indra/llkdu | |
| parent | ffd174763119879d8be376c7c94b58e1961a7ebd (diff) | |
| parent | bcfda3b68a95bbbfb8b53f6313929fc5aeaa591c (diff) | |
Merge tag 'Second_Life_Release#bcfda3b6-26.3' into 26.3
Diffstat (limited to 'indra/llkdu')
| -rw-r--r-- | indra/llkdu/llimagej2ckdu.cpp | 30 | ||||
| -rw-r--r-- | indra/llkdu/llimagej2ckdu.h | 2 | ||||
| -rw-r--r-- | indra/llkdu/tests/llimagej2ckdu_test.cpp | 2 |
3 files changed, 0 insertions, 34 deletions
diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 74aaffbd65..cf45f93168 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -1551,33 +1551,3 @@ void kdc_flow_control::process_components() } } } - -// Layer-factored byte estimator. Walks the resolution pyramid to count -// layers, weights by layer_factor, then picks between a sqrt-based "new" -// estimate and a raw-dimensions "old" estimate per TextureNewByteRange. -// Reference: https://wiki.lindenlab.com/wiki/THX1138_KDU_Improvements#Byte_Range_Study -S32 LLImageJ2CKDU::estimateDataSize(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) const -{ - S32 width = (w > 0) ? w : 2048; - S32 height = (h > 0) ? h : 2048; - S32 nb_layers = 1; - S32 surface = width * height; - S32 s = MAX_BLOCK_SIZE * MAX_BLOCK_SIZE; - while (surface > s) - { - nb_layers++; - s *= 4; - } - F32 layer_factor = 3.0f * (7 - llclamp(nb_layers, 1, 6)); - - width >>= discard_level; - height >>= discard_level; - width = llmax(width, 1); - height = llmax(height, 1); - - S32 new_bytes = (S32)(sqrtf((F32)(width * height)) * (F32)comp * rate * 1000.f / layer_factor); - S32 old_bytes = (S32)((F32)(width * height * comp) * rate); - S32 bytes = (LLImage::useNewByteRange() && (new_bytes < old_bytes)) ? new_bytes : old_bytes; - bytes = llmax(bytes, LLImageJ2C::calcHeaderSizeJ2C()); - return bytes; -} diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 6079585948..c9aa0c5250 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -67,8 +67,6 @@ protected: virtual bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL); virtual bool initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0); virtual std::string getEngineInfo() const; -public: - virtual S32 estimateDataSize(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) const; private: bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, ECodeStreamMode mode, S32 first_channel, S32 max_channel_count, int discard_level = -1, int* region = NULL); diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index 6be2d3a078..bc52a15c4a 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -83,8 +83,6 @@ void LLImageBase::setSize(S32 , S32 , S32 ) { } bool LLImageBase::isBufferInvalid() const { return false; } LLImageJ2CImpl::~LLImageJ2CImpl() { } -bool LLImage::sUseNewByteRange = false; -S32 LLImageJ2C::calcHeaderSizeJ2C() { return 0; } LLImageFormatted::LLImageFormatted(S8 ) { } LLImageFormatted::~LLImageFormatted() { } |
