EP-4740458-A2 - OPTIMIZED COMPRESSION MODE SELECTION FOR BC7 TEXTURE ENCODING
Abstract
Techniques are described for training (2208) a machine learning (ML) model is learn compression errors for various compression modes of BC7 given an input set of features that depend on per-channel pixel value ranges in a BC7 block.
Inventors
- MADAMS, THOMAS
Assignees
- Sony Interactive Entertainment LLC
Dates
- Publication Date
- 20260513
- Application Date
- 20240612
Claims (20)
- 1. An apparatus comprising: at least one processor assembly configured to: calculate plural features based on per-channel ranges of pixels in at least a first block of texture data; based at least in part on the features, identify a block compression (BC) mode of compression; and compress the first block using the BC mode of compression.
- 2. The apparatus of Claim 1, wherein the BC mode of compression comprises a BC7 mode.
- 3. The apparatus of Claim 1, wherein the processor assembly is configured to: input to a machine learning (ML) model the features; and receive from the ML model identification of the BC mode of compression.
- 4. The apparatus of Claim 1, wherein at least one of the features is based at least in part on: a channel range that is the difference between maximum and minimum pixel values for a channel in a block or subset of a block.
- 5. The apparatus of Claim 4, wherein a maximum one of three RGB channel ranges in a block or subset of a block establishes the at least one of the features.
- 6. The apparatus of Claim 1, wherein at least one of the features is based at least in part on: a sum of RGB channel ranges in a block or subset of a block.
- 7. The apparatus of Claim 1, wherein at least one of the features is based at least in part on: a range of alpha values in a block or subset of a block.
- 8. A device comprising: at least one computer storage that is not a transitory signal and that comprises instructions executable by at least one processor assembly to: select a block compression 7 (BC7) mode of compression for texture data at least in part by: for each block in a training set of blocks of pixels, computing an error resulting in compressing the block in each of plural BC7 modes; for each block in the training set, computing at least one feature associated with a perchannel range of pixel values within the block; the features and errors being used by at least one machine learning (ML) model to train the model to predict per-mode compression error based on the features; and subsequently use the ML model to select a BC7 mode of compression for the texture data.
- 9. The device of Claim 8, wherein the instructions are executable to: subsequently use the ML model to select a BC7 mode of compression for the texture data at least in part by: calculating plural features based on per-channel ranges of pixels in at least a first block of texture data; inputting the features to the ML model; and receiving from the ML model a BC7 mode of compression with which to compress the first block using the BC7 mode of compression.
- 10. The device of Claim 9, wherein at least one of the features is based at least in part on: a channel range that is the difference between maximum and minimum pixel values for a channel in a block or subset of a block.
- 11. The device of Claim 10, wherein a maximum one of three RGB channel ranges in a block or subset of a block establishes at least one of the features.
- 12. The device of Claim 9, wherein at least one of the features is based at least in part on: a sum of RGB channel ranges in a block or subset of a block.
- 13. The device of Claim 9, wherein at least one of the features is based at least in part on: a range of alpha values in a block or subset of a block.
- 14. A method for processing texture blocks, comprising: computing a channel range that is the difference between maximum and minimum pixel values for a channel in a block or subset of a block, wherein a maximum one of three RGB channel ranges in a block or subset of a block establishes a first feature; computing a sum of RGB channel ranges in the block or subset of the block to establish a second feature; computing a range of alpha values in the block or subset of the block to establish a third feature; and using the first, second, and third features to identify a block compression mode of compression for the block.
- 15. The method of Claim 14, wherein the block compression mode comprises a BC7 mode.
- 16. The method of Claim 15, comprising: training a machine learning (ML) model to predict which BC7 mode results in a lower predicted error than other BC7 modes for a given input set of features.
- 17. The method of Claim 16, comprising training the ML model at least in part by: for each block in a training set of blocks of pixels, computing an error resulting in compressing the block in each of plural BC7 modes; for each block in the training set, computing at least one feature associated with a perchannel range of pixel values within the block; the features and errors being used by the ML model for training the ML model to predict per-mode compression error based on the features.
- 18. The method of Claim 14, comprising: using the block compression mode of compression to compress for the block for storage and/or transmission of the block
- 19. The method of Claim 18, comprising storing the block after compression.
- 20. The method of Claim 18, comprising transmitting the block after compression to a rendering device to render a computer graphics texture on a display.
Description
OPTIMIZED COMPRESSION MODE SELECTION FOR BC7 TEXTURE ENCODING FIELD The present application relates to technically inventive, non-routine solutions that are necessarily rooted in computer technology and that produce concrete technical improvements, and more specifically to optimized compression mode selection for BC7 texture encoding. BACKGROUND In computer simulations such as computer gaming, objects are rendered in part using “texture” data that describes the surfaces of the objects. The more texture data for a given object, the higher resolution the rendering can be. However, for bandwidth purposes it is desirable not to send large texture data structures to a rendering device. SUMMARY As understood herein, to conserve memory, texture data is usually compressed into one of a variety of block compression (BCn) modes that are natively sample-able on GPUs. BC6 and BC7 are of particular relevance to present principles. Accordingly, an apparatus includes at least one processor assembly configured to calculate plural features based on per-channel ranges of pixels in at least a first block of texture data, and based at least in part on the features, identify a block compression (BC) mode of compression. The processor assembly is configured to compress the first block using the BC mode of compression. In some examples the BC mode of compression includes a BC7 mode. In example implementations the processor assembly may be configured to input, to a machine learning (ML) model, the features and receive from the ML model identification of the BC mode of compression. If desired, at least one of the features can be based at least in part on a channel range that is the difference between maximum and minimum pixel values for a channel in a block or subset of a block. A maximum one of three RGB channel ranges in a block or subset of a block establishes at least one feature. In addition or alternatively, at least one of the features can be based at least in part on a sum of RGB channel ranges in a block or subset of a block. In addition or alternatively, at least one of the features can be based at least in part on a range of alpha values in a block or subset of a block. In another aspect, a device includes at least one computer storage that is not a transitory signal and that in turn includes instructions executable by at least one processor assembly to select a block compression 7 (BC7) mode of compression for texture data. This may be accomplished at least in part by, for each block in a training set of blocks of pixels, computing an error resulting in compressing the block in each of plural BC7 modes, as well as for each block in the training set, computing at least one feature associated with a per-channel range of pixel values within the block. The features and errors are used by at least one machine learning (ML) model to train the model to predict per-mode compression error based on the features, with the model subsequently being used to select a BC7 mode of compression for the texture data. In another aspect, a method for processing texture blocks includes computing a channel range that is the difference between maximum and minimum pixel values for a channel in a block or subset of a block. A maximum one of three RGB channel ranges in a block or subset of a block establishes a first feature. The method includes computing a sum of RGB channel ranges in the block or subset of the block to establish a second feature, and computing a range of alpha values in the block or subset of the block to establish a third feature. The first, second, and third features are used to identify a block compression mode of compression for the block. The details of the present disclosure, both as to its structure and operation, can be best understood in reference to the accompanying drawings, in which like reference numerals refer to like parts, and in which: BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a block diagram of an example system including an example in consistent with present principles; Figure 2 illustrates an example block compression (BC) system; Figure 3 illustrates example logic in example flow chart format for selecting a small group of candidate partitions from the sixty four (64) possible partitions for the cases shown in Figures 3A and 3B; Figure 3A illustrates sixty four (64) possible partitions for a four-by-four BC7 block divided into two subsets of texels, also referred to herein as “pixels”; Figure 3B illustrates sixty four (64) possible partitions for a four-by-four BC7 block divided into two subsets of texels, also referred to herein as “pixels”; Figures 4-6 graphically illustrate computation of gradient strengths in four directions consistent with the logic of Figure 3; Figure 7 illustrates example logic in example flow chart format for selecting one of the small group of candidate partitions as the partition to be implemented; Figure 8 illustrates example pre-processing logic in example flow chart