25 Commits

Author SHA1 Message Date
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
Rich Geldreich
a416f59292 Adding output filename to "compression succeeded" message 2019-05-11 20:51:53 -07:00
Rich Geldreich
a84f169b06 Printing per-image information in -validate command. 2019-05-11 20:36:35 -07:00
Rich Geldreich
d7b22fc404 Adding -fuzz_testing command line option, which disables the file data CRC16 check used by the -validate command. To fuzz testing using zzuf on Linux:
zzuf -d -c -s 1000000:2000000 ./basisu -validate -fuzz_testing kodim23.basis
2019-05-09 12:43:59 -07:00
Rich Geldreich
c7e14a97fa - Fixing minor block artifacts on pure 2 color B&W blocks when transcoding to BC1/BC7. This was caused by the ETC1S blocks using extreme ETC1S settings: codetable 7 (the one with the largest intensity deltas), using blocks with selectors that took up the full range (0-3), but the blocks only actually used the two outlier colors (0 and 3 only). The ETC1S->BC1/BC7 table based format conversion system doesn't realize that only the outlie colors were going to be used (i.e. not all 4 colors, just the outer 2), and so the quality of the transcoded block suffered because pure black could not be mapped. In BC7 mode, we now switch to pure BCT (block truncation coding) for any blocks with <= 2 unique colors, independent of their selectors.
- Adding -csv_file option, to generate .csv files for mass benchmarking/testing
- Adding -no_ktx option, to avoid writing large .KTX files while unpacking
- Fixing printf() format issue when one of the -multifile options wasn't correct
Rebuilt compiled javascript transcoder
2019-05-09 10:44:38 -07:00
Rich Geldreich
130eb9f115 Major compression performance/quality improvements, for a 15-35% or so decrease in file size for the same Y PSNR/SSIM. The basis file format has changed due to these optimizations.
Increasing the max codebook size to 16K vs. 8K, for a major increase in the max achievable quality.
Adding exception catching to command line tool.
Enabling debug iterators on MSVC.
Refining command line options, adding "-individual" flag to create multiple .basis files (vs. a texture array).
Changing default colorspace to sRGB, because that's probably the best default. -linear disables this and uses linear colorspace metrics.
PNG reader in 32-bit builds checks the size of the file before loading to avoid out of memory exceptions.
2019-05-07 15:52:54 -07:00
Rich Geldreich
d0d34b9872 Fixing help text 2019-05-02 16:14:57 -07:00
Rich Geldreich
33996b1a5f Important: Changing the Basis file version, so any existing files will need to be recompressed!
Adding new fields to the basis header: texture type and framerate. Texture type may be 2D, 2D array, video, volume, or cubemap array. The compressor makes sure that anything other than pure 2D follows certain constraints (cubemap arrays must have a multiple of 6 input images, videos/texture array images all must have the same resolution/# of mipmaps, etc.)
When unpacking cubemaps, the -unpack command now writes cubemap .KTX files which various tools like PVRTexTool support.
2019-05-02 16:09:11 -07:00
Rich Geldreich
a36946edce Adjust compressor to deal with transcoder changes (start_decoding() renamed to start_transcoding), fixing compile warnings 2019-04-30 20:02:22 -07:00
Rich Geldreich
16c9e35c45 Removing detex dependency
Adding new GPU texture format decoders for BC1/4/5, ETC2 EAC alpha, and BC7 mode 6
Adding GPU texture unpack failure checks and warnings
Adding support for 3 color blocks to transcoder, and making sure that BC3 blocks will never use 3 color (punchthrough alpha) blocks.
2019-04-30 13:50:01 -07:00
Rich Geldreich
1e4eb6dc7c Command line parser fix 2019-04-29 22:00:06 -07:00
Rich Geldreich
fb07f0e805 Initial checkin. Compiles with Visual Studio 2019, or under Ubuntu Linux using either clang 3.8 or gcc 5.4. 2019-04-29 18:50:54 -07:00