Update README.md

This commit is contained in:
Rich Geldreich
2019-05-20 10:57:09 -07:00
committed by GitHub
parent 75f356aba4
commit a148eff2d2

View File

@@ -1,11 +1,11 @@
# basis_universal
Basis Universal GPU Texture/Video Compression Reference Encoder
Basis Universal GPU Texture and Texture Video Reference Encoder
Basis Universal is a ["supercompressed"](http://gamma.cs.unc.edu/GST/gst.pdf) GPU texture and video compression system that outputs a highly compressed intermediate file format (.basis) that can be quickly transcoded to a wide variety of GPU texture compression formats: PVRTC1 4bpp RGB, BC7 mode 6 RGB, BC1-5, ETC1, and ETC2. We will be adding ASTC RGB or RGBA, BC7 mode 4/5 RGBA, and PVRTC1 4bpp RGBA next. Basis files support non-uniform texture arrays, so cubemaps, volume textures, texture arrays, mipmap levels, video sequences with I-Frames and P-Frames using Conditional Replenishment (CR), or arbitrary texture "tiles" can be stored in a single file.
Basis Universal is a ["supercompressed"](http://gamma.cs.unc.edu/GST/gst.pdf) GPU texture and texture video compression system that outputs a highly compressed intermediate file format (.basis) that can be quickly transcoded to a wide variety of GPU texture compression formats: PVRTC1 4bpp RGB, BC7 mode 6 RGB, BC1-5, ETC1, and ETC2. We will be adding ASTC RGB or RGBA, BC7 mode 4/5 RGBA, and PVRTC1 4bpp RGBA next. Basis files support non-uniform texture arrays, so cubemaps, volume textures, texture arrays, mipmap levels, video sequences with I-Frames and P-Frames using Conditional Replenishment (CR), or arbitrary texture "tiles" can be stored in a single file.
The compressor is able to exploit color and pattern correlations across the entire file, so multiple images with mipmaps can be stored very efficiently in a single file. For video, the system is able to entirely skip blocks which don't change from the previous frame, which can be very effective on videos with mostly static backgrounds.
The system's bitrate depends on the quality setting and image content, but common usable bitrates are .3-1.25 bits/texel. .basis files are typically 10-25% smaller than using RDO texture compression of the internal texture data stored in the .basis file followed by LZMA. For video, the average bitrate will highly depend on how dynamic the content is, but we usually get around .3-.5 bits/texel on average across long video sequences. The current system is what we've been calling the "baseline" system, which is designed to reach all the GPU formats. The next major step is to extend the system to allow for much higher quality for the ASTC and BC7 texture formats.
The system's bitrate depends on the quality setting and image content, but common usable bitrates are .3-1.25 bits/texel. .basis files are typically 10-25% smaller than using RDO texture compression of the internal texture data stored in the .basis file followed by LZMA. For video, the average bitrate will highly depend on how dynamic the content is, but we usually get around .3-.5 bits/texel on average across long video sequences. (This is roughly comparable to the bitrate of MPEG 1, although we output ETC1S etc. texture data so our PSNR will be lower.) The current system is what we've been calling the "baseline" system, which is designed to reach all the GPU formats. The next major step is to extend the system to allow for much higher quality for the ASTC and BC7 texture formats.
The transcoder has been fuzz tested using [zzuf](https://www.linux.com/news/fuzz-testing-zzuf).
@@ -65,7 +65,9 @@ To compress small video sequences, say using tools like ffmpeg and VirtualDub:
'basisu -slower -tex_type video -framerate 25 -stats -debug -multifile_printf "pic%04u.png" -multifile_num 200 -multifile_first 1 -max_selectors 16128 -max_endpoints 16128'
We just added video to the system, and please be aware that we're still tuning and optimizing the system for video. The reference encoder will take a LONG time and a lot of CPU to encode video, especially with -slower. (-slower is needed to generate better codebooks, which many videos need.) 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. Over time, we will be optimizing the codebook generators for higher performance, especially with video.
The "-tex_type video" option is critical: Without it you don't get P-Frames using CR (conditional replenishment). It switches the codec into video mode.
We just added video to the system, and please be aware that we're still tuning and optimizing the system for this use. The reference encoder will take a LONG time and a lot of CPU to encode video, especially with -slower. (-slower is needed to generate better codebooks, which many videos need.) 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. Over time, we will be optimizing the codebook generators for higher performance, especially with video.
The .basis file will contain multiple images (all using the same global codebooks), which you can retrieve using the transcoder's image API. For videos, the images must be requested from the transcoder in sequence from first to last, and random access is only allowed to I-Frames. Currently, the first image is always an I-Frame, and all subsequent images are P-Frames that can use CR. Videos can optionally contain mipmaps and alpha channels.