Skip to content
Merged
3 changes: 3 additions & 0 deletions Docs/ChangeLog-5x.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ The 5.5.0 release is a minor maintenance release.
* **Update:** Update stb_image to v1.30.
* **Update:** Update Wuffs to v0.3.4.
* **Update:** Update TinyEXR to v1.0.13.
* **Bug fix:** Front-end wrapper now uses C++ RAII to manage lifetime of
memory and file handles, fixing a number of resource leaks when on an error
handling path.
* **Bug fix:** Throw errors in the command line wrapper for cases where
`.astc`, `.dds`, and `.ktx` input image sizes would result in integer
overflow in calculations of total block count or data size.
Expand Down
4 changes: 2 additions & 2 deletions Source/astcenc.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ ASTCENC_EXTERN_C typedef void (*astcenc_progress_callback)(float);
/**
* @brief Enable normal map compression.
*
* Input data will be treated a two component normal map, storing X and Y, and the codec will
* Input data will be treated as a two component normal map, storing X and Y, and the codec will
* optimize for angular error rather than simple linear PSNR. In this mode the input swizzle should
* be e.g. rrrg (the default ordering for ASTC normals on the command line) or gggr (the ordering
* used by BC5n).
Expand Down Expand Up @@ -743,7 +743,7 @@ ASTCENC_PUBLIC enum astcenc_error astcenc_config_init(
* another context using the same target configuration into @c parent_context. A child will use the
* read-only data tables it needs from the ancestor "root" context, rather than creating its own,
* which saves a considerable amount of memory per child. You must only free the root context once
* all descendent contexts have been freed. When you pass a @c parent_context the config is taken
* all descendant contexts have been freed. When you pass a @c parent_context the config is taken
* from the parent, and so @c context must be @c nullptr.
*
* Contexts can be allocated to support only decompression using the @c ASTCENC_FLG_DECOMPRESS_ONLY
Expand Down
4 changes: 2 additions & 2 deletions Source/astcenc_color_quantize.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2011-2023 Arm Limited
// Copyright 2011-2026 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
Expand All @@ -27,7 +27,7 @@
* * Mode: LDR or HDR
* * Quantization level
* * Channel count: L, LA, RGB, or RGBA
* * Endpoint 2 type: Direct color endcode, or scaled from endpoint 1.
* * Endpoint 2 type: Direct color encoding, or scaled from endpoint 1.
*
* However, this leaves a number of decisions about exactly how to pack the endpoints open. In
* particular we need to determine if blue contraction can be used, or/and if delta encoding can be
Expand Down
2 changes: 1 addition & 1 deletion Source/astcenc_decompress_symbolic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void decompress_symbolic_block(
vmask4 u8_mask = get_u8_component_mask(decode_mode, blk);

// The real decoder would just use the top 8 bits, but we rescale
// in to a 16-bit value that rounds correctly.
// into a 16-bit value that rounds correctly.
vint4 colori_u8 = asr<8>(colori) * 257;
colori = select(colori, colori_u8, u8_mask);

Expand Down
4 changes: 2 additions & 2 deletions Source/astcenc_diagnostic_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ TraceNode::TraceNode(
vsnprintf (buffer, bufsz, format, args);
va_end (args);

// Guarantee there is a nul terminator
// Guarantee there is a NUL terminator
buffer[bufsz - 1] = 0;

// Generate the node
Expand Down Expand Up @@ -191,7 +191,7 @@ void trace_add_data(
vsnprintf (buffer, bufsz, format, args);
va_end (args);

// Guarantee there is a nul terminator
// Guarantee there is a NUL terminator
buffer[bufsz - 1] = 0;

std::string value = "\"" + std::string(buffer) + "\"";
Expand Down
4 changes: 2 additions & 2 deletions Source/astcenc_diagnostic_trace.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2021-2022 Arm Limited
// Copyright 2021-2026 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -130,7 +130,7 @@ class TraceLog
TraceLog(const char* file_name);

/**
* @brief Detroy the trace log.
* @brief Destroy the trace log.
*
* Trace logs MUST be cleanly destroyed to ensure the file gets written.
*/
Expand Down
4 changes: 2 additions & 2 deletions Source/astcenc_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ astcenc_error astcenc_context_alloc(
return ASTCENC_SUCCESS;
}

/* See header dor documentation. */
/* See header for documentation. */
void astcenc_context_free(
astcenc_context* ctxo
) {
Expand All @@ -884,7 +884,7 @@ void astcenc_context_free(
*
* @param[out] ctxo The compressor context.
* @param thread_index The thread index.
* @param image The intput image.
* @param image The input image.
* @param swizzle The input swizzle.
* @param[out] buffer The output array for the compressed data.
*/
Expand Down
6 changes: 3 additions & 3 deletions Source/astcenc_integer_sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ static inline void write_bits(
* @brief Read up to 16 bits from two bytes.
*
* This function reads a packed N-bit field from two bytes in memory. The stored value must exist
* within the two bytes, but can start at an arbitary bit offset and span the two bytes in memory.
* within the two bytes, but can start at an arbitrary bit offset and span the two bytes in memory.
*
* @param bitcount The number of bits to read.
* @param bitoffset The bit offset to read from, between 0 and 7.
Expand Down Expand Up @@ -565,7 +565,7 @@ void encode_ise(

for (unsigned int j = 0; i < character_count; i++, j++)
{
// Truncated table as this iteration is always partital
// Truncated table as this iteration is always partial
static const uint8_t tbits[4] { 2, 2, 1, 2 };
static const uint8_t tshift[4] { 0, 2, 4, 5 };

Expand Down Expand Up @@ -624,7 +624,7 @@ void encode_ise(

for (unsigned int j = 0; i < character_count; i++, j++)
{
// Truncated table as this iteration is always partital
// Truncated table as this iteration is always partial
static const uint8_t tbits[2] { 3, 2 };
static const uint8_t tshift[2] { 0, 3 };

Expand Down
12 changes: 6 additions & 6 deletions Source/astcenc_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static constexpr unsigned int BLOCK_MAX_COMPONENTS { 4 };
/** @brief The maximum number of partitions a block can support. */
static constexpr unsigned int BLOCK_MAX_PARTITIONS { 4 };

/** @brief The number of partitionings, per partition count, suported by the ASTC format. */
/** @brief The number of partitionings, per partition count, supported by the ASTC format. */
static constexpr unsigned int BLOCK_MAX_PARTITIONINGS { 1024 };

/** @brief The maximum number of texels used during partition selection for texel clustering. */
Expand Down Expand Up @@ -1603,7 +1603,7 @@ static inline vmask4 get_u8_component_mask(
/**
* @brief Setup computation of regional averages in an image.
*
* This must be done by only a single thread per image, before any thread calls
* This must be done by a single thread per image, before any thread calls
* @c compute_averages().
*
* Results are written back into @c img->input_alpha_averages.
Expand Down Expand Up @@ -1969,7 +1969,7 @@ unsigned int compute_ideal_endpoint_formats(
* @param pi The partition info for the current trial.
* @param di The weight grid decimation table.
* @param dec_weights_uquant The quantized weight set.
* @param[in,out] ep The color endpoints (modifed in place).
* @param[in,out] ep The color endpoints (modified in place).
* @param[out] rgbs_vectors The RGB+scale vectors for LDR blocks.
* @param[out] rgbo_vectors The RGB+offset vectors for HDR blocks.
*/
Expand All @@ -1993,7 +1993,7 @@ void recompute_ideal_colors_1plane(
* @param di The weight grid decimation table.
* @param dec_weights_uquant_plane1 The quantized weight set for plane 1.
* @param dec_weights_uquant_plane2 The quantized weight set for plane 2.
* @param[in,out] ep The color endpoints (modifed in place).
* @param[in,out] ep The color endpoints (modified in place).
* @param[out] rgbs_vector The RGB+scale color for LDR blocks.
* @param[out] rgbo_vector The RGB+offset color for HDR blocks.
* @param plane2_component The component assigned to plane 2.
Expand Down Expand Up @@ -2063,7 +2063,7 @@ void compress_block(
compression_working_buffers& tmpbuf);

/**
* @brief Decompress a symbolic block in to an image block.
* @brief Decompress a symbolic block into an image block.
*
* @param decode_mode The decode mode (LDR, HDR, etc).
* @param bsd The block size information.
Expand Down Expand Up @@ -2166,7 +2166,7 @@ void symbolic_to_physical(
* flagged as an error block if the encoding is invalid.
*
* @param bsd The block size information.
* @param pcb The physical compresesd block input.
* @param pcb The physical compressed block input.
* @param[out] scb The output symbolic representation.
*/
void physical_to_symbolic(
Expand Down
4 changes: 2 additions & 2 deletions Source/astcenc_mathlib.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2011-2025 Arm Limited
// Copyright 2011-2026 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -545,7 +545,7 @@ void rand_init(uint64_t state[2]);
/**
* @brief Return the next random number from the generator.
*
* This RNG is an implementation of the "xoroshoro-128+ 1.0" PRNG, based on the
* This RNG is an implementation of the "xoroshiro-128+ 1.0" PRNG, based on the
* public-domain implementation given by David Blackman & Sebastiano Vigna at
* http://vigna.di.unimi.it/xorshift/xoroshiro128plus.c
*
Expand Down
10 changes: 5 additions & 5 deletions Source/astcenc_pick_best_endpoint_format.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2011-2025 Arm Limited
// Copyright 2011-2026 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
Expand Down Expand Up @@ -51,13 +51,13 @@
* @brief Compute the errors of the endpoint line options for one partition.
*
* Uncorrelated data assumes storing completely independent RGBA channels for each endpoint. Same
* chroma data assumes storing RGBA endpoints which pass though the origin (LDR only). RGBL data
* chroma data assumes storing RGBA endpoints which pass through the origin (LDR only). RGBL data
* assumes storing RGB + lumashift (HDR only). Luminance error assumes storing RGB channels as a
* single value.
*
*
* @param pi The partition info data.
* @param partition_index The partition index to compule the error for.
* @param partition_index The partition index to compute the error for.
* @param blk The image block.
* @param uncor_pline The endpoint line assuming uncorrelated endpoints.
* @param[out] uncor_err The computed error for the uncorrelated endpoint line.
Expand Down Expand Up @@ -154,7 +154,7 @@ static void compute_error_squared_rgb_single_partition(

haccumulate(uncor_errv, error, mask);

// Compute same chroma error - no "amod", its always zero
// Compute same chroma error - no "amod", it's always zero
param = data_r * samec_bs0
+ data_g * samec_bs1
+ data_b * samec_bs2;
Expand Down Expand Up @@ -184,7 +184,7 @@ static void compute_error_squared_rgb_single_partition(

haccumulate(rgbl_errv, error, mask);

// Compute luma error - no "amod", its always zero
// Compute luma error - no "amod", it's always zero
param = data_r * l_bs0
+ data_g * l_bs1
+ data_b * l_bs2;
Expand Down
2 changes: 1 addition & 1 deletion Source/astcenc_vecmathlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static ASTCENC_SIMD_INLINE vint4 clz(vint4 a)
// the original integer value into a 2^N encoding we can recover easily.

// Convert to float without risk of rounding up by keeping only top 8 bits.
// This trick is is guaranteed to keep top 8 bits and clear the 9th.
// This trick is guaranteed to keep top 8 bits and clear the 9th.
a = (~lsr<8>(a)) & a;
a = float_as_int(int_to_float(a));

Expand Down
2 changes: 1 addition & 1 deletion Source/astcenc_vecmathlib_sse_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ ASTCENC_SIMD_INLINE vint4 vtable_lookup_32bit(
*/
ASTCENC_SIMD_INLINE vint4 interleave_rgba8(vint4 r, vint4 g, vint4 b, vint4 a)
{
// Workaround an XCode compiler internal fault; note is slower than slli_epi32
// Workaround an Xcode compiler internal fault; note it is slower than slli_epi32
// so we should revert this when we get the opportunity
#if defined(__APPLE__)
__m128i value = r.m;
Expand Down
4 changes: 2 additions & 2 deletions Source/astcenccli_entry2.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2024 Arm Limited
// Copyright 2024-2026 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
Expand All @@ -20,7 +20,7 @@
*
* This module contains the second command line entry point veneer, used to
* validate that Arm SVE vector width matches the tool build. When used, it is
* compiled with SVE ISA support but without any vector legnth override, so it
* compiled with SVE ISA support but without any vector length override, so it
* will see the native SVE vector length exposed to the application.
*/

Expand Down
Loading
Loading