Pre-condition block compressed textures with Brotli-G

Originally posted:
Shashank Ranjan's avatar
Shashank Ranjan

Brotli-G (v1.1 onwards) now supports pre-conditioning of block compressed textures, which is designed to improve the compression ratio of these files by on average between 10% to 15% and in some cases as much as 20%. The BrotliG::BrotligDataconditionParams option of Brotli-G Encoder API allows the user to enable pre-conditioning for supported texture types and provides information about the texture that is required for pre-conditioning, such as width, height, pitch, and number of mip levels.

Terminal window
brotlig.exe -precondition -texture-width 256 -texture-height 256 -row-pitch 2048 -num-mip-levels 5 abc.DDS

Pre-conditioning employs block swizzling and delta encoding of color. These can be enabled or disabled by setting BrotliG::BrotligDataconditionParams::swizzle and BrotliG::BrotligDataconditionParams::delta_encode flags, providing additional control.

If the texture is ill-formatted, compression is applied without pre-conditioning and a warning is displayed if the appropriate feedback function is provided.

Brotli-G currently supports pre-conditioning of BC1-5 textures. Supported texture formats are listed in the enum BROTLIG_DATA_FORMAT (common/BrotligCommon.h). Textures with multiple mip levels are supported. Limits on textures sizes and mip levels can be found in common/BrotligConstants.h. For more usage details, refer to the help section of the sample application.

Note, a known issue on AMD Renoir causes the GPU Decoder to fail intermittently if pre-conditioning is applied.

The latest release of Brotli-G SDK is available on GitHub.

Shashank Ranjan's avatar

Shashank Ranjan

Shashank Ranjan is a senior Software Development Engineer in the DirectML team at AMD. His work primarily focuses on GPU performance and stability of DirectML applications.

Related news and technical articles