diff options
author | derrior <derrior@yandex-team.ru> | 2022-02-10 16:47:29 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:29 +0300 |
commit | 23d4769f0fea97cfb1028710e50f2b5ecd0ac2c0 (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /contrib/libs/brotli/enc/quality.h | |
parent | 9365a6d84363f5cb52059d1867c1fbf075ea63c3 (diff) | |
download | ydb-23d4769f0fea97cfb1028710e50f2b5ecd0ac2c0.tar.gz |
Restoring authorship annotation for <derrior@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/brotli/enc/quality.h')
-rw-r--r-- | contrib/libs/brotli/enc/quality.h | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/contrib/libs/brotli/enc/quality.h b/contrib/libs/brotli/enc/quality.h index b543752ef4..5f4d034503 100644 --- a/contrib/libs/brotli/enc/quality.h +++ b/contrib/libs/brotli/enc/quality.h @@ -10,9 +10,9 @@ #ifndef BROTLI_ENC_QUALITY_H_ #define BROTLI_ENC_QUALITY_H_ -#include "../common/platform.h" +#include "../common/platform.h" #include <brotli/encode.h> -#include "./params.h" +#include "./params.h" #define FAST_ONE_PASS_COMPRESSION_QUALITY 0 #define FAST_TWO_PASS_COMPRESSION_QUALITY 1 @@ -21,7 +21,7 @@ #define MAX_QUALITY_FOR_STATIC_ENTROPY_CODES 2 #define MIN_QUALITY_FOR_BLOCK_SPLIT 4 -#define MIN_QUALITY_FOR_NONZERO_DISTANCE_PARAMS 4 +#define MIN_QUALITY_FOR_NONZERO_DISTANCE_PARAMS 4 #define MIN_QUALITY_FOR_OPTIMIZE_HISTOGRAMS 4 #define MIN_QUALITY_FOR_EXTENSIVE_REFERENCE_SEARCH 5 #define MIN_QUALITY_FOR_CONTEXT_MODELING 5 @@ -30,7 +30,7 @@ /* For quality below MIN_QUALITY_FOR_BLOCK_SPLIT there is no block splitting, so we buffer at most this much literals and commands. */ -#define MAX_NUM_DELAYED_SYMBOLS 0x2FFF +#define MAX_NUM_DELAYED_SYMBOLS 0x2FFF /* Returns hash-table size for quality levels 0 and 1. */ static BROTLI_INLINE size_t MaxHashTableSize(int quality) { @@ -59,15 +59,15 @@ static BROTLI_INLINE size_t MaxZopfliCandidates( static BROTLI_INLINE void SanitizeParams(BrotliEncoderParams* params) { params->quality = BROTLI_MIN(int, BROTLI_MAX_QUALITY, BROTLI_MAX(int, BROTLI_MIN_QUALITY, params->quality)); - if (params->quality <= MAX_QUALITY_FOR_STATIC_ENTROPY_CODES) { - params->large_window = BROTLI_FALSE; - } + if (params->quality <= MAX_QUALITY_FOR_STATIC_ENTROPY_CODES) { + params->large_window = BROTLI_FALSE; + } if (params->lgwin < BROTLI_MIN_WINDOW_BITS) { params->lgwin = BROTLI_MIN_WINDOW_BITS; - } else { - int max_lgwin = params->large_window ? BROTLI_LARGE_MAX_WINDOW_BITS : - BROTLI_MAX_WINDOW_BITS; - if (params->lgwin > max_lgwin) params->lgwin = max_lgwin; + } else { + int max_lgwin = params->large_window ? BROTLI_LARGE_MAX_WINDOW_BITS : + BROTLI_MAX_WINDOW_BITS; + if (params->lgwin > max_lgwin) params->lgwin = max_lgwin; } } @@ -142,24 +142,24 @@ static BROTLI_INLINE void ChooseHasher(const BrotliEncoderParams* params, hparams->num_last_distances_to_check = params->quality < 7 ? 4 : params->quality < 9 ? 10 : 16; } - - if (params->lgwin > 24) { - /* Different hashers for large window brotli: not for qualities <= 2, - these are too fast for large window. Not for qualities >= 10: their - hasher already works well with large window. So the changes are: - H3 --> H35: for quality 3. - H54 --> H55: for quality 4 with size hint > 1MB - H6 --> H65: for qualities 5, 6, 7, 8, 9. */ - if (hparams->type == 3) { - hparams->type = 35; - } - if (hparams->type == 54) { - hparams->type = 55; - } - if (hparams->type == 6) { - hparams->type = 65; - } - } + + if (params->lgwin > 24) { + /* Different hashers for large window brotli: not for qualities <= 2, + these are too fast for large window. Not for qualities >= 10: their + hasher already works well with large window. So the changes are: + H3 --> H35: for quality 3. + H54 --> H55: for quality 4 with size hint > 1MB + H6 --> H65: for qualities 5, 6, 7, 8, 9. */ + if (hparams->type == 3) { + hparams->type = 35; + } + if (hparams->type == 54) { + hparams->type = 55; + } + if (hparams->type == 6) { + hparams->type = 65; + } + } } #endif /* BROTLI_ENC_QUALITY_H_ */ |