transcoder/basisu_astc_helpers.h has a pragma once, but it is also an
implementation header (when ASTC_HELPERS_IMPLEMENTATION is defined).
pragma once is not necessary here as the header has a separate ifdef
guard, and it blocks attempts to compile Basis as a CMake Unity build
(CMAKE_UNITY_BUILD=ON) or as a single-translation unit non-CMake build
if the helpers header has been included earlier in the TU, as the second
inclusion with implementation defined doesn't actually include the
header.
Fixing overflow issue on extreme colors in color_distance().
Explicitly disabling unaligned addressing in miniz and transcoder when UBSAN is enabled
Disabling a needless optimization in transcoder causing ubsan issues (that could have easily been worked around in a different way, but it was an unnecessary optimization to begin with)
Rebuild wasm builds
- Minor fix to basisu_frontend::optimize_selector_codebook() so the new_selector_cluster_indices array is initialized correctly. (The backend doesn't use this array so no harm was being done.)
- Optimized ETC1S encoder (3-4.5x faster)
- Added optional SSE 4.1 support to encoder
- Switched from std::vector to a custom vector in the encoder and transcoder
- Added CppSPMD (SSE only for now)
- UASTC RDO is now more effective, but the command line parameter controlling qualiy has changed (to "lambda")
Some of our static analysis tools were complaining about unreachable code due to "#if ... return false; #endif code " blocks. This was changed to "#if ... return false #else ... #endif" which doesn't change the functionality but makes the static analyzers happy.
Also removed BASISU_NOTE_UNUSED on two variables that are no longer declared (resulting in a build error when BASISD_SUPPORT_UASTC was not defined)
Encoder is now a library in the "encoder" directory
JavaScript wrappers now expose the entire codec: encoder, transcoder, container independent transcoding, and .basis file information
(1 << num_bits) was converted to a signed integer that caused an overflow (as num_bits was usually set to 31). It worked fine since the value was later converted back to uint32_t but signed integer overflow is technically an undefined behavior and it was triggering errors in our automated tests.
Image slices have m_file_ofs. It is not relative to the start of the header, it is relative to the
start of the file. Double-check basisu_basis_file.cpp:
`m_images_descs[i].m_file_ofs = (uint32_t)cur_slice_file_ofs;`
basis_file_header has m_endpoint_cb_file_ofs. It might be easier to read if the comment on it
just said "file offset," but to clear up any confusion if someone is re-reading the spec later
this commit leaves the "relative to the" language but clarifies it. Ditto for
m_selector_cb_file_ofs.