Compensate for possible low LOD bit allocation shifts
This commit is contained in:
@@ -381,7 +381,13 @@ S32 LLImageJ2C::calcDataSize(S32 discard_level)
|
||||
static const LLCachedControl<bool> legacy_size("SianaLegacyJ2CSize", false);
|
||||
|
||||
if (legacy_size) {
|
||||
return calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), discard_level, mRate);
|
||||
static const LLCachedControl<F32> exponent("SianaJ2CSizeExponent", 1.0f);
|
||||
static const LLCachedControl<S32> offset("SianaJ2CSizeOffset", 0);
|
||||
|
||||
S32 size = calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), discard_level, mRate);
|
||||
S32 size_d0 = calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), discard_level, mRate);
|
||||
|
||||
return pow(size/size_d0, exponent)*size_d0 + offset;
|
||||
}
|
||||
|
||||
discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL);
|
||||
|
||||
@@ -37,6 +37,29 @@
|
||||
</array>
|
||||
</map>
|
||||
|
||||
<key>SianaJ2CSizeExponent</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Exponent of size estimator. Should be between 0.0 and 1.0</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.5</real>
|
||||
</map>
|
||||
<key>SianaJ2CSizeOffset</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Number of bytes to add to size estimator.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>100</integer>
|
||||
</map>
|
||||
|
||||
<key>SianaLegacyJ2CSize</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
Reference in New Issue
Block a user