XUASTC-LDR-log_astc_block-Structure

This content was automatically converted from the project's wiki Markdown to HTML. See the Basis Universal GitHub wiki for the latest content.

XUASTC LDR - log_astc_block Structure

Copyright (C) 2025-2026 Binomial LLC. All rights reserved except as granted under the Apache 2.0 LICENSE. If you modify the Basis Universal source code, specifications, or wiki documents and redistribute the files, you must cause any modified files to carry prominent notices stating that you changed the files (see Apache 2.0 ยง4(b)).

Introduction

This document provides a minimal specification for the log_astc_block structure and associated ASTC specific constants, which represents the logical (decoded) form of a physical 128-bit ASTC (Adaptive Scalable Texture Compression) block. The log_astc_block is heavily used in XUASTC LDR decoding within the Basis Universal library, losslessly abstracting an ASTC block's configuration, endpoints, weights, and partitions for efficient transcoding and decompression.

At a high level, log_astc_block parses or holds the decoded components extracted from physical ASTC blocks: flags for errors or solid colors, weight grid dimensions, mode flags (e.g., dual-plane), weight and endpoint quantization ranges (ISE/BISE), partition details, per-partition Color Endpoint Mode (CEM) indices, weight grid values, and CEM encoded endpoint values. It interacts with packing/unpacking routines (e.g., pack_astc_block, unpack_block) to convert between physical (bitstream) and logical forms.

This spec covers only this structure, its members, and directly associated constants/enums. Refer to the full Khronos ASTC specification for broader format details. This spec is structured with constants/limits first, followed by enums, then the structure with field descriptions.

Also see List of Available Software ASTC Decoders, which has a section on known ASTC spec issues, and links to two logical to physical ASTC block packers.

Constants and Limits

These define bounds and limits for the logical block, ensuring valid configurations during decoding/packing. They control grid sizes, partitions, weights, endpoints, and ISE ranges, preventing overflows or invalid states.

log_astc_block Structure

This structure holds the logical decoded state of an ASTC block, used for unpacking from physical bitstream or packing to it. It abstracts configuration for LDR decoding (integer endpoints/weights) while supporting HDR flags/values. Fields are validated during pack/unpack; invalid configs set error flag.

These members are only valid if the block is not an error block and not solid color (void-extent):