mirror of
https://github.com/webmproject/libwebp.git
synced 2025-09-06 19:12:01 +02:00
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:
@@ -26,7 +26,7 @@
|
||||
|
||||
// Warning! This macro triggers quite some MACRO wizardry around func signature!
|
||||
#if !defined(BITTRACE)
|
||||
#define BITTRACE 0 // 0 = off, 1 = print bits, 2 = print bytes
|
||||
#define BITTRACE 0 // 0 = off, 1 = print bits, 2 = print bytes
|
||||
#endif
|
||||
|
||||
#if (BITTRACE > 0)
|
||||
@@ -61,19 +61,19 @@ extern "C" {
|
||||
// BITS can be any multiple of 8 from 8 to 56 (inclusive).
|
||||
// Pick values that fit natural register size.
|
||||
|
||||
#if defined(__i386__) || defined(_M_IX86) // x86 32bit
|
||||
#if defined(__i386__) || defined(_M_IX86) // x86 32bit
|
||||
#define BITS 24
|
||||
#elif defined(__x86_64__) || defined(_M_X64) // x86 64bit
|
||||
#elif defined(__x86_64__) || defined(_M_X64) // x86 64bit
|
||||
#define BITS 56
|
||||
#elif defined(__arm__) || defined(_M_ARM) // ARM
|
||||
#elif defined(__arm__) || defined(_M_ARM) // ARM
|
||||
#define BITS 24
|
||||
#elif WEBP_AARCH64 // ARM 64bit
|
||||
#elif WEBP_AARCH64 // ARM 64bit
|
||||
#define BITS 56
|
||||
#elif defined(__mips__) // MIPS
|
||||
#elif defined(__mips__) // MIPS
|
||||
#define BITS 24
|
||||
#elif defined(__wasm__) // WASM
|
||||
#elif defined(__wasm__) // WASM
|
||||
#define BITS 56
|
||||
#else // reasonable default
|
||||
#else // reasonable default
|
||||
#define BITS 24
|
||||
#endif
|
||||
|
||||
@@ -96,22 +96,22 @@ typedef uint32_t range_t;
|
||||
typedef struct VP8BitReader VP8BitReader;
|
||||
struct VP8BitReader {
|
||||
// boolean decoder (keep the field ordering as is!)
|
||||
bit_t value; // current value
|
||||
range_t range; // current range minus 1. In [127, 254] interval.
|
||||
int bits; // number of valid bits left
|
||||
bit_t value; // current value
|
||||
range_t range; // current range minus 1. In [127, 254] interval.
|
||||
int bits; // number of valid bits left
|
||||
// read buffer
|
||||
const uint8_t* buf; // next byte to be read
|
||||
const uint8_t* buf_end; // end of read buffer
|
||||
const uint8_t* buf_max; // max packed-read position on buffer
|
||||
int eof; // true if input is exhausted
|
||||
const uint8_t* buf; // next byte to be read
|
||||
const uint8_t* buf_end; // end of read buffer
|
||||
const uint8_t* buf_max; // max packed-read position on buffer
|
||||
int eof; // true if input is exhausted
|
||||
};
|
||||
|
||||
// Initialize the bit reader and the boolean decoder.
|
||||
void VP8InitBitReader(VP8BitReader* const br,
|
||||
const uint8_t* const start, size_t size);
|
||||
void VP8InitBitReader(VP8BitReader* const br, const uint8_t* const start,
|
||||
size_t size);
|
||||
// Sets the working read buffer.
|
||||
void VP8BitReaderSetBuffer(VP8BitReader* const br,
|
||||
const uint8_t* const start, size_t size);
|
||||
void VP8BitReaderSetBuffer(VP8BitReader* const br, const uint8_t* const start,
|
||||
size_t size);
|
||||
|
||||
// Update internal pointers to displace the byte buffer by the
|
||||
// relative offset 'offset'.
|
||||
@@ -143,16 +143,15 @@ int32_t VP8GetSignedValue(VP8BitReader* const br, int num_bits,
|
||||
typedef uint64_t vp8l_val_t; // right now, this bit-reader can only use 64bit.
|
||||
|
||||
typedef struct {
|
||||
vp8l_val_t val; // pre-fetched bits
|
||||
const uint8_t* buf; // input byte buffer
|
||||
size_t len; // buffer length
|
||||
size_t pos; // byte position in buf
|
||||
int bit_pos; // current bit-reading position in val
|
||||
int eos; // true if a bit was read past the end of buffer
|
||||
vp8l_val_t val; // pre-fetched bits
|
||||
const uint8_t* buf; // input byte buffer
|
||||
size_t len; // buffer length
|
||||
size_t pos; // byte position in buf
|
||||
int bit_pos; // current bit-reading position in val
|
||||
int eos; // true if a bit was read past the end of buffer
|
||||
} VP8LBitReader;
|
||||
|
||||
void VP8LInitBitReader(VP8LBitReader* const br,
|
||||
const uint8_t* const start,
|
||||
void VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start,
|
||||
size_t length);
|
||||
|
||||
// Sets a new data buffer.
|
||||
@@ -193,7 +192,7 @@ static WEBP_INLINE void VP8LFillBitWindow(VP8LBitReader* const br) {
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBP_UTILS_BIT_READER_UTILS_H_
|
||||
|
Reference in New Issue
Block a user