Remove unused entries in baseline_quant_error
@@ -325,11 +325,7 @@ static void compute_color_error_for_every_integer_count_and_quant_level(
) {
int partition_size = pi.partition_texel_count[partition_index];
- static const float baseline_quant_error[21] {
- (65536.0f * 65536.0f / 18.0f), // 2 values, 1 step
- (65536.0f * 65536.0f / 18.0f) / (2 * 2), // 3 values, 2 steps
- (65536.0f * 65536.0f / 18.0f) / (3 * 3), // 4 values, 3 steps
- (65536.0f * 65536.0f / 18.0f) / (4 * 4), // 5 values
+ static const float baseline_quant_error[21 - QUANT_6] {
(65536.0f * 65536.0f / 18.0f) / (5 * 5),
(65536.0f * 65536.0f / 18.0f) / (7 * 7),
(65536.0f * 65536.0f / 18.0f) / (9 * 9),
@@ -528,7 +524,7 @@ static void compute_color_error_for_every_integer_count_and_quant_level(
// The base_quant_error should depend on the scale-factor that would be used during
// actual encode of the color value
- float base_quant_error = baseline_quant_error[i] * static_cast<float>(partition_size);
+ float base_quant_error = baseline_quant_error[i - QUANT_6] * static_cast<float>(partition_size);
float rgb_quantization_error = error_weight_rgbsum * base_quant_error * 2.0f;
float alpha_quantization_error = error_weight.lane<3>() * base_quant_error * 2.0f;
float rgba_quantization_error = rgb_quantization_error + alpha_quantization_error;
@@ -591,7 +587,7 @@ static void compute_color_error_for_every_integer_count_and_quant_level(
error_scale_oe_rgb = 1.0f;
}
- float base_quant_error = baseline_quant_error[i];
+ float base_quant_error = baseline_quant_error[i - QUANT_6];
float quant_error_rgb = base_quant_error_rgb * base_quant_error;
float quant_error_rgba = base_quant_error_rgba * base_quant_error;
