Dear all,
I read ASTC encoder code but I don't clear about construct_block_size_descriptor_2d function (astc_block_size2.cpp).
why initialize_decimation_table_2d is only range x_weights = 2-> 12 ?
for (x_weights = 2; x_weights <= 12; x_weights++) for (y_weights = 2; y_weights <= 12; y_weights++)
Thank you and best regards
Hi le,
Section 3.12 in the ASTC specification:
* https://github.com/ARM-software/astc-encoder/blob/master/Documentation/ASTC%20Specification%201.0.pdf
... defines how the weight-grid for infill modes works. The infill weight grid is needed when you don't encode one color weight per texel directly, but store it in a separate weight grid at lower resolution and interpolate a color weight per texel.
The weight grid may be a different resolution to the actual texel grid being compressed, but must contain at least two values in each axis (because it's bilinear filtered), and must have no more than the number of texels in that axis in the block being compressed (because there is no point encoding more weights than you have texels in the block - it would be a waste of bits - so attempting to do so is actually an encoding error - see section 3.18). Given the maximum block size ASTC allows is 12x12, the maximum possible number of weights you need in a single axis is therefore 12.
Regards,Pete