Skip to content

Commit e693fed

Browse files
committed
Update astcenc: 5.2.0 => 5.3.0
1 parent 6ee3fd1 commit e693fed

13 files changed

+145
-117
lines changed

3rdparty/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## astcenc
88
- [![Upstream](https://img.shields.io/github/v/release/ARM-software/astc-encoder?label=Upstream)](https://github.com/ARM-software/astc-encoder)
9-
- Version: 5.2.0
9+
- Version: 5.3.0
1010
- License: Apache-2.0
1111

1212
## Box2D

3rdparty/astcenc/astcenc_averages_and_directions.cpp

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2023 Arm Limited
3+
// Copyright 2011-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -50,7 +50,7 @@ static void compute_partition_averages_rgb(
5050
vfloat4 averages[BLOCK_MAX_PARTITIONS]
5151
) {
5252
unsigned int partition_count = pi.partition_count;
53-
unsigned int texel_count = blk.texel_count;
53+
size_t texel_count = blk.texel_count;
5454
promise(texel_count > 0);
5555

5656
// For 1 partition just use the precomputed mean
@@ -64,11 +64,11 @@ static void compute_partition_averages_rgb(
6464
vfloatacc pp_avg_rgb[3] {};
6565

6666
vint lane_id = vint::lane_id();
67-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
67+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
6868
{
6969
vint texel_partition(pi.partition_of_texel + i);
7070

71-
vmask lane_mask = lane_id < vint(texel_count);
71+
vmask lane_mask = lane_id < vint_from_size(texel_count);
7272
lane_id += vint(ASTCENC_SIMD_WIDTH);
7373

7474
vmask p0_mask = lane_mask & (texel_partition == vint(0));
@@ -100,11 +100,11 @@ static void compute_partition_averages_rgb(
100100
vfloatacc pp_avg_rgb[2][3] {};
101101

102102
vint lane_id = vint::lane_id();
103-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
103+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
104104
{
105105
vint texel_partition(pi.partition_of_texel + i);
106106

107-
vmask lane_mask = lane_id < vint(texel_count);
107+
vmask lane_mask = lane_id < vint_from_size(texel_count);
108108
lane_id += vint(ASTCENC_SIMD_WIDTH);
109109

110110
vmask p0_mask = lane_mask & (texel_partition == vint(0));
@@ -145,11 +145,11 @@ static void compute_partition_averages_rgb(
145145
vfloatacc pp_avg_rgb[3][3] {};
146146

147147
vint lane_id = vint::lane_id();
148-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
148+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
149149
{
150150
vint texel_partition(pi.partition_of_texel + i);
151151

152-
vmask lane_mask = lane_id < vint(texel_count);
152+
vmask lane_mask = lane_id < vint_from_size(texel_count);
153153
lane_id += vint(ASTCENC_SIMD_WIDTH);
154154

155155
vmask p0_mask = lane_mask & (texel_partition == vint(0));
@@ -221,7 +221,7 @@ static void compute_partition_averages_rgba(
221221
vfloat4 averages[BLOCK_MAX_PARTITIONS]
222222
) {
223223
unsigned int partition_count = pi.partition_count;
224-
unsigned int texel_count = blk.texel_count;
224+
size_t texel_count = blk.texel_count;
225225
promise(texel_count > 0);
226226

227227
// For 1 partition just use the precomputed mean
@@ -235,11 +235,11 @@ static void compute_partition_averages_rgba(
235235
vfloat4 pp_avg_rgba[4] {};
236236

237237
vint lane_id = vint::lane_id();
238-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
238+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
239239
{
240240
vint texel_partition(pi.partition_of_texel + i);
241241

242-
vmask lane_mask = lane_id < vint(texel_count);
242+
vmask lane_mask = lane_id < vint_from_size(texel_count);
243243
lane_id += vint(ASTCENC_SIMD_WIDTH);
244244

245245
vmask p0_mask = lane_mask & (texel_partition == vint(0));
@@ -275,11 +275,11 @@ static void compute_partition_averages_rgba(
275275
vfloat4 pp_avg_rgba[2][4] {};
276276

277277
vint lane_id = vint::lane_id();
278-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
278+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
279279
{
280280
vint texel_partition(pi.partition_of_texel + i);
281281

282-
vmask lane_mask = lane_id < vint(texel_count);
282+
vmask lane_mask = lane_id < vint_from_size(texel_count);
283283
lane_id += vint(ASTCENC_SIMD_WIDTH);
284284

285285
vmask p0_mask = lane_mask & (texel_partition == vint(0));
@@ -326,11 +326,11 @@ static void compute_partition_averages_rgba(
326326
vfloat4 pp_avg_rgba[3][4] {};
327327

328328
vint lane_id = vint::lane_id();
329-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
329+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
330330
{
331331
vint texel_partition(pi.partition_of_texel + i);
332332

333-
vmask lane_mask = lane_id < vint(texel_count);
333+
vmask lane_mask = lane_id < vint_from_size(texel_count);
334334
lane_id += vint(ASTCENC_SIMD_WIDTH);
335335

336336
vmask p0_mask = lane_mask & (texel_partition == vint(0));
@@ -390,17 +390,17 @@ void compute_avgs_and_dirs_4_comp(
390390
const image_block& blk,
391391
partition_metrics pm[BLOCK_MAX_PARTITIONS]
392392
) {
393-
int partition_count = pi.partition_count;
393+
size_t partition_count = pi.partition_count;
394394
promise(partition_count > 0);
395395

396396
// Pre-compute partition_averages
397397
vfloat4 partition_averages[BLOCK_MAX_PARTITIONS];
398398
compute_partition_averages_rgba(pi, blk, partition_averages);
399399

400-
for (int partition = 0; partition < partition_count; partition++)
400+
for (size_t partition = 0; partition < partition_count; partition++)
401401
{
402402
const uint8_t *texel_indexes = pi.texels_of_partition[partition];
403-
unsigned int texel_count = pi.partition_texel_count[partition];
403+
size_t texel_count = pi.partition_texel_count[partition];
404404
promise(texel_count > 0);
405405

406406
vfloat4 average = partition_averages[partition];
@@ -411,7 +411,7 @@ void compute_avgs_and_dirs_4_comp(
411411
vfloat4 sum_zp = vfloat4::zero();
412412
vfloat4 sum_wp = vfloat4::zero();
413413

414-
for (unsigned int i = 0; i < texel_count; i++)
414+
for (size_t i = 0; i < texel_count; i++)
415415
{
416416
unsigned int iwt = texel_indexes[i];
417417
vfloat4 texel_datum = blk.texel(iwt);
@@ -509,13 +509,13 @@ void compute_avgs_and_dirs_3_comp(
509509
partition_averages[3] = partition_averages[3].swz<0, 1, 2>();
510510
}
511511

512-
unsigned int partition_count = pi.partition_count;
512+
size_t partition_count = pi.partition_count;
513513
promise(partition_count > 0);
514514

515-
for (unsigned int partition = 0; partition < partition_count; partition++)
515+
for (size_t partition = 0; partition < partition_count; partition++)
516516
{
517517
const uint8_t *texel_indexes = pi.texels_of_partition[partition];
518-
unsigned int texel_count = pi.partition_texel_count[partition];
518+
size_t texel_count = pi.partition_texel_count[partition];
519519
promise(texel_count > 0);
520520

521521
vfloat4 average = partition_averages[partition];
@@ -525,7 +525,7 @@ void compute_avgs_and_dirs_3_comp(
525525
vfloat4 sum_yp = vfloat4::zero();
526526
vfloat4 sum_zp = vfloat4::zero();
527527

528-
for (unsigned int i = 0; i < texel_count; i++)
528+
for (size_t i = 0; i < texel_count; i++)
529529
{
530530
unsigned int iwt = texel_indexes[i];
531531

@@ -570,17 +570,17 @@ void compute_avgs_and_dirs_3_comp_rgb(
570570
const image_block& blk,
571571
partition_metrics pm[BLOCK_MAX_PARTITIONS]
572572
) {
573-
unsigned int partition_count = pi.partition_count;
573+
size_t partition_count = pi.partition_count;
574574
promise(partition_count > 0);
575575

576576
// Pre-compute partition_averages
577577
vfloat4 partition_averages[BLOCK_MAX_PARTITIONS];
578578
compute_partition_averages_rgb(pi, blk, partition_averages);
579579

580-
for (unsigned int partition = 0; partition < partition_count; partition++)
580+
for (size_t partition = 0; partition < partition_count; partition++)
581581
{
582582
const uint8_t *texel_indexes = pi.texels_of_partition[partition];
583-
unsigned int texel_count = pi.partition_texel_count[partition];
583+
size_t texel_count = pi.partition_texel_count[partition];
584584
promise(texel_count > 0);
585585

586586
vfloat4 average = partition_averages[partition];
@@ -590,7 +590,7 @@ void compute_avgs_and_dirs_3_comp_rgb(
590590
vfloat4 sum_yp = vfloat4::zero();
591591
vfloat4 sum_zp = vfloat4::zero();
592592

593-
for (unsigned int i = 0; i < texel_count; i++)
593+
for (size_t i = 0; i < texel_count; i++)
594594
{
595595
unsigned int iwt = texel_indexes[i];
596596

@@ -664,20 +664,20 @@ void compute_avgs_and_dirs_2_comp(
664664
data_vg = blk.data_b;
665665
}
666666

667-
unsigned int partition_count = pt.partition_count;
667+
size_t partition_count = pt.partition_count;
668668
promise(partition_count > 0);
669669

670-
for (unsigned int partition = 0; partition < partition_count; partition++)
670+
for (size_t partition = 0; partition < partition_count; partition++)
671671
{
672672
const uint8_t *texel_indexes = pt.texels_of_partition[partition];
673-
unsigned int texel_count = pt.partition_texel_count[partition];
673+
size_t texel_count = pt.partition_texel_count[partition];
674674
promise(texel_count > 0);
675675

676676
// Only compute a partition mean if more than one partition
677677
if (partition_count > 1)
678678
{
679679
average = vfloat4::zero();
680-
for (unsigned int i = 0; i < texel_count; i++)
680+
for (size_t i = 0; i < texel_count; i++)
681681
{
682682
unsigned int iwt = texel_indexes[i];
683683
average += vfloat2(data_vr[iwt], data_vg[iwt]);
@@ -691,7 +691,7 @@ void compute_avgs_and_dirs_2_comp(
691691
vfloat4 sum_xp = vfloat4::zero();
692692
vfloat4 sum_yp = vfloat4::zero();
693693

694-
for (unsigned int i = 0; i < texel_count; i++)
694+
for (size_t i = 0; i < texel_count; i++)
695695
{
696696
unsigned int iwt = texel_indexes[i];
697697
vfloat4 texel_datum = vfloat2(data_vr[iwt], data_vg[iwt]);
@@ -729,20 +729,20 @@ void compute_error_squared_rgba(
729729
float& uncor_error,
730730
float& samec_error
731731
) {
732-
unsigned int partition_count = pi.partition_count;
732+
size_t partition_count = pi.partition_count;
733733
promise(partition_count > 0);
734734

735735
vfloatacc uncor_errorsumv = vfloatacc::zero();
736736
vfloatacc samec_errorsumv = vfloatacc::zero();
737737

738-
for (unsigned int partition = 0; partition < partition_count; partition++)
738+
for (size_t partition = 0; partition < partition_count; partition++)
739739
{
740740
const uint8_t *texel_indexes = pi.texels_of_partition[partition];
741741

742742
processed_line4 l_uncor = uncor_plines[partition];
743743
processed_line4 l_samec = samec_plines[partition];
744744

745-
unsigned int texel_count = pi.partition_texel_count[partition];
745+
size_t texel_count = pi.partition_texel_count[partition];
746746
promise(texel_count > 0);
747747

748748
// Vectorize some useful scalar inputs
@@ -775,9 +775,9 @@ void compute_error_squared_rgba(
775775
// array to extend the last value. This means min/max are not impacted, but we need to mask
776776
// out the dummy values when we compute the line weighting.
777777
vint lane_ids = vint::lane_id();
778-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
778+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
779779
{
780-
vmask mask = lane_ids < vint(texel_count);
780+
vmask mask = lane_ids < vint_from_size(texel_count);
781781
const uint8_t* texel_idxs = texel_indexes + i;
782782

783783
vfloat data_r = gatherf_byte_inds<vfloat>(blk.data_r, texel_idxs);
@@ -847,17 +847,17 @@ void compute_error_squared_rgb(
847847
float& uncor_error,
848848
float& samec_error
849849
) {
850-
unsigned int partition_count = pi.partition_count;
850+
size_t partition_count = pi.partition_count;
851851
promise(partition_count > 0);
852852

853853
vfloatacc uncor_errorsumv = vfloatacc::zero();
854854
vfloatacc samec_errorsumv = vfloatacc::zero();
855855

856-
for (unsigned int partition = 0; partition < partition_count; partition++)
856+
for (size_t partition = 0; partition < partition_count; partition++)
857857
{
858858
partition_lines3& pl = plines[partition];
859859
const uint8_t *texel_indexes = pi.texels_of_partition[partition];
860-
unsigned int texel_count = pi.partition_texel_count[partition];
860+
size_t texel_count = pi.partition_texel_count[partition];
861861
promise(texel_count > 0);
862862

863863
processed_line3 l_uncor = pl.uncor_pline;
@@ -889,9 +889,9 @@ void compute_error_squared_rgb(
889889
// to extend the last value. This means min/max are not impacted, but we need to mask
890890
// out the dummy values when we compute the line weighting.
891891
vint lane_ids = vint::lane_id();
892-
for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
892+
for (size_t i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
893893
{
894-
vmask mask = lane_ids < vint(texel_count);
894+
vmask mask = lane_ids < vint_from_size(texel_count);
895895
const uint8_t* texel_idxs = texel_indexes + i;
896896

897897
vfloat data_r = gatherf_byte_inds<vfloat>(blk.data_r, texel_idxs);

3rdparty/astcenc/astcenc_block_sizes.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2023 Arm Limited
3+
// Copyright 2011-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -384,12 +384,12 @@ static void init_decimation_info_2d(
384384
}
385385

386386
// Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
387-
unsigned int texels_per_block_simd = round_up_to_simd_multiple_vla(texels_per_block);
388-
for (unsigned int i = texels_per_block; i < texels_per_block_simd; i++)
387+
size_t texels_per_block_simd = round_up_to_simd_multiple_vla(texels_per_block);
388+
for (size_t i = texels_per_block; i < texels_per_block_simd; i++)
389389
{
390390
di.texel_weight_count[i] = 0;
391391

392-
for (unsigned int j = 0; j < 4; j++)
392+
for (size_t j = 0; j < 4; j++)
393393
{
394394
di.texel_weight_contribs_float_tr[j][i] = 0;
395395
di.texel_weights_tr[j][i] = 0;
@@ -402,12 +402,12 @@ static void init_decimation_info_2d(
402402
unsigned int last_texel_count_wt = wb.texel_count_of_weight[weights_per_block - 1];
403403
uint8_t last_texel = di.weight_texels_tr[last_texel_count_wt - 1][weights_per_block - 1];
404404

405-
unsigned int weights_per_block_simd = round_up_to_simd_multiple_vla(weights_per_block);
406-
for (unsigned int i = weights_per_block; i < weights_per_block_simd; i++)
405+
size_t weights_per_block_simd = round_up_to_simd_multiple_vla(weights_per_block);
406+
for (size_t i = weights_per_block; i < weights_per_block_simd; i++)
407407
{
408408
di.weight_texel_count[i] = 0;
409409

410-
for (unsigned int j = 0; j < max_texel_count_of_weight; j++)
410+
for (size_t j = 0; j < max_texel_count_of_weight; j++)
411411
{
412412
di.weight_texels_tr[j][i] = last_texel;
413413
di.weights_texel_contribs_tr[j][i] = 0.0f;
@@ -640,12 +640,12 @@ static void init_decimation_info_3d(
640640
}
641641

642642
// Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
643-
unsigned int texels_per_block_simd = round_up_to_simd_multiple_vla(texels_per_block);
644-
for (unsigned int i = texels_per_block; i < texels_per_block_simd; i++)
643+
size_t texels_per_block_simd = round_up_to_simd_multiple_vla(texels_per_block);
644+
for (size_t i = texels_per_block; i < texels_per_block_simd; i++)
645645
{
646646
di.texel_weight_count[i] = 0;
647647

648-
for (unsigned int j = 0; j < 4; j++)
648+
for (size_t j = 0; j < 4; j++)
649649
{
650650
di.texel_weight_contribs_float_tr[j][i] = 0;
651651
di.texel_weights_tr[j][i] = 0;
@@ -658,12 +658,12 @@ static void init_decimation_info_3d(
658658
int last_texel_count_wt = wb.texel_count_of_weight[weights_per_block - 1];
659659
uint8_t last_texel = di.weight_texels_tr[last_texel_count_wt - 1][weights_per_block - 1];
660660

661-
unsigned int weights_per_block_simd = round_up_to_simd_multiple_vla(weights_per_block);
662-
for (unsigned int i = weights_per_block; i < weights_per_block_simd; i++)
661+
size_t weights_per_block_simd = round_up_to_simd_multiple_vla(weights_per_block);
662+
for (size_t i = weights_per_block; i < weights_per_block_simd; i++)
663663
{
664664
di.weight_texel_count[i] = 0;
665665

666-
for (int j = 0; j < max_texel_count_of_weight; j++)
666+
for (size_t j = 0; j < max_texel_count_of_weight; j++)
667667
{
668668
di.weight_texels_tr[j][i] = last_texel;
669669
di.weights_texel_contribs_tr[j][i] = 0.0f;

3rdparty/astcenc/astcenc_find_best_partitioning.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2024 Arm Limited
3+
// Copyright 2011-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -226,7 +226,7 @@ static void kmeans_update(
226226

227227
uint8_t partition_texel_count[BLOCK_MAX_PARTITIONS] { 0 };
228228

229-
// Find the center-of-gravity in each cluster
229+
// Find the center of gravity in each cluster
230230
for (unsigned int i = 0; i < texel_count; i++)
231231
{
232232
uint8_t partition = partition_of_texel[i];

0 commit comments

Comments
 (0)