Skip to content

Commit e7c3969

Browse files
committed
Commit files changed by the formatting script
Remove trailing space characters
1 parent 1aff277 commit e7c3969

File tree

82 files changed

+2450
-2450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2450
-2450
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ if (NOT MSVC)
6262
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=0")
6363
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=0")
6464
endif()
65-
65+
6666
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -static-libgcc -static-libstdc++ -static")
6767
else()
6868
if (SSE)
@@ -72,7 +72,7 @@ if (NOT MSVC)
7272
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBASISU_SUPPORT_SSE=0")
7373
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBASISU_SUPPORT_SSE=0")
7474
endif()
75-
75+
7676
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -Wl,-rpath .")
7777
endif()
7878

@@ -93,7 +93,7 @@ else()
9393
endif()
9494
endif()
9595

96-
set(BASISU_SRC_LIST ${COMMON_SRC_LIST}
96+
set(BASISU_SRC_LIST ${COMMON_SRC_LIST}
9797
basisu_tool.cpp
9898
encoder/basisu_backend.cpp
9999
encoder/basisu_basis_file.cpp
@@ -143,7 +143,7 @@ endif()
143143

144144
if (NOT EMSCRIPTEN)
145145
install(TARGETS basisu DESTINATION bin)
146-
146+
147147
if (UNIX)
148148
if (CMAKE_BUILD_TYPE STREQUAL Release)
149149
if (APPLE)

LICENSES/Apache-2.0.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ AND DISTRIBUTION
77

88
1. Definitions.
99

10-
10+
1111

1212
"License" shall mean the terms and conditions for use, reproduction, and distribution
1313
as defined by Sections 1 through 9 of this document.
1414

15-
15+
1616

1717
"Licensor" shall mean the copyright owner or entity authorized by the copyright
1818
owner that is granting the License.
1919

20-
20+
2121

2222
"Legal Entity" shall mean the union of the acting entity and all other entities
2323
that control, are controlled by, or are under common control with that entity.
@@ -26,31 +26,31 @@ or indirect, to cause the direction or management of such entity, whether
2626
by contract or otherwise, or (ii) ownership of fifty percent (50%) or more
2727
of the outstanding shares, or (iii) beneficial ownership of such entity.
2828

29-
29+
3030

3131
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions
3232
granted by this License.
3333

34-
34+
3535

3636
"Source" form shall mean the preferred form for making modifications, including
3737
but not limited to software source code, documentation source, and configuration
3838
files.
3939

40-
40+
4141

4242
"Object" form shall mean any form resulting from mechanical transformation
4343
or translation of a Source form, including but not limited to compiled object
4444
code, generated documentation, and conversions to other media types.
4545

46-
46+
4747

4848
"Work" shall mean the work of authorship, whether in Source or Object form,
4949
made available under the License, as indicated by a copyright notice that
5050
is included in or attached to the work (an example is provided in the Appendix
5151
below).
5252

53-
53+
5454

5555
"Derivative Works" shall mean any work, whether in Source or Object form,
5656
that is based on (or derived from) the Work and for which the editorial revisions,
@@ -59,7 +59,7 @@ original work of authorship. For the purposes of this License, Derivative
5959
Works shall not include works that remain separable from, or merely link (or
6060
bind by name) to the interfaces of, the Work and Derivative Works thereof.
6161

62-
62+
6363

6464
"Contribution" shall mean any work of authorship, including the original version
6565
of the Work and any modifications or additions to that Work or Derivative
@@ -74,7 +74,7 @@ for the purpose of discussing and improving the Work, but excluding communicatio
7474
that is conspicuously marked or otherwise designated in writing by the copyright
7575
owner as "Not a Contribution."
7676

77-
77+
7878

7979
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
8080
of whom a Contribution has been received by Licensor and subsequently incorporated

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# basis_universal
22
Basis Universal Supercompressed GPU Texture Codec
33

4-
Basis Universal is a ["supercompressed"](http://gamma.cs.unc.edu/GST/gst.pdf) GPU texture data interchange system that supports two highly compressed intermediate file formats (.basis or the [.KTX2 open standard from the Khronos Group](https://github.khronos.org/KTX-Specification/)) that can be quickly transcoded to a [very wide variety](https://github.com/BinomialLLC/basis_universal/wiki/OpenGL-texture-format-enums-table) of GPU compressed and uncompressed pixel formats: ASTC 4x4 L/LA/RGB/RGBA, PVRTC1 4bpp RGB/RGBA, PVRTC2 RGB/RGBA, BC7 mode 6 RGB, BC7 mode 5 RGB/RGBA, BC1-5 RGB/RGBA/X/XY, ETC1 RGB, ETC2 RGBA, ATC RGB/RGBA, ETC2 EAC R11 and RG11, FXT1 RGB, and uncompressed raster image formats 8888/565/4444.
4+
Basis Universal is a ["supercompressed"](http://gamma.cs.unc.edu/GST/gst.pdf) GPU texture data interchange system that supports two highly compressed intermediate file formats (.basis or the [.KTX2 open standard from the Khronos Group](https://github.khronos.org/KTX-Specification/)) that can be quickly transcoded to a [very wide variety](https://github.com/BinomialLLC/basis_universal/wiki/OpenGL-texture-format-enums-table) of GPU compressed and uncompressed pixel formats: ASTC 4x4 L/LA/RGB/RGBA, PVRTC1 4bpp RGB/RGBA, PVRTC2 RGB/RGBA, BC7 mode 6 RGB, BC7 mode 5 RGB/RGBA, BC1-5 RGB/RGBA/X/XY, ETC1 RGB, ETC2 RGBA, ATC RGB/RGBA, ETC2 EAC R11 and RG11, FXT1 RGB, and uncompressed raster image formats 8888/565/4444.
55

66
The system now supports two modes: a high quality mode which is internally based off the [UASTC compressed texture format](https://richg42.blogspot.com/2020/01/uastc-block-format-encoding.html), and the original lower quality mode which is based off a subset of ETC1 called "ETC1S". UASTC is for extremely high quality (similar to BC7 quality) textures, and ETC1S is for very small files. The ETC1S system includes built-in data compression, while the UASTC system includes an optional Rate Distortion Optimization (RDO) post-process stage that conditions the encoded UASTC texture data in the .basis file so it can be more effectively LZ compressed by the end user. More technical details about UASTC integration are [here](https://github.com/BinomialLLC/basis_universal/wiki/UASTC-implementation-details).
77

@@ -11,7 +11,7 @@ The system's bitrate depends on the quality setting and image content, but commo
1111

1212
The .basis and .KTX2 transcoders have been fuzz tested using [zzuf](https://www.linux.com/news/fuzz-testing-zzuf).
1313

14-
So far, we've compiled the code using MSVC 2019, under Ubuntu 18.04 and 20 x64 using cmake with either clang 3.8 or gcc 5.4, and emscripten 1.35 to asm.js. (Be sure to use this version or later of emcc, as earlier versions fail with internal errors/exceptions during compilation.)
14+
So far, we've compiled the code using MSVC 2019, under Ubuntu 18.04 and 20 x64 using cmake with either clang 3.8 or gcc 5.4, and emscripten 1.35 to asm.js. (Be sure to use this version or later of emcc, as earlier versions fail with internal errors/exceptions during compilation.)
1515

1616
Basis Universal supports "skip blocks" in ETC1S compressed texture arrays, which makes it useful for basic [compressed texture video](http://gamma.cs.unc.edu/MPTC/) applications. Note that Basis Universal is still at heart a GPU texture compression system, not a dedicated video codec, so bitrates will be larger than even MPEG1.
1717
1/10/21 release notes:
@@ -28,11 +28,11 @@ https://www.losinglena.com/
2828

2929
### Quick Introduction
3030

31-
Probably the most important concept to understand about Basis Universal before using it: The system supports **two** very different universal texture modes: The original "ETC1S" mode is low/medium quality, but the resulting file sizes are very small because the system has built-in compression for ETC1S texture format files. This is the command line encoding tool's default mode. ETC1S textures work best on images, photos, map data, or albedo/specular/etc. textures, but don't work as well on normal maps.
31+
Probably the most important concept to understand about Basis Universal before using it: The system supports **two** very different universal texture modes: The original "ETC1S" mode is low/medium quality, but the resulting file sizes are very small because the system has built-in compression for ETC1S texture format files. This is the command line encoding tool's default mode. ETC1S textures work best on images, photos, map data, or albedo/specular/etc. textures, but don't work as well on normal maps.
3232

3333
There's the second "UASTC" mode, which is significantly higher quality (comparable to BC7 and highest quality LDR ASTC 4x4), and is usable on all texture types including complex normal maps. UASTC mode purposely does not have built-in file compression like ETC1S mode does, so the resulting files are quite large (8-bits/texel - same as BC7) compared to ETC1S mode. The UASTC encoder has an optional Rate Distortion Optimization (RDO) encoding mode (implemented as a post-process over the encoded UASTC texture data), which conditions the output texture data in a way that results in better lossless compression when UASTC .basis files are compressed with Deflate/Zstd, etc. In UASTC mode, you must losslessly compress .basis files yourself. .KTX2 files have built-in lossless compression support using [Zstandard](https://facebook.github.io/zstd/), which is used by default on UASTC textures.
3434

35-
Basis Universal is not an image compression codec, but a GPU texture compression codec. It can be used just like an image compression codec, but that's not the only use case. Here's a [good intro](http://renderingpipeline.com/2012/07/texture-compression/) to GPU texture compression. If you're looking to primarily use the system as an image compression codec on sRGB photographic content, use the default ETC1S mode, because it has built-in compression.
35+
Basis Universal is not an image compression codec, but a GPU texture compression codec. It can be used just like an image compression codec, but that's not the only use case. Here's a [good intro](http://renderingpipeline.com/2012/07/texture-compression/) to GPU texture compression. If you're looking to primarily use the system as an image compression codec on sRGB photographic content, use the default ETC1S mode, because it has built-in compression.
3636

3737
**The "-q X" option controls the output quality in ETC1S mode.** The default is quality level 128. "-q 255" will increase quality quite a bit. If you want even higher quality, try "-max_selectors 16128 -max_endpoints 16128" instead of -q. -q internally tries to set the codebook sizes (or the # of quantization intervals for endpoints/selectors) for you. You need to experiment with the quality level on your content.
3838

@@ -54,7 +54,7 @@ The encoder optionally uses Zstandard's single source file compressor (in zstd/z
5454

5555
### Command Line Compression Tool
5656

57-
The command line tool used to create, validate, and transcode/unpack .basis/.KTX2 files is named "basisu". Run basisu without any parameters for help.
57+
The command line tool used to create, validate, and transcode/unpack .basis/.KTX2 files is named "basisu". Run basisu without any parameters for help.
5858

5959
The library and command line tool have no other 3rd party dependencies (that are not already in the repo), so it's pretty easy to build.
6060

@@ -145,7 +145,7 @@ The mipmapped or cubemap .KTX files will be in a wide variety of compressed GPU
145145

146146
After compression, the compressor transcodes all slices in the output .basis file to validate that the file decompresses correctly. It also validates all header, compressed data, and slice data CRC16's.
147147

148-
For best quality, you must **supply basisu with original uncompressed source images**. Any other type of lossy compression applied before basisu (including ETC1/BC1-5, BC7, JPEG, etc.) will cause multi-generational artifacts to appear in the final output textures.
148+
For best quality, you must **supply basisu with original uncompressed source images**. Any other type of lossy compression applied before basisu (including ETC1/BC1-5, BC7, JPEG, etc.) will cause multi-generational artifacts to appear in the final output textures.
149149

150150
For the maximum possible achievable ETC1S mode quality with the current format and encoder (completely ignoring encoding speed!), use:
151151

@@ -162,7 +162,7 @@ To compress small video sequences, say using tools like ffmpeg and VirtualDub:
162162
For video, the more cores your machine has, the better. Basis is intended for smaller videos of a few dozen seconds or so. If you are very patient and have a Threadripper or Xeon workstation, you should be able to encode up to a few thousand 720P frames. The "webgl_videotest" directory contains a very simple video viewer.
163163
For texture video, use -comp_level 2 or 3. The default is 1, which isn't quite good enough for texture video. Higher comp_level's result in reduced ETC1S artifacts.
164164

165-
The .basis file will contain multiple images (all using the same global codebooks), which you can retrieve using the transcoder's image API. The system now supports [conditional replenisment](https://en.wikipedia.org/wiki/MPEG-1) (CR, or "skip blocks"). CR can reduce the bitrate of some videos (highly dependent on how dynamic the content is) by over 50%. For videos using CR, the images must be requested from the transcoder in sequence from first to last, and random access is only allowed to I-Frames.
165+
The .basis file will contain multiple images (all using the same global codebooks), which you can retrieve using the transcoder's image API. The system now supports [conditional replenisment](https://en.wikipedia.org/wiki/MPEG-1) (CR, or "skip blocks"). CR can reduce the bitrate of some videos (highly dependent on how dynamic the content is) by over 50%. For videos using CR, the images must be requested from the transcoder in sequence from first to last, and random access is only allowed to I-Frames.
166166

167167
If you are doing rate distortion comparisons vs. other similar systems, be sure to experiment with increasing the endpoint RDO threshold (-endpoint_rdo_thresh X). This setting controls how aggressively the compressor's backend will combine together nearby blocks so they use the same block endpoint codebook vectors, for better coding efficiency. X defaults to a modest 1.5, which means the backend is allowed to increase the overall color distance by 1.5x while searching for merge candidates. The higher this setting, the better the compression, with the tradeoff of more block artifacts. Settings up to ~2.25 can work well, and make the codec more competitive. "-endpoint_rdo_thresh 1.75" is a good setting on many textures.
168168

@@ -208,7 +208,7 @@ Compress a 20 sRGB source image video sequence (x01.png, x02.png, x03.png, etc.)
208208
`basisu -comp_level 2 -q 255 -file x.png -mipmap -y_flip`\
209209
Compress a mipmapped x.basis file from an sRGB image named x.png, Y flip each source image, set encoder to level 2 for slightly higher quality (but slower encoding).
210210

211-
### WebGL test
211+
### WebGL test
212212

213213
The "WebGL" directory contains three simple WebGL demos that use the transcoder and compressor compiled to wasm with [emscripten](https://emscripten.org/). See more details [here](webgl/README.md).
214214

@@ -232,7 +232,7 @@ The Basis Universal port in vcpkg is kept up to date by Microsoft team members a
232232

233233
Both the transcoder and now the compressor (as of 12/17/2020) may be compiled using emscripten to WebAssembly and used on the web. Currently, multithreading is not supported by the compressor when compiled with emscripten. A simple Web compression demo is in webgl/encode_test. All compressor features, including texture video, are supported and fully exposed.
234234

235-
To enable compression support compile the JavaScript wrappers in `webgl/transcoding/basis_wrappers.cpp` with `BASISU_SUPPORT_ENCODING` set to 1. See the webgl/encoding directory.
235+
To enable compression support compile the JavaScript wrappers in `webgl/transcoding/basis_wrappers.cpp` with `BASISU_SUPPORT_ENCODING` set to 1. See the webgl/encoding directory.
236236

237237
### Low-level C++ encoder API
238238

@@ -269,7 +269,7 @@ bool test()
269269
basisCompressorParams.m_debug = true;
270270
basisCompressorParams.m_status_output = true;
271271
basisCompressorParams.m_compute_stats = true;
272-
272+
273273
basisu::job_pool jpool(1);
274274
basisCompressorParams.m_pJob_pool = &jpool;
275275
@@ -312,7 +312,7 @@ a clean, checked-out repository periodically, or run it during CI tests
312312
before any build artifacts have been created.
313313

314314
### Special Thanks
315-
A huge thanks to Google for partnering with us and enabling this system to be open sourced.
315+
A huge thanks to Google for partnering with us and enabling this system to be open sourced.
316316

317317
Thank you to [Esri - Environmental Systems Research Institute](https://www.esri.com/) for sponsoring the encoder optimization work in the v1.13 release, and the KTX2 work in the v1.15 release.
318318

@@ -328,7 +328,7 @@ Thanks to Mike Dussault (SpaceX) and Elon Musk for supporting Binomial in the ea
328328

329329
Thanks to Graeme Devine at Magic Leap.
330330

331-
Thanks to Matt Pritchard, formerly of Valve Software and Microsoft, for helping me with the computer hardware I used while building this system and its predecessor.
331+
Thanks to Matt Pritchard, formerly of Valve Software and Microsoft, for helping me with the computer hardware I used while building this system and its predecessor.
332332

333333
Thanks to John Brooks at Blue Shift, Inc. for inspiring this work by showing me his Dreamcast texture compression system around 2002, and for releasing etc2comp. I first saw the subblock flip estimation approach (used in basisu_etc.cpp) in etc2comp.
334334

@@ -341,7 +341,7 @@ Thanks to Mark Callow at Edgewise Consulting for his work on glTF and the KTX2 f
341341
I first saw using precomputed tables for quickly computing optimal encodings of solid color blocks in ryg_dxt. The method that limits the canonical Huffman codelengths to a maximum codesize was used in Yoshizaki's lharc. The canonical Huffman codelength compression system is similar to Katz's Deflate method.
342342

343343
### Possible improvements
344-
The codebook generation process is basically a high quality, but slow and brute force reference. It's possible to massively speed up codebook gen in several ways. One way is to not throw away the tree structures constructed during the creation of the initial codebooks.
344+
The codebook generation process is basically a high quality, but slow and brute force reference. It's possible to massively speed up codebook gen in several ways. One way is to not throw away the tree structures constructed during the creation of the initial codebooks.
345345

346346
The way the -q (quality) option is converted to codebook sizes is very simple (fixed formulas), and could be improved. It has a tendency to plateau on some files.
347347

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
image:
3+
image:
44
- macos
55
- Ubuntu2004
66
- Visual Studio 2019

0 commit comments

Comments
 (0)