Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
c94a118
#5084 Fix mac's watchdog not catching test case
akleshchev Feb 25, 2026
88c4cf7
#5426 Fix crash in LLPointer<LLImageGL>::notNull
marchcat Mar 3, 2026
52ed305
#5084 Convert watchdog to a simpleton
akleshchev Mar 3, 2026
ce139f2
#5486 Fix potential unpackBinaryData buffer issues
akleshchev Mar 4, 2026
ba92b8d
#5084 Fix watchdog's simpleton init
akleshchev Mar 6, 2026
bb69f7e
#5497 Handle a case of missing files in conversation view
akleshchev Mar 5, 2026
e529a09
Bump actions/upload-artifact from 6 to 7
dependabot[bot] Mar 1, 2026
e4505eb
Bump actions/download-artifact from 7 to 8
dependabot[bot] Mar 1, 2026
9d985d7
#5506 Periodical stalls on media update
akleshchev Mar 8, 2026
5d8012e
Merge 2026.01 into develop
akleshchev Mar 9, 2026
85d4e8e
#3612 Fix empty 'copy' message
akleshchev Mar 9, 2026
7f5963b
#5512 Crash on reset_login
akleshchev Mar 9, 2026
d35be21
Merge remote-tracking branch 'origin/main' into develop
Geenz Mar 12, 2026
6194e88
Merge pull request #5411 from trish-sl/fix-highlighttransparency-alph…
trish-sl Mar 12, 2026
53af39b
#1625 Blinding white screen when changing environments
akleshchev Mar 3, 2026
d44da70
Clean up unused code
KittyBarnett Aug 29, 2024
8b0d042
LLViewerObject::getAttachmentItemID() sometimes returns the NULL UUID…
KittyBarnett Aug 29, 2024
ac0c734
LLAppearanceMgr::updateAppearanceFromCOF() doesn't properly filter it…
KittyBarnett Aug 29, 2024
a7512cf
Resolve race condition when removing/add attachments inside of a LLWe…
KittyBarnett Aug 29, 2024
b2a22e1
Resolve issues tracking worn attachments that aren't in COF yet (see …
KittyBarnett Aug 29, 2024
6c6d618
If multiple LLWearableHoldingPattern instances are waiting for comple…
KittyBarnett Aug 29, 2024
f6d0b36
Accurately reflect the worn status of inventory items (the reasons fo…
KittyBarnett Jan 29, 2025
5bc81c9
Attaching a rezzed object incorrectly delays attachment link creation…
KittyBarnett Jan 29, 2025
4034714
[FIXED] Wearing >56 clothing items will incorrectly filter since body…
KittyBarnett Feb 28, 2026
75a98ba
#5541 Add safety checks for inventory save during shutdown
marchcat Mar 16, 2026
a5a6cfb
viewer-private#540 Fix freeze when opening large profiles #1
akleshchev Mar 16, 2026
dd4f5cf
viewer-private#540 Speed up url search #2
akleshchev Mar 16, 2026
05c8cd8
viewer-private#540 Avoid micro truncations #3
akleshchev Mar 16, 2026
0aa33a1
#5454 fix not showing Friend requests during start up notification
maxim-productengine Mar 19, 2026
166fa85
#5543 PBR support for pipette
akleshchev Mar 17, 2026
69cbb48
#5543 Clear pipette button's visibility logic for materials
akleshchev Mar 18, 2026
e9b39bf
Improve detection of marketplace urls for the marketplace floater
Hecklezz Feb 26, 2026
45e3204
Add 'copilot-swe-agent' to allowlist in CLA workflow (#5566)
brad-linden Mar 23, 2026
689123f
#5558 Adjust map request size dynamically
akleshchev Mar 20, 2026
0084a93
#5558 Don't spam server with requests we don't need
akleshchev Mar 20, 2026
b7fc5b2
Extend sendMapBlockRequest stub and add test<4> for request-size asse…
Copilot Mar 21, 2026
5a7a527
#4298 Handle various out of memory cases
akleshchev Mar 27, 2026
83c3a3c
#5585 fix the issue with ptt state when joining p2p call while in voi…
maxim-productengine Mar 30, 2026
9846a1c
#3420 CreateLandmarkForPosition floater fails to save descriptions
akleshchev Mar 30, 2026
136eb7a
#5579 Separate parts of calculateUpdateRenderComplexity
akleshchev Mar 25, 2026
c7576cd
#5579 Implement partial complexity calculations
akleshchev Mar 25, 2026
e2d8ace
#5579 Cleanup
akleshchev Mar 26, 2026
a77156e
#5373 add leap api to open Build floater and change selected tool
maxim-productengine Mar 31, 2026
b4f1072
#5367 Leap API support for combo boxes
maxim-productengine Apr 1, 2026
de5ff4f
#5447 update Dialog buttons to correctly display emoji
maxim-productengine Apr 2, 2026
210a6a8
#5602 deleteProbe optimization pass
akleshchev Apr 1, 2026
5b485bd
#5612 Improve profiling coverage
akleshchev Apr 2, 2026
3078b20
#5612 Fix fast cache freezing main thread
akleshchev Apr 2, 2026
5cdd65e
#2892 Make thumbnail drop work the same way picker does
akleshchev Apr 3, 2026
321a6e9
#5612 Reduce delays on resource access for main thread
akleshchev Apr 4, 2026
61417e2
Allow mute list to fallback to cached copy when simulator response so…
DarlCat Apr 1, 2026
03c1354
Treat emptymutelist dispatch from the simulator as authoritative when…
DarlCat Apr 2, 2026
0abb59a
Rename LLMuteList state machine touch points for clarity
DarlCat Apr 2, 2026
840383d
Eliminate pointless mutelist cache fallback attempt, instead manually…
DarlCat Apr 2, 2026
9978c66
Improve documentation and logging of LLMuteList changes
DarlCat Apr 3, 2026
581cad9
Make LLBlockList more reactive to LLMuteList changes
DarlCat Apr 3, 2026
901ad61
Add noitems text to the block list UI, with translation friendly help…
DarlCat Apr 3, 2026
0a42b9f
Attempt one additional mute list request from simulator after region …
DarlCat Apr 4, 2026
66dc10f
Release/26.1.1 (#5530)
Geenz Apr 7, 2026
1d2cf48
Merge pull request #5623 from secondlife/geenz/main-develop
Geenz Apr 8, 2026
130c50c
#5611 Select a discrete gpu when possible
akleshchev Apr 7, 2026
5f91a3f
#5626 LLTextBase optimization
akleshchev Apr 8, 2026
ead4017
Add texture streaming "channels" (#5442)
Geenz Feb 22, 2026
7f110d9
Merge pull request #5667 from secondlife/geenz/texture-channel-cherry…
Geenz Apr 17, 2026
b9e15a2
secondlife/viewer#5702: Ensure non-visible preloaded media has PRIORI…
cosmic-linden Apr 23, 2026
96fd196
Merge pull request #5720 from secondlife/v-5672_26.3
cosmic-linden Apr 27, 2026
5d5c74c
Get texture quality settings setup and tuned.
Geenz Apr 29, 2026
878e1f6
secondlife/viewer#5634: Apply version string from janus server if ava…
cosmic-linden Apr 14, 2026
28f86ae
Merge pull request #5792 from secondlife/cosmic/janus_set_version_26.3
cosmic-linden May 11, 2026
186320e
Remove Vivox-related code
roxanneskelly May 12, 2026
0aa4373
Remove Vivox Licenses
roxanneskelly May 12, 2026
82db494
Rework texture streaming and tracking.
Geenz May 13, 2026
ba9d13b
Merge pull request #5800 from secondlife/roxie/remove-vivox
roxanneskelly May 14, 2026
01f4b18
Fix display of ad-hoc session type in About and display p2p instead a…
cosmic-linden May 14, 2026
97f8dfa
Add a background discard offset.
Geenz May 15, 2026
cd2dd39
Merge pull request #5816 from secondlife/cosmic/janus_set_version_26.3
cosmic-linden May 15, 2026
97bcc78
Add a texture "bubble" near the camera to ensure high res textures cl…
Geenz May 18, 2026
1b1f59c
Break out texture channel priorities.
Geenz May 18, 2026
db2e6a2
Cache repeated singleton/accessor calls in LLPanel::initPanelXML
marchcat May 19, 2026
e726385
More high pressure and quality changes.
Geenz May 19, 2026
bbc8509
#5756 Improve LLUICtrlFactory's performance
akleshchev May 4, 2026
c4bc64c
Rework VRAM controller and bubble interaction — gate iteration on pre…
Geenz May 19, 2026
87b333f
#5809 Add 'mute' based filter for conversation history
akleshchev May 19, 2026
d53041d
#5804 Prevent focus steal when removing unselected conversation widget
marchcat May 15, 2026
1ee317b
Bring back the pre-aug 2024 byte estimation for j2c streams, and add …
Geenz May 20, 2026
a4fdf69
Make tests happy.
Geenz May 20, 2026
5704876
Move the KDU data size estimate into j2ckdu, make the base pure virtual.
Geenz May 20, 2026
80b5573
Update llimagej2ckdu_test.cpp
Geenz May 20, 2026
804da73
Update llimagej2ckdu_test.cpp
Geenz May 20, 2026
491b0b3
Merge pull request #5842 from secondlife/release/2026.03
Geenz May 20, 2026
3f82abe
Merge branch 'main' into geenz/26.2-to-26.3
Geenz May 20, 2026
6bef0d0
Make sure we're using override properly.
Geenz May 20, 2026
9c2ee02
Merge pull request #5843 from secondlife/geenz/26.2-to-26.3
Geenz May 20, 2026
5e03a1b
#5732 fix showing incorrect 'Packets Lost' statistic
maxim-productengine May 21, 2026
99ab631
#5733 reduce the tabs width on the Profile
maxim-productengine May 21, 2026
755c19a
Move texture quality to auto detect on VRAM
Geenz May 22, 2026
dad44ba
A few OpenGL state fixes provided by Rye from the Alchemy Viewer.
Geenz May 22, 2026
6b4e3f3
Merge pull request #5829 from secondlife/geenz/texture-quality
Geenz May 22, 2026
41858ca
#4802 Handle KDU crashes
akleshchev May 5, 2026
0c5fd5e
#5784 fix crash at LLViewerRegion::killInvisibleObjects
maxim-productengine May 11, 2026
663bf4d
#4823 WebRTC crashes
akleshchev May 19, 2026
4125091
Merge pull request #5835 from secondlife/marchcat/panel-xml-opt
marchcat May 24, 2026
f27285d
#5368 add Leap API to query statistics
maxim-productengine May 26, 2026
f269701
#5368 add the timer for doFrame
maxim-productengine May 26, 2026
ae2f146
#5368 adding simple logging and clean up
maxim-productengine May 27, 2026
1f65fa8
Merge pull request #5870 from secondlife/maxim/26.3-5368
maxim-productengine May 27, 2026
12d1e68
#5881 Adjust llDialog width
akleshchev Jun 3, 2026
d8f2aac
#5877 Fix truncated Favorites bar text
akleshchev Jun 2, 2026
16cc25f
#5881 Adjust buttons for llDialog
akleshchev Jun 4, 2026
945be86
Revert "#1625 Blinding white screen when changing environments"
akleshchev Apr 19, 2026
9bc0129
#5611 Skip default windows' gpu drivers
akleshchev Jun 9, 2026
9858207
#3672 Fix shader compilation error
akleshchev Jun 9, 2026
38ddd44
#5775 Update copyright date in cmake
akleshchev May 12, 2026
65a907c
Update viewer copyright year in About licenses
mayconbekkers Apr 15, 2026
1d45676
p#604 Fix draw range fluctuations
akleshchev Jun 11, 2026
e7fee9e
p#604 Fix draw range fluctuations #2
akleshchev Jun 15, 2026
ad4a54d
#5785 fix login and world UI overlap
maxim-productengine Jun 16, 2026
02c7ee3
#5579 Ensure own avatar's complexity is up to date
akleshchev Jun 16, 2026
550ed6d
p#626 Freeze detection on gl oclusion logic
akleshchev Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ jobs:

- name: Upload executable
if: steps.build.outputs.viewer_app
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: "${{ steps.build.outputs.artifact }}-app"
path: |
Expand All @@ -310,21 +310,21 @@ jobs:
# artifact for that too.
- name: Upload symbol file
if: steps.build.outputs.symbolfile
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: "${{ steps.build.outputs.artifact }}-symbols"
path: ${{ steps.build.outputs.symbolfile }}

- name: Upload metadata
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: "${{ steps.build.outputs.artifact }}-metadata"
# emitted by build.sh, possibly multiple lines
path: |
${{ steps.build.outputs.metadata }}

- name: Upload physics package
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
# should only be set for viewer-private
if: matrix.configuration == 'Release' && steps.build.outputs.physicstpv
with:
Expand Down Expand Up @@ -418,13 +418,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download viewer exe
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: Windows-app
path: _artifacts
- name: Download Windows Symbols
if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: Windows-symbols
- name: Extract viewer pdb
Expand Down Expand Up @@ -457,7 +457,7 @@ jobs:
steps:
- name: Download Mac Symbols
if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID
uses: actions/download-artifact@v7
uses: actions/download-artifact@v8
with:
name: macOS-symbols
- name: Post Mac symbols
Expand All @@ -479,11 +479,11 @@ jobs:
runs-on: ubuntu-latest
if: needs.setup.outputs.release_run
steps:
- uses: actions/download-artifact@v7
- uses: actions/download-artifact@v8
with:
pattern: "*-installer"

- uses: actions/download-artifact@v7
- uses: actions/download-artifact@v8
with:
pattern: "*-metadata"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
path-to-signatures: signatures.json
remote-organization-name: secondlife
remote-repository-name: cla-signatures
allowlist: callum@mbp.localdomain,rye@lindenlab.com,rye,signal@lindenlab.com,dependabot*,bot*
allowlist: callum@mbp.localdomain,rye@lindenlab.com,rye,signal@lindenlab.com,dependabot*,bot*,copilot-swe-agent*
60 changes: 1 addition & 59 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2192,64 +2192,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>description</key>
<string>Generated headers and sources for OpenXR loader.</string>
</map>
<key>slvoice</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>1e70b06fe6eb9796097010871b32d8e95167e373</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/gh/secondlife/3p-slvoice/slvoice-4.10.0000.32327.5fc3fe7c.5942f08-darwin64-5942f08.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>92b0ae08832bd0e99c34ef8f3e6346ad</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/613/1289/slvoice-3.2.0002.10426.500605-linux64-500605.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>ddfb7c30d9756915e8b26f44e2ee3a69ee87fb9a</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/gh/secondlife/3p-slvoice/slvoice-4.10.0000.32327.5fc3fe7c.5942f08-windows64-5942f08.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>license</key>
<string>Mixed</string>
<key>license_file</key>
<string>LICENSES/vivox_licenses.txt</string>
<key>copyright</key>
<string>2010 Vivox, including audio coding using Polycom¨ Siren14TM (ITU-T Rec. G.722.1 Annex C)</string>
<key>version</key>
<string>4.10.0000.32327.5fc3fe7c.5942f08</string>
<key>name</key>
<string>slvoice</string>
<key>description</key>
<string>Vivox SDK components</string>
</map>
<key>sse2neon</key>
<map>
<key>platforms</key>
Expand Down Expand Up @@ -3448,7 +3390,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>license_file</key>
<string>docs/LICENSE-source.txt</string>
<key>copyright</key>
<string>Copyright (c) 2020, Linden Research, Inc.</string>
<string>Copyright (c) 2026, Linden Research, Inc.</string>
<key>version_file</key>
<string>newview/viewer_version.txt</string>
<key>name</key>
Expand Down
60 changes: 0 additions & 60 deletions indra/cmake/Copy3rdPartyLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,6 @@ endmacro()
# set up platform specific lists of files that need to be copied
###################################################################
if(WINDOWS)
#*******************************
# VIVOX - *NOTE: no debug version
set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}")

# ND, it seems there is no such thing defined. At least when building a viewer
# Does this maybe matter on some LL buildserver? Otherwise this and the snippet using slvoice_src_dir
# can all go
if( ARCH_PREBUILT_BIN_RELEASE )
set(slvoice_src_dir "${ARCH_PREBUILT_BIN_RELEASE}")
endif()
set(slvoice_files SLVoice.exe )
if (ADDRESS_SIZE EQUAL 64)
list(APPEND vivox_libs
vivoxsdk_x64.dll
ortp_x64.dll
)
else (ADDRESS_SIZE EQUAL 64)
list(APPEND vivox_libs
vivoxsdk.dll
ortp.dll
)
endif (ADDRESS_SIZE EQUAL 64)

#*******************************
# Misc shared libs

Expand Down Expand Up @@ -159,12 +136,6 @@ if(WINDOWS)
endforeach()

elseif(DARWIN)
set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(slvoice_files SLVoice)
set(vivox_libs
libortp.dylib
libvivoxsdk.dylib
)
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
set(debug_files
)
Expand All @@ -188,15 +159,6 @@ elseif(LINUX)
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}")

set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(vivox_libs
libsndfile.so.1
libortp.so
libvivoxoal.so.1
libvivoxsdk.so
)
set(slvoice_files SLVoice)

# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
# or ARCH_PREBUILT_DIRS
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
Expand Down Expand Up @@ -226,8 +188,6 @@ elseif(LINUX)

else(WINDOWS)
message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
set(vivox_lib_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
set(vivox_libs "")
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
# or ARCH_PREBUILT_DIRS
set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
Expand All @@ -249,26 +209,6 @@ endif(WINDOWS)
# Done building the file lists, now set up the copy commands.
################################################################

# Curiously, slvoice_files are only copied to SHARED_LIB_STAGING_DIR_RELEASE.
# It's unclear whether this is oversight or intentional, but anyway leave the
# single copy_if_different command rather than using to_staging_dirs.

if( slvoice_src_dir )
copy_if_different(
${slvoice_src_dir}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${slvoice_files}
)
list(APPEND third_party_targets ${out_targets})
endif()

to_staging_dirs(
${vivox_lib_dir}
third_party_targets
${vivox_libs}
)

to_staging_dirs(
${release_src_dir}
third_party_targets
Expand Down
2 changes: 0 additions & 2 deletions indra/cmake/ViewerMiscLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ if( NOT USE_CONAN )
use_prebuilt_binary(libhunspell)
endif()

use_prebuilt_binary(slvoice)

use_prebuilt_binary(nanosvg)
use_prebuilt_binary(viewer-fonts)
use_prebuilt_binary(google-fonts)
Expand Down
34 changes: 5 additions & 29 deletions indra/llimage/llimagej2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,35 +268,11 @@ S32 LLImageJ2C::calcHeaderSizeJ2C()
//static
S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate)
{
// Note: This provides an estimation for the first to last quality layer of a given discard level
// This is however an efficient approximation, as the true discard level boundary would be
// in general too big for fast fetching.
// For details about the equation used here, see https://wiki.lindenlab.com/wiki/THX1138_KDU_Improvements#Byte_Range_Study

// Estimate the number of layers. This is consistent with what's done for j2c encoding in LLImageJ2CKDU::encodeImpl().
constexpr S32 precision = 8; // assumed bitrate per component channel, might change in future for HDR support
constexpr S32 max_components = 4; // assumed the file has four components; three color and alpha
// Use MAX_IMAGE_SIZE_DEFAULT (currently 2048) if either dimension is unknown (zero)
S32 width = (w > 0) ? w : 2048;
S32 height = (h > 0) ? h : 2048;
S32 max_dimension = llmax(width, height); // Find largest dimension
S32 block_area = MAX_BLOCK_SIZE * MAX_BLOCK_SIZE; // Calculated initial block area from established max block size (currently 64)
S32 max_layers = (S32)llmax(llround(log2f((float)max_dimension) - log2f((float)MAX_BLOCK_SIZE)), 4); // Find number of powers of two between extents and block size to a minimum of 4
block_area *= llmax(max_layers, 1); // Adjust initial block area by max number of layers
S32 totalbytes = (S32) (MIN_LAYER_SIZE * max_components * precision); // Start estimation with a minimum reasonable size
S32 block_layers = 0;
while (block_layers <= max_layers) // Walk the layers
{
if (block_layers <= (5 - discard_level)) // Walk backwards from discard 5 to required discard layer.
totalbytes += (S32) (block_area * max_components * precision * rate); // Add each block layer reduced by assumed compression rate
block_layers++; // Move to next layer
block_area *= 4; // Increase block area by power of four
}

totalbytes /= 8; // to bytes
totalbytes += calcHeaderSizeJ2C(); // header

return totalbytes;
// Dispatch to the linked impl so OpenJPEG (block-aligned, needs
// over-allocation) and KDU (packet-aligned, lean) each return what
// their decoder actually needs.
static std::unique_ptr<LLImageJ2CImpl> s_estimator(fallbackCreateLLImageJ2CImpl());
return s_estimator->estimateDataSize(w, h, comp, discard_level, rate);
}

S32 LLImageJ2C::calcHeaderSize()
Expand Down
5 changes: 5 additions & 0 deletions indra/llimage/llimagej2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ class LLImageJ2CImpl
{
public:
virtual ~LLImageJ2CImpl();

// Estimate the byte size of a J2C codestream sufficient to decode the
// given discard level. KDU uses a packet-by-packet impl; OpenJPEG
// overrides with a more conservative block-aligned estimate.
virtual S32 estimateDataSize(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) const = 0;
protected:
// Find out the image size and number of channels.
// Return value:
Expand Down
29 changes: 29 additions & 0 deletions indra/llimagej2coj/llimagej2coj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,3 +919,32 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base)
base.setSize(width, height, components);
return true;
}


// OpenJPEG-tuned byte estimator. Conservative pyramid walk that accounts for
// OJ's whole-code-block decode behavior (even with strict mode off). Larger
// images get a per-resolution multiplier so the byte range lands inside the
// last needed code-block boundary.
S32 LLImageJ2COJ::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;
S32 max_dimension = llmax(width, height);
S32 block_area = MAX_BLOCK_SIZE * MAX_BLOCK_SIZE;
S32 max_layers = (S32)llmax(llround(log2f((float)max_dimension) - log2f((float)MAX_BLOCK_SIZE)), 4);
block_area *= llmax(max_layers, 1);
S32 totalbytes = (S32)(MIN_LAYER_SIZE * max_components * precision);
S32 block_layers = 0;
while (block_layers <= max_layers)
{
if (block_layers <= (5 - discard_level))
totalbytes += (S32)(block_area * max_components * precision * rate);
block_layers++;
block_area *= 4;
}
totalbytes /= 8;
totalbytes += LLImageJ2C::calcHeaderSizeJ2C();
return totalbytes;
}
19 changes: 12 additions & 7 deletions indra/llimagej2coj/llimagej2coj.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@ class LLImageJ2COJ : public LLImageJ2CImpl
{
public:
LLImageJ2COJ();
virtual ~LLImageJ2COJ();
virtual ~LLImageJ2COJ() override;
protected:
virtual bool getMetadata(LLImageJ2C &base);
virtual bool decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count);
virtual bool getMetadata(LLImageJ2C &base) override;
virtual bool decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) override;
virtual bool encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0,
bool reversible = false);
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;
bool reversible = false) override;
virtual bool initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL) override;
virtual bool initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0) override;
virtual std::string getEngineInfo() const override;
public:
// OpenJPEG decodes whole code-blocks even with strict mode off, so the
// lean packet-walk under-allocates and clips quality. Keep the older
// conservative pyramid-with-multiplier estimate here.
virtual S32 estimateDataSize(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) const override;
};

#endif
Loading
Loading