Skip to content

Commit de986d3

Browse files
committed
Cleanup some naming conventions
1 parent 83e1b97 commit de986d3

7 files changed

Lines changed: 55 additions & 55 deletions

Source/astcenc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,21 +520,21 @@ struct astcenc_config
520520
*
521521
* This option is further scaled for normal maps, so it skips less often.
522522
*/
523-
float tune_2_partition_early_out_limit_factor;
523+
float tune_2partition_early_out_limit_factor;
524524

525525
/**
526526
* @brief The threshold for skipping 4.1 trials (-3partitionlimitfactor).
527527
*
528528
* This option is further scaled for normal maps, so it skips less often.
529529
*/
530-
float tune_3_partition_early_out_limit_factor;
530+
float tune_3partition_early_out_limit_factor;
531531

532532
/**
533533
* @brief The threshold for skipping two weight planes (-2planelimitcorrelation).
534534
*
535535
* This option is ineffective for normal maps.
536536
*/
537-
float tune_2_plane_early_out_limit_correlation;
537+
float tune_2plane_early_out_limit_correlation;
538538

539539
#if defined(ASTCENC_DIAGNOSTICS)
540540
/**

Source/astcenc_block_sizes.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,8 @@ static void construct_dt_entry_2d(
776776
assert(maxprec_1plane >= 0 || maxprec_2planes >= 0);
777777
bsd.decimation_modes[index].maxprec_1plane = static_cast<int8_t>(maxprec_1plane);
778778
bsd.decimation_modes[index].maxprec_2planes = static_cast<int8_t>(maxprec_2planes);
779-
bsd.decimation_modes[index].refprec_1_plane = 0;
780-
bsd.decimation_modes[index].refprec_2_planes = 0;
779+
bsd.decimation_modes[index].refprec_1plane = 0;
780+
bsd.decimation_modes[index].refprec_2planes = 0;
781781
}
782782

783783
/**
@@ -934,11 +934,11 @@ static void construct_block_size_descriptor_2d(
934934

935935
if (is_dual_plane)
936936
{
937-
dm.set_ref_2_plane(bm.get_weight_quant_mode());
937+
dm.set_ref_2plane(bm.get_weight_quant_mode());
938938
}
939939
else
940940
{
941-
dm.set_ref_1_plane(bm.get_weight_quant_mode());
941+
dm.set_ref_1plane(bm.get_weight_quant_mode());
942942
}
943943

944944
bsd.block_mode_packed_index[i] = static_cast<uint16_t>(packed_bm_idx);
@@ -969,8 +969,8 @@ static void construct_block_size_descriptor_2d(
969969
{
970970
bsd.decimation_modes[i].maxprec_1plane = -1;
971971
bsd.decimation_modes[i].maxprec_2planes = -1;
972-
bsd.decimation_modes[i].refprec_1_plane = 0;
973-
bsd.decimation_modes[i].refprec_2_planes = 0;
972+
bsd.decimation_modes[i].refprec_1plane = 0;
973+
bsd.decimation_modes[i].refprec_2planes = 0;
974974
}
975975

976976
// Determine the texels to use for kmeans clustering.
@@ -1055,8 +1055,8 @@ static void construct_block_size_descriptor_3d(
10551055

10561056
bsd.decimation_modes[decimation_mode_count].maxprec_1plane = static_cast<int8_t>(maxprec_1plane);
10571057
bsd.decimation_modes[decimation_mode_count].maxprec_2planes = static_cast<int8_t>(maxprec_2planes);
1058-
bsd.decimation_modes[decimation_mode_count].refprec_1_plane = maxprec_1plane == -1 ? 0 : 0xFFFF;
1059-
bsd.decimation_modes[decimation_mode_count].refprec_2_planes = maxprec_2planes == -1 ? 0 : 0xFFFF;
1058+
bsd.decimation_modes[decimation_mode_count].refprec_1plane = maxprec_1plane == -1 ? 0 : 0xFFFF;
1059+
bsd.decimation_modes[decimation_mode_count].refprec_2planes = maxprec_2planes == -1 ? 0 : 0xFFFF;
10601060
decimation_mode_count++;
10611061
}
10621062
}
@@ -1067,8 +1067,8 @@ static void construct_block_size_descriptor_3d(
10671067
{
10681068
bsd.decimation_modes[i].maxprec_1plane = -1;
10691069
bsd.decimation_modes[i].maxprec_2planes = -1;
1070-
bsd.decimation_modes[i].refprec_1_plane = 0;
1071-
bsd.decimation_modes[i].refprec_2_planes = 0;
1070+
bsd.decimation_modes[i].refprec_1plane = 0;
1071+
bsd.decimation_modes[i].refprec_2planes = 0;
10721072
}
10731073

10741074
bsd.decimation_mode_count_always = 0; // Skipped for 3D modes

Source/astcenc_compress_symbolic.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static float compress_symbolic_block_for_partition_1plane(
391391
for (unsigned int i = 0; i < max_decimation_modes; i++)
392392
{
393393
const auto& dm = bsd.get_decimation_mode(i);
394-
if (!dm.is_ref_1_plane(static_cast<quant_method>(max_weight_quant)))
394+
if (!dm.is_ref_1plane(static_cast<quant_method>(max_weight_quant)))
395395
{
396396
continue;
397397
}
@@ -743,7 +743,7 @@ static float compress_symbolic_block_for_partition_2planes(
743743
for (unsigned int i = 0; i < bsd.decimation_mode_count_selected; i++)
744744
{
745745
const auto& dm = bsd.get_decimation_mode(i);
746-
if (!dm.is_ref_2_plane(static_cast<quant_method>(max_weight_quant)))
746+
if (!dm.is_ref_2plane(static_cast<quant_method>(max_weight_quant)))
747747
{
748748
continue;
749749
}
@@ -1263,8 +1263,8 @@ void compress_block(
12631263

12641264
float exit_thresholds_for_pcount[BLOCK_MAX_PARTITIONS] {
12651265
0.0f,
1266-
ctx.config.tune_2_partition_early_out_limit_factor,
1267-
ctx.config.tune_3_partition_early_out_limit_factor,
1266+
ctx.config.tune_2partition_early_out_limit_factor,
1267+
ctx.config.tune_3partition_early_out_limit_factor,
12681268
0.0f
12691269
};
12701270

@@ -1318,7 +1318,7 @@ void compress_block(
13181318
lowest_correl = prepare_block_statistics(bsd.texel_count, blk);
13191319
#endif
13201320

1321-
block_skip_two_plane = lowest_correl > ctx.config.tune_2_plane_early_out_limit_correlation;
1321+
block_skip_two_plane = lowest_correl > ctx.config.tune_2plane_early_out_limit_correlation;
13221322

13231323
// Test the four possible 1-partition, 2-planes modes. Do this in reverse, as
13241324
// alpha is the most likely to be non-correlated if it is present in the data.
@@ -1331,7 +1331,7 @@ void compress_block(
13311331

13321332
if (block_skip_two_plane)
13331333
{
1334-
trace_add_data("skip", "tune_2_plane_early_out_limit_correlation");
1334+
trace_add_data("skip", "tune_2plane_early_out_limit_correlation");
13351335
continue;
13361336
}
13371337

Source/astcenc_entry.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ struct astcenc_preset_config
5252
float tune_db_limit_a_base;
5353
float tune_db_limit_b_base;
5454
float tune_mse_overshoot;
55-
float tune_2_partition_early_out_limit_factor;
56-
float tune_3_partition_early_out_limit_factor;
57-
float tune_2_plane_early_out_limit_correlation;
55+
float tune_2partition_early_out_limit_factor;
56+
float tune_3partition_early_out_limit_factor;
57+
float tune_2plane_early_out_limit_correlation;
5858
};
5959

6060
/**
@@ -439,9 +439,9 @@ static astcenc_error validate_config(
439439
config.tune_4partitioning_candidate_limit = astc::clamp(config.tune_4partitioning_candidate_limit, 1u, TUNE_MAX_PARTITIONING_CANDIDATES);
440440
config.tune_db_limit = astc::max(config.tune_db_limit, 0.0f);
441441
config.tune_mse_overshoot = astc::max(config.tune_mse_overshoot, 1.0f);
442-
config.tune_2_partition_early_out_limit_factor = astc::max(config.tune_2_partition_early_out_limit_factor, 0.0f);
443-
config.tune_3_partition_early_out_limit_factor = astc::max(config.tune_3_partition_early_out_limit_factor, 0.0f);
444-
config.tune_2_plane_early_out_limit_correlation = astc::max(config.tune_2_plane_early_out_limit_correlation, 0.0f);
442+
config.tune_2partition_early_out_limit_factor = astc::max(config.tune_2partition_early_out_limit_factor, 0.0f);
443+
config.tune_3partition_early_out_limit_factor = astc::max(config.tune_3partition_early_out_limit_factor, 0.0f);
444+
config.tune_2plane_early_out_limit_correlation = astc::max(config.tune_2plane_early_out_limit_correlation, 0.0f);
445445

446446
// Specifying a zero weight color component is not allowed; force to small value
447447
float max_weight = astc::max(astc::max(config.cw_r_weight, config.cw_g_weight),
@@ -563,9 +563,9 @@ astcenc_error astcenc_config_init(
563563

564564
config.tune_mse_overshoot = (*preset_configs)[start].tune_mse_overshoot;
565565

566-
config.tune_2_partition_early_out_limit_factor = (*preset_configs)[start].tune_2_partition_early_out_limit_factor;
567-
config.tune_3_partition_early_out_limit_factor =(*preset_configs)[start].tune_3_partition_early_out_limit_factor;
568-
config.tune_2_plane_early_out_limit_correlation = (*preset_configs)[start].tune_2_plane_early_out_limit_correlation;
566+
config.tune_2partition_early_out_limit_factor = (*preset_configs)[start].tune_2partition_early_out_limit_factor;
567+
config.tune_3partition_early_out_limit_factor = (*preset_configs)[start].tune_3partition_early_out_limit_factor;
568+
config.tune_2plane_early_out_limit_correlation = (*preset_configs)[start].tune_2plane_early_out_limit_correlation;
569569
}
570570
// Start and end node are not the same - so interpolate between them
571571
else
@@ -605,9 +605,9 @@ astcenc_error astcenc_config_init(
605605

606606
config.tune_mse_overshoot = LERP(tune_mse_overshoot);
607607

608-
config.tune_2_partition_early_out_limit_factor = LERP(tune_2_partition_early_out_limit_factor);
609-
config.tune_3_partition_early_out_limit_factor = LERP(tune_3_partition_early_out_limit_factor);
610-
config.tune_2_plane_early_out_limit_correlation = LERP(tune_2_plane_early_out_limit_correlation);
608+
config.tune_2partition_early_out_limit_factor = LERP(tune_2partition_early_out_limit_factor);
609+
config.tune_3partition_early_out_limit_factor = LERP(tune_3partition_early_out_limit_factor);
610+
config.tune_2plane_early_out_limit_correlation = LERP(tune_2plane_early_out_limit_correlation);
611611
#undef LERP
612612
#undef LERPI
613613
#undef LERPUI
@@ -656,9 +656,9 @@ astcenc_error astcenc_config_init(
656656

657657
config.cw_g_weight = 0.0f;
658658
config.cw_b_weight = 0.0f;
659-
config.tune_2_partition_early_out_limit_factor *= 1.5f;
660-
config.tune_3_partition_early_out_limit_factor *= 1.5f;
661-
config.tune_2_plane_early_out_limit_correlation = 0.99f;
659+
config.tune_2partition_early_out_limit_factor *= 1.5f;
660+
config.tune_3partition_early_out_limit_factor *= 1.5f;
661+
config.tune_2plane_early_out_limit_correlation = 0.99f;
662662

663663
// Normals are prone to blocking artifacts on smooth curves
664664
// so force compressor to try harder here ...

Source/astcenc_internal.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ struct partition_info
321321
/**
322322
* @brief The number of texels in each partition.
323323
*
324-
* Note that some seeds result in zero texels assigned to a partition are valid, but are skipped
325-
* by this compressor as there is no point spending bits encoding an unused color endpoint.
324+
* Note that some seeds result in zero texels assigned to a partition. These are valid, but are
325+
* skipped by this compressor as there is no point spending bits encoding an unused endpoints.
326326
*/
327327
uint8_t partition_texel_count[BLOCK_MAX_PARTITIONS];
328328

@@ -457,55 +457,55 @@ struct decimation_mode
457457
*
458458
* Bit 0 = QUANT_2, Bit 1 = QUANT_3, etc.
459459
*/
460-
uint16_t refprec_1_plane;
460+
uint16_t refprec_1plane;
461461

462462
/**
463463
* @brief Bitvector indicating weight quant methods used by active 2 plane block modes.
464464
*
465465
* Bit 0 = QUANT_2, Bit 1 = QUANT_3, etc.
466466
*/
467-
uint16_t refprec_2_planes;
467+
uint16_t refprec_2planes;
468468

469469
/**
470470
* @brief Set a 1 plane weight quant as active.
471471
*
472472
* @param weight_quant The quant method to set.
473473
*/
474-
void set_ref_1_plane(quant_method weight_quant)
474+
void set_ref_1plane(quant_method weight_quant)
475475
{
476-
refprec_1_plane |= (1 << weight_quant);
476+
refprec_1plane |= (1 << weight_quant);
477477
}
478478

479479
/**
480480
* @brief Test if this mode is active below a given 1 plane weight quant (inclusive).
481481
*
482482
* @param max_weight_quant The max quant method to test.
483483
*/
484-
bool is_ref_1_plane(quant_method max_weight_quant) const
484+
bool is_ref_1plane(quant_method max_weight_quant) const
485485
{
486486
uint16_t mask = static_cast<uint16_t>((1 << (max_weight_quant + 1)) - 1);
487-
return (refprec_1_plane & mask) != 0;
487+
return (refprec_1plane & mask) != 0;
488488
}
489489

490490
/**
491491
* @brief Set a 2 plane weight quant as active.
492492
*
493493
* @param weight_quant The quant method to set.
494494
*/
495-
void set_ref_2_plane(quant_method weight_quant)
495+
void set_ref_2plane(quant_method weight_quant)
496496
{
497-
refprec_2_planes |= static_cast<uint16_t>(1 << weight_quant);
497+
refprec_2planes |= static_cast<uint16_t>(1 << weight_quant);
498498
}
499499

500500
/**
501501
* @brief Test if this mode is active below a given 2 plane weight quant (inclusive).
502502
*
503503
* @param max_weight_quant The max quant method to test.
504504
*/
505-
bool is_ref_2_plane(quant_method max_weight_quant) const
505+
bool is_ref_2plane(quant_method max_weight_quant) const
506506
{
507507
uint16_t mask = static_cast<uint16_t>((1 << (max_weight_quant + 1)) - 1);
508-
return (refprec_2_planes & mask) != 0;
508+
return (refprec_2planes & mask) != 0;
509509
}
510510
};
511511

Source/astcenc_weight_align.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2022 Arm Limited
3+
// Copyright 2011-2023 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
@@ -353,7 +353,7 @@ void compute_angular_endpoints_1plane(
353353
for (unsigned int i = 0; i < max_decimation_modes; i++)
354354
{
355355
const decimation_mode& dm = bsd.decimation_modes[i];
356-
if (!dm.is_ref_1_plane(static_cast<quant_method>(max_weight_quant)))
356+
if (!dm.is_ref_1plane(static_cast<quant_method>(max_weight_quant)))
357357
{
358358
continue;
359359
}
@@ -422,7 +422,7 @@ void compute_angular_endpoints_2planes(
422422
for (unsigned int i = 0; i < bsd.decimation_mode_count_selected; i++)
423423
{
424424
const decimation_mode& dm = bsd.decimation_modes[i];
425-
if (!dm.is_ref_2_plane(static_cast<quant_method>(max_weight_quant)))
425+
if (!dm.is_ref_2plane(static_cast<quant_method>(max_weight_quant)))
426426
{
427427
continue;
428428
}

Source/astcenccli_toplevel.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ static int edit_astcenc_config(
987987
return 1;
988988
}
989989

990-
config.tune_2_partition_early_out_limit_factor = static_cast<float>(atof(argv[argidx - 1]));
990+
config.tune_2partition_early_out_limit_factor = static_cast<float>(atof(argv[argidx - 1]));
991991
}
992992
else if (!strcmp(argv[argidx], "-3partitionlimitfactor"))
993993
{
@@ -998,7 +998,7 @@ static int edit_astcenc_config(
998998
return 1;
999999
}
10001000

1001-
config.tune_3_partition_early_out_limit_factor = static_cast<float>(atof(argv[argidx - 1]));
1001+
config.tune_3partition_early_out_limit_factor = static_cast<float>(atof(argv[argidx - 1]));
10021002
}
10031003
else if (!strcmp(argv[argidx], "-2planelimitcorrelation"))
10041004
{
@@ -1009,7 +1009,7 @@ static int edit_astcenc_config(
10091009
return 1;
10101010
}
10111011

1012-
config.tune_2_plane_early_out_limit_correlation = static_cast<float>(atof(argv[argidx - 1]));
1012+
config.tune_2plane_early_out_limit_correlation = static_cast<float>(atof(argv[argidx - 1]));
10131013
}
10141014
else if (!strcmp(argv[argidx], "-refinementlimit"))
10151015
{
@@ -1215,9 +1215,9 @@ static void print_astcenc_config(
12151215
printf(" 3 partition index cutoff: %u partition ids\n", config.tune_3partition_index_limit);
12161216
printf(" 4 partition index cutoff: %u partition ids\n", config.tune_4partition_index_limit);
12171217
printf(" PSNR cutoff: %g dB\n", static_cast<double>(config.tune_db_limit));
1218-
printf(" 3 partition cutoff: %g\n", static_cast<double>(config.tune_2_partition_early_out_limit_factor));
1219-
printf(" 4 partition cutoff: %g\n", static_cast<double>(config.tune_3_partition_early_out_limit_factor));
1220-
printf(" 2 plane correlation cutoff: %g\n", static_cast<double>(config.tune_2_plane_early_out_limit_correlation));
1218+
printf(" 3 partition cutoff: %g\n", static_cast<double>(config.tune_2partition_early_out_limit_factor));
1219+
printf(" 4 partition cutoff: %g\n", static_cast<double>(config.tune_3partition_early_out_limit_factor));
1220+
printf(" 2 plane correlation cutoff: %g\n", static_cast<double>(config.tune_2plane_early_out_limit_correlation));
12211221
printf(" Block mode centile cutoff: %g%%\n", static_cast<double>(config.tune_block_mode_limit));
12221222
printf(" Candidate cutoff: %u candidates\n", config.tune_candidate_limit);
12231223
printf(" Refinement cutoff: %u iterations\n", config.tune_refinement_limit);

0 commit comments

Comments
 (0)