Commit Graph

61 Commits

Author SHA1 Message Date
Richard Geldreich
e8855f8840 Compiler warning fixes.
Cleaning up handling of 8-byte lengths/offsets in KTX2 files. (In practice, we don't currently accept files this large anyway.)
2025-09-20 10:10:08 -04:00
Richard Geldreich
f96fece6ee typo fix 2025-09-05 21:13:10 -04:00
Richard Geldreich
42c21d8066 removing unnecessary #include (which was used for testing) 2025-03-22 17:12:16 -04:00
Richard Geldreich, Jr.
b7ce25fd02 Windows ARM fixes 2025-02-19 15:09:52 -05:00
Richard Geldreich
1ba75b4e34 ASTC 6x6 HDR/6x6 HDR intermediate update 2025-01-21 11:01:08 -05:00
Richard Geldreich
1d56bfd544 Modifying UASTC HDR DFD 2024-09-10 20:48:20 -04:00
Richard Geldreich
0a546490db Removing unused code 2024-09-10 15:35:17 -04:00
Richard Geldreich
3124cf62fd UASTC HDR merge 2024-09-10 14:50:23 -04:00
Richard Geldreich
82d2c35e0f Adding -compare_plot command, and defaulting to not displaying plots in -compare mode 2023-04-13 00:54:16 -04:00
Richard Geldreich
bc31d6a002 Adding more ETC1S testing code. -test now validates ETC1S level 128, in addition to the previous level 1. Tested with MSVC 2019, gcc and clang so far. 2023-04-12 18:19:40 -04:00
Richard Geldreich
7f5e0ad6c2 Adding support for utf-8 text and file I/O under Windows. Requires newer Windows builds:
https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page
2023-03-30 16:12:45 -04:00
Richard Geldreich
c86a40c7e6 Adding -clbench command line option, and a new API basis_benchmark_etc1s_opencl() to determine if OpenCL encoding is worthwhile on the current machine/driver/GPU. 2022-10-07 19:33:34 -04:00
Richard Geldreich
9009cae540 Fixing -format_only so the uncompressed formats aren't unpacked when this option is used. 2022-06-09 11:57:44 -05:00
Rich Geldreich
c163d635c2 Merge pull request #287 from dpwiz/only-format
Add `-format_only` option
2022-06-09 11:50:46 -05:00
Richard Geldreich
1531cfaf9e Bumping version to 1.16.3
Fixing unused var warnings in MSVC
2022-02-24 19:46:57 -05:00
Richard Geldreich
44e1bcd3e1 Fixing some bugs related to changing the default from -tex_array to -individual:
- If -output_file is specified and there's more than 1 input, it errors out as this would overwrite the output file multiple times
- Tex types cubemap/3D default to tex_array mode
2022-02-11 21:28:52 -05:00
IC Rainbow
65bbcddaf3 Add -format_only option
A more flexible variant of `-etc1_only`.

Works well with `-ktx_only` to produce a specific output.
2022-02-05 00:06:07 +03:00
Richard Geldreich
aa987502fe trying to shut up git diff 2022-01-28 10:08:07 -05:00
Richard Geldreich
8ee9498d93 Adding newline to end of file 2022-01-28 09:38:03 -05:00
Richard Geldreich
deeb5acb56 v1.16 release: OpenCL support, removing global selector palette code (it was unused/dead code), ETC1S encoding optimizations, -parallel command line option 2022-01-28 08:32:54 -05:00
Arseny Kapoulkine
0eb541a118 Implement custom resampling command line args
This change implements -resample X Y command line support in addition to
-resample_factor, when a more sophisticated algorithm is needed to
compute the desired image size.

For example, these can be used to round the image to a multiple of 4 or
to a power of 2 for improved compatibility with various graphics APIs.
2021-04-14 21:13:19 -07:00
Rich Geldreich
48a5914a73 - Fixing ETC1S backend endpoint palette related bug that was causing a CRC check to fail on the decompressed data during compression.
- Fixing -etc1_only option so it doesn't write uncompressed image formats.
2021-04-13 14:58:28 -04:00
Rich Geldreich
7f0a00afe1 Adding KTX2 transcoding/encoding/decompression to PNG/KTX1 support to the transcoder, encoder, JavaScript wrappers. This is also adding Zstandard to the repo, which is optional. Set BASISD_SUPPORT_KTX2_ZSTD=0 when compiling the encoder/transcoder to disable it, or from cmake set KTX2_ZSTANDARD=FALSE. 2021-04-12 13:30:45 -04:00
Rich Geldreich
041ad47c27 - Global codebook related fixes
- 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.)
2021-03-31 00:01:52 -04:00
Rich Geldreich
bf13257528 Merge branch 'branch' 2021-03-30 14:53:22 -04:00
Rich Geldreich
053ed374b4 In progress global codebook changes 2021-03-30 14:51:26 -04:00
JCash
2c0c038ffe Renamed to minimum/maximum 2021-03-30 19:17:50 +02:00
JCash
03cca3778e Replaced std::min/std::max with basisu::min/basisu::max
Removed use of NOMINMAX
2021-03-30 18:44:07 +02:00
Rich Geldreich
b5334deb8a Putting miniz into its own C++ namespace to fix clashes 2021-03-13 09:52:35 -05:00
Rich Geldreich
2d4fe933b2 Basis Universal v1.13:
- 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")
2021-03-09 11:00:25 -05:00
Rich Geldreich
85fa18ec94 Adding encoder WebAssembly support, encode_test sample
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
2020-12-17 14:26:28 -05:00
Donovan Hutchence
ef7d326654 apply swizzle patch 2020-11-17 09:03:29 +00:00
Rich Geldreich
76fa25921e Fixing command line help text related to mipmap filtering & sRGB. 2020-04-09 00:03:51 -04:00
Rich Geldreich
078ce180bc Adding JPEG reading support 2020-03-25 05:24:37 -04:00
Rich Geldreich
12889dfe9d Adding -renorm option, manually merged from
29db2936fe
2020-03-22 23:53:05 -04:00
Rich Geldreich
3d4a39a147 Adding TGA reading support 2020-03-22 23:44:25 -04:00
Rich Geldreich
f46b9231db Updating help text for BMP support 2020-03-20 20:16:18 -04:00
Rich Geldreich
5b6eb565e4 - Adding UASTC support to encoder, transcoder, .basis file format
- Removing BC7 mode 6 support from transcoder (will alway use the much smaller mode 5 tables now)
- Adding BMP support
- Adding -bench mode, for development
- CMakeLists.txt file now compatible with Visual Studio 2019 (MSVC)
2020-03-20 02:00:34 -04:00
richgel999
765706364d Fixing spelling in -separate_rg_to_color_alpha 2020-01-03 21:37:45 -08:00
Arseny Kapoulkine
9a605b4f4d Add -version argument/mode
This allows external programs to confirm the existence of basisu
executable by running `basisu -version`.
2019-11-27 17:27:29 +01:00
richgel999
01d391cc2a PVRTC1 apparently always use wrap addressing when fetching the adjacent block colors (even when clamp texture addressing is being used), so we don't need the wrap vs. clamp option anymore. It's always wrap and that's that. 2019-09-29 19:34:00 -07:00
richgel999
9be4e210ff Adding -pvrtc_clamp command line flag, so we can see what PVRTC1 textures look like when transcoded and unpacked with clamp addressing 2019-09-29 18:41:57 -07:00
richgel999
54304fa014 - Adding PVRTC2 RGB/RGBA and ETC2 EAC R11 and RG11
- Renaming -no_auto_global_sel_pal to -auto_global_sel_pal, disabling global selector palette usage by default to speed up compression on small images
- Renaming texture format enums
- Fixing uninitialized memory issue in front end - it wouldn't have affected the correctness of the output, or output quality
- Bumping command line tool up to v1.10
2019-09-26 22:35:14 -07:00
richgel999
3629438d43 Transcoder update: ASTC 4x4 RGB/RGBA, ATC RGB/RGBA, BC7 mode 5 RGBA, PVRTC1 4bpp RGBA, and uncompressed raster formats. 2019-09-19 12:29:44 -07:00
Rich Geldreich
7d784c7288 Correcting the copyright date, as all of the Basis Universal code was written during/after April '19. 2019-06-09 18:29:41 -07:00
richgel999
ab722fa2e1 - Adding support for skip blocks, i-frames and p-frames to the backend and transcoder, for texture video use.
- For PVRTC1, we now memset() any extra blocks after the blocks we know will be transcoded into. This is done because in GL there is padding that occurs on textures smaller than 8x8.
- Removing all OpenMP usage and replacing it with a basis C++11 job system.
- Fixing TSVQ class so it can split very long "thin" clusters that before weren't being split. This improves endpoint quantization on videos and complex 2D textures.
- More frontend perf. optimizations.

Tested on OSX, Linux with gcc/clang, and Win using MSVC 2019.
2019-06-07 20:35:38 -07:00
Rich Geldreich
f631b29a7e Frontend optimizations: Adding multiple compression levels to the encoder's frontend. Level 2 and 4 are equivalent to the initial release (default or -slower). Level 1 is now the new default, and is on average 21% faster than level 2. (Or more, up to 2-2.5x, on large images.) The help text documents what encoder features are used in each level. Level 0 is fine for most images, but is weak on artificial images and really large complex images. -slower now sets level 2 (not 4).
Adding -only_etc1 command line option, because sometimes during unpack you only want the ETC1 images.

Total timing and avg. Y PSNR across 59 test images, quality 128:

L Time PSNR
0 121.4	35.45
1 172.4	36.87
2 216.0	37.13
3 511.4	37.15
4 665.9	37.41
5 1483.4	37.43

Initial release:
L Time PSNR
0 216.77	37.13
1 701.84	37.41
2019-05-31 15:14:58 -07:00
Rich Geldreich
dd29d75471 Default mipmap filtering now follows the -linear option. Also updating tool help text, and bumping the version. 2019-05-28 17:11:38 -07:00
Rich Geldreich
c180a087b9 Minor transcoder update: Adding support for arbitrary output texture row pitches, for usage with the Vulkan rendering API. 2019-05-28 15:41:16 -07:00
richgel999
51fb74364f Fixing/updating basisu tool help text. 2019-05-18 17:32:23 -07:00