summaryrefslogtreecommitdiff
path: root/thirdparty/astcenc/astcenc_find_best_partitioning.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-05-11 14:28:49 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-05-12 12:31:24 +0200
commit30b1c7fc1fa0ccb82d9c0a3dbafce9aa466f28c8 (patch)
tree41d45dcf373e87de3b0c48fcafaecf4d5c06efbb /thirdparty/astcenc/astcenc_find_best_partitioning.cpp
parenta227de0898c914e8ef163e1dfc47dc0adba50fb5 (diff)
astcenc: Update to 4.4.0
> The 4.4.0 release is a minor release with image quality improvements, > a small performance boost, a few new quality-of-life features, and a > few minor fixes for uncommon build configurations. https://github.com/ARM-software/astc-encoder/releases/tag/4.4.0 (cherry picked from commit 5a3f955e05f98b36faaab2192c8a3caae757f60e)
Diffstat (limited to 'thirdparty/astcenc/astcenc_find_best_partitioning.cpp')
-rw-r--r--thirdparty/astcenc/astcenc_find_best_partitioning.cpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/thirdparty/astcenc/astcenc_find_best_partitioning.cpp b/thirdparty/astcenc/astcenc_find_best_partitioning.cpp
index ffde3c7060..789c3964ef 100644
--- a/thirdparty/astcenc/astcenc_find_best_partitioning.cpp
+++ b/thirdparty/astcenc/astcenc_find_best_partitioning.cpp
@@ -604,8 +604,7 @@ unsigned int find_best_partition_candidates(
processed_line4 uncor_plines[BLOCK_MAX_PARTITIONS];
processed_line4 samec_plines[BLOCK_MAX_PARTITIONS];
- float uncor_line_lens[BLOCK_MAX_PARTITIONS];
- float samec_line_lens[BLOCK_MAX_PARTITIONS];
+ float line_lengths[BLOCK_MAX_PARTITIONS];
for (unsigned int j = 0; j < partition_count; j++)
{
@@ -631,8 +630,7 @@ unsigned int find_best_partition_candidates(
blk,
uncor_plines,
samec_plines,
- uncor_line_lens,
- samec_line_lens,
+ line_lengths,
uncor_error,
samec_error);
@@ -651,8 +649,8 @@ unsigned int find_best_partition_candidates(
float tpp = static_cast<float>(pi.partition_texel_count[j]);
vfloat4 error_weights(tpp * weight_imprecision_estim);
- vfloat4 uncor_vector = uncor_lines[j].b * uncor_line_lens[j];
- vfloat4 samec_vector = samec_lines[j].b * samec_line_lens[j];
+ vfloat4 uncor_vector = uncor_lines[j].b * line_lengths[j];
+ vfloat4 samec_vector = samec_lines[j].b * line_lengths[j];
uncor_error += dot_s(uncor_vector * uncor_vector, error_weights);
samec_error += dot_s(samec_vector * samec_vector, error_weights);
@@ -719,8 +717,8 @@ unsigned int find_best_partition_candidates(
float tpp = static_cast<float>(pi.partition_texel_count[j]);
vfloat4 error_weights(tpp * weight_imprecision_estim);
- vfloat4 uncor_vector = pl.uncor_line.b * pl.uncor_line_len;
- vfloat4 samec_vector = pl.samec_line.b * pl.samec_line_len;
+ vfloat4 uncor_vector = pl.uncor_line.b * pl.line_length;
+ vfloat4 samec_vector = pl.samec_line.b * pl.line_length;
uncor_error += dot3_s(uncor_vector * uncor_vector, error_weights);
samec_error += dot3_s(samec_vector * samec_vector, error_weights);
@@ -731,21 +729,11 @@ unsigned int find_best_partition_candidates(
}
}
- bool best_is_uncor = uncor_best_partitions[0] > samec_best_partitions[0];
-
unsigned int interleave[2 * TUNE_MAX_PARTITIONING_CANDIDATES];
for (unsigned int i = 0; i < requested_candidates; i++)
{
- if (best_is_uncor)
- {
- interleave[2 * i] = bsd.get_raw_partition_info(partition_count, uncor_best_partitions[i]).partition_index;
- interleave[2 * i + 1] = bsd.get_raw_partition_info(partition_count, samec_best_partitions[i]).partition_index;
- }
- else
- {
- interleave[2 * i] = bsd.get_raw_partition_info(partition_count, samec_best_partitions[i]).partition_index;
- interleave[2 * i + 1] = bsd.get_raw_partition_info(partition_count, uncor_best_partitions[i]).partition_index;
- }
+ interleave[2 * i] = bsd.get_raw_partition_info(partition_count, uncor_best_partitions[i]).partition_index;
+ interleave[2 * i + 1] = bsd.get_raw_partition_info(partition_count, samec_best_partitions[i]).partition_index;
}
uint64_t bitmasks[1024/64] { 0 };