EP-4740183-A1 - OPTIMIZED PARTITION SELECTION FOR BC7 TEXTURE ENCODING
Abstract
Techniques are described for first generating (310) a short list of candidate partitions for BC-7 texture compression using calculations of gradient strengths in multiple directions and then selecting one of the candidate partitions using pixel extents for further processing (708) of the block.
Inventors
- MADAMS, THOMAS
Assignees
- Sony Interactive Entertainment LLC
Dates
- Publication Date
- 20260513
- Application Date
- 20240612
Claims (20)
- WHAT IS CLAIMED IS: 1. An apparatus comprising: at least one processor assembly configured to: identify M candidate partitions from N partitions, N>M, for block compression 7 (BC7) of texture data at least in part by: for at least a first block of the texture data, computing gradient strengths between adjacent pixels in plural directions, each direction being associated with a respective absolute gradient strength; identifying the direction having the lowest absolute gradient strength; identifying the M candidate partitions based on the direction having the lowest absolute gradient strength; and use at least a first one of the M candidate partitions to process at least the first block of texture data for storage and/or transmission thereof for decompression at a rendering device to render computer simulation images.
- 2. The apparatus of Claim 1, wherein the processor is assembly is configured for not using alpha values of pixels on blocks of the pixel data with alpha value not being less than 255.
- 3. The apparatus of Claim 1, wherein the plural directions comprise horizontal and vertical.
- 4. The apparatus of Claim 3, wherein the plural directions comprise two diagonal directions.
- 5. The apparatus of Claim 4, wherein the processor assembly is configured to: apply a first scale factor to gradient strengths in the vertical and horizontal directions and a second scale factor to gradient strengths in the two diagonal dimensions to render scaled gradient strengths; and use the gradient strengths to identify M candidate partitions.
- 6. The apparatus of Claim 1, wherein the processor assembly is configured to select the first one of the M candidate partitions to compress at least the first block of texture data at least in part by scoring each of the M partitions by: summing per-channel extents of pixels in each subset of the respective partition to render channel sums; weighting each channel sum by the number of pixels in each respective subset to establish the respective score of the respective partition; and selecting from among the M candidate partitions the partition with a score less than the scores of the remaining candidate partitions among the M candidate partitions.
- 7. The apparatus of Claim 1, wherein the processor assembly is configured to: reuse at least a first calculation from a first candidate partition in calculating at least one operation of a second candidate partition.
- 8. The apparatus of Claim 7, wherein the first calculation comprises a min/max calculation.
- 9. The apparatus of Claim 8, wherein the processor assembly is configured to: merge at least two min/max calculations to generate min/max bounds for plural subsets of the first candidate partition; and reuse the min/max bounds to execute at least one operation for the second candidate partition.
- 10. The apparatus of Claim 1, wherein the processor assembly is configured to: select a BC7 mode of compression at least in part by: for each block in a training set of blocks of pixels, computing an error resulting in compressing the block or component subsets of the block in each of plural BC7 modes; for each block in the training set, computing at least one feature associated with a per-channel range of pixel values within the block or the component subsets; inputting the features and errors to at least one machine learning (ML) model to train the model to predict per-mode compression error based on the features; and subsequently using the ML model to select a BC7 mode of compression for the texture data.
- 11. 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: identify, for at least first and second directions relative to a computer graphics texture data structure, respective first and second values derived from pixel values of the computer graphics texture data structure; use one of the values to select a subset of M candidate partitions from N partitions, M<N; and select a first one of the candidate partitions in the subset of M candidate partitions to encode the computer graphics texture data structure, selection of the first one of the candidate partitions being based at least in part on pixel extents in the first one of the candidate partitions in the subset of M candidate partitions.
- 12. The device of Claim 11, wherein the computer graphics data structure comprises at least one block.
- 13. The device of Claim 12, wherein the block comprises a block compression (BC) 7 block.
- 14. The device of Claim 11, wherein the first and second directions respectively comprise horizontal and vertical.
- 15. The device of Claim 14, wherein the instructions are executable to: identify for the horizontal, vertical, and two diagonal directions respective first, second, third, and fourth values derived from pixel values of the block.
- 16. The device of Claim 15, wherein the first through fourth values respectively establish first through fourth gradient strengths, and the instructions are executable to: apply a first scale factor to the respective gradient strengths in the vertical and horizontal directions and a second scale factor to the respective gradient strengths in the two diagonal directions to render scaled gradient strengths; and use the gradient strengths to identify the M candidate partitions.
- 17. The device of Claim 11, wherein the instructions are executable to select the first one of the candidate partitions at least in part by: for each of the M candidate partitions, summing per-channel extents of pixels in each subset of the respective partition to render channel sums; weighting each channel sum by the number of pixels in each respective subset to establish the respective score of the respective partition; and selecting from among the M candidate partitions the partition with a score less than the scores of the remaining candidate partitions among the M candidate partitions.
- 18. The device of Claim 11, wherein the instructions are executable to: reuse at least a first calculation from a first candidate partition in at least one operation of a second candidate partition.
- 19. The device of Claim 18, wherein the first calculation comprises a min/max calculation, and the instructions are executable to: merge at least two min/max calculations to generate min/max bounds for plural subsets of the first candidate partition; and reuse the min/max bounds to calculate at least one operation for the second candidate partition.
- 20. A method comprising: identifying, from among N possible partitions for a block compression 7 (BC7) block of texture data, M candidate partitions, M<N, based at least in part on gradient calculations in at least two directions relative to the block; identifying a first one of the M candidate partitions based at least in part on extents of pixels in the block; and using the first one of the M candidate partitions to process the block.
Description
OPTIMIZED PARTITION 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 partition 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 identify M candidate partitions from N partitions, N>M, for block compression 7 (BC7) of texture data. This may be done at least in part by, for at least a first block of the texture data, computing gradient strengths between adjacent pixels in plural directions, with each direction being associated with a respective absolute gradient strength, identifying the direction having the lowest absolute gradient strength, and identifying the M candidate partitions based on the direction having the lowest absolute gradient strength. The processor assembly is configured to use at least a first one of the M candidate partitions to process at least the first block of texture data for storage and/or transmission thereof for decompression at a rendering device to render computer simulation images. In some implementations, the processor assembly may be configured for not using alpha values of pixels on blocks of the pixel data with alpha value not being less than 255. In example embodiments, the plural directions can include horizontal, vertical, and two diagonal directions. In some embodiments, the processor assembly can be configured to apply a first scale factor to gradient strengths in the vertical and horizontal directions and a second scale factor to gradient strengths in the two diagonal dimensions to render scaled gradient strengths, and to use the gradient strengths to identify M candidate partitions. In example implementations, the processor assembly may be configured to select the first one of the M candidate partitions to compress at least the first block of texture data at least in part by scoring each of the M partitions. This may be done by summing per-channel extents of pixels in each subset of the respective partition to render channel sums, weighting each channel sum by the number of pixels in each respective subset to establish the respective score of the respective partition, and selecting from among the M candidate partitions the partition with a score less than the scores of the remaining candidate partitions among the M candidate partitions. If desired, the processor assembly can be configured to reuse at least a first calculation from a first candidate partition in executing at least one operation of a second candidate partition. For example, the first calculation can be a min/max calculation, and the processor assembly can be configured to merge at least two min/max calculations to generate min/max bounds for plural subsets of the first candidate partition, and reuse the min/max bounds to calculate at least one gradient strength for the second candidate partition. In non-limiting examples the processor assembly can be further configured to select a BC7 mode of compression. This may be done 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, and 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 can be input to at least one machine learning (ML) model to train the model to predict per-mode compression error based on the features. The ML model is subsequently used to select a BC7 mode of compression for the texture data. 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 identify, for at least first and second directions relative to a computer graphics texture data structure, respective first and second values derived from pixel values of the computer graphics texture data structure. The instructions are executable to use one of the values to select a subset of M candidate partitions from N partitions, M<N. Furthermore, the instructions are executable to select a first one of the candidate partitions in the subset of M candidate partitions to encode the computer graphic