apply clang-format

(Debian clang-format version 19.1.7 (3+build4)) with `--style=Google`.

Manual changes:
* clang-format disabled around macros with stringification (mostly
  assembly)
* some inline assembly strings were adjusted to avoid awkward line
  breaks
* trailing commas, `//` or suffixes (`ull`) added to help array
  formatting
* thread_utils.c: parameter comments were changed to the more common
  /*...=*/ style to improve formatting

The automatically generated code under swig/ was skipped.

Bug: 433996651
Change-Id: Iea3f24160d78d2a2653971cdf13fa932e47ff1b3
This commit is contained in:
clang-format
2025-07-28 18:23:12 -07:00
committed by James Zern
parent b569988d3f
commit 44257cb826
224 changed files with 16312 additions and 16734 deletions

View File

@@ -23,25 +23,24 @@
extern "C" {
#endif
#define HUFFMAN_TABLE_BITS 8
#define HUFFMAN_TABLE_MASK ((1 << HUFFMAN_TABLE_BITS) - 1)
#define LENGTHS_TABLE_BITS 7
#define LENGTHS_TABLE_MASK ((1 << LENGTHS_TABLE_BITS) - 1)
#define HUFFMAN_TABLE_BITS 8
#define HUFFMAN_TABLE_MASK ((1 << HUFFMAN_TABLE_BITS) - 1)
#define LENGTHS_TABLE_BITS 7
#define LENGTHS_TABLE_MASK ((1 << LENGTHS_TABLE_BITS) - 1)
// Huffman lookup table entry
typedef struct {
uint8_t bits; // number of bits used for this symbol
uint16_t value; // symbol value or table offset
uint8_t bits; // number of bits used for this symbol
uint16_t value; // symbol value or table offset
} HuffmanCode;
// long version for holding 32b values
typedef struct {
int bits; // number of bits used for this symbol,
// or an impossible value if not a literal code.
uint32_t value; // 32b packed ARGB value if literal,
// or non-literal symbol otherwise
int bits; // number of bits used for this symbol,
// or an impossible value if not a literal code.
uint32_t value; // 32b packed ARGB value if literal,
// or non-literal symbol otherwise
} HuffmanCode32;
// Contiguous memory segment of HuffmanCodes.
@@ -81,13 +80,13 @@ void VP8LHuffmanTablesDeallocate(HuffmanTables* const huffman_tables);
typedef struct HTreeGroup HTreeGroup;
struct HTreeGroup {
HuffmanCode* htrees[HUFFMAN_CODES_PER_META_CODE];
int is_trivial_literal; // True, if huffman trees for Red, Blue & Alpha
// Symbols are trivial (have a single code).
uint32_t literal_arb; // If is_trivial_literal is true, this is the
// ARGB value of the pixel, with Green channel
// being set to zero.
int is_trivial_code; // true if is_trivial_literal with only one code
int use_packed_table; // use packed table below for short literal code
int is_trivial_literal; // True, if huffman trees for Red, Blue & Alpha
// Symbols are trivial (have a single code).
uint32_t literal_arb; // If is_trivial_literal is true, this is the
// ARGB value of the pixel, with Green channel
// being set to zero.
int is_trivial_code; // true if is_trivial_literal with only one code
int use_packed_table; // use packed table below for short literal code
// table mapping input bits to a packed values, or escape case to literal code
HuffmanCode32 packed_table[HUFFMAN_PACKED_TABLE_SIZE];
};
@@ -109,7 +108,7 @@ WEBP_NODISCARD int VP8LBuildHuffmanTable(HuffmanTables* const root_table,
int code_lengths_size);
#ifdef __cplusplus
} // extern "C"
} // extern "C"
#endif
#endif // WEBP_UTILS_HUFFMAN_UTILS_H_