chromium/third_party/brotli/enc/quality.h

/* Copyright 2016 Google Inc. All Rights Reserved.

   Distributed under MIT license.
   See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/

/* Constants and formulas that affect speed-ratio trade-offs and thus define
   quality levels. */

#ifndef BROTLI_ENC_QUALITY_H_
#define BROTLI_ENC_QUALITY_H_

#include "../common/platform.h"
#include <brotli/encode.h>
#include "params.h"

#define FAST_ONE_PASS_COMPRESSION_QUALITY
#define FAST_TWO_PASS_COMPRESSION_QUALITY
#define ZOPFLIFICATION_QUALITY
#define HQ_ZOPFLIFICATION_QUALITY

#define MAX_QUALITY_FOR_STATIC_ENTROPY_CODES
#define MIN_QUALITY_FOR_BLOCK_SPLIT
#define MIN_QUALITY_FOR_NONZERO_DISTANCE_PARAMS
#define MIN_QUALITY_FOR_OPTIMIZE_HISTOGRAMS
#define MIN_QUALITY_FOR_EXTENSIVE_REFERENCE_SEARCH
#define MIN_QUALITY_FOR_CONTEXT_MODELING
#define MIN_QUALITY_FOR_HQ_CONTEXT_MODELING
#define MIN_QUALITY_FOR_HQ_BLOCK_SPLITTING

/* 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

/* Returns hash-table size for quality levels 0 and 1. */
static BROTLI_INLINE size_t MaxHashTableSize(int quality) {}

/* The maximum length for which the zopflification uses distinct distances. */
#define MAX_ZOPFLI_LEN_QUALITY_10
#define MAX_ZOPFLI_LEN_QUALITY_11

/* Do not thoroughly search when a long copy is found. */
#define BROTLI_LONG_COPY_QUICK_STEP

static BROTLI_INLINE size_t MaxZopfliLen(const BrotliEncoderParams* params) {}

/* Number of best candidates to evaluate to expand Zopfli chain. */
static BROTLI_INLINE size_t MaxZopfliCandidates(
  const BrotliEncoderParams* params) {}

static BROTLI_INLINE void SanitizeParams(BrotliEncoderParams* params) {}

/* Returns optimized lg_block value. */
static BROTLI_INLINE int ComputeLgBlock(const BrotliEncoderParams* params) {}

/* Returns log2 of the size of main ring buffer area.
   Allocate at least lgwin + 1 bits for the ring buffer so that the newly
   added block fits there completely and we still get lgwin bits and at least
   read_block_size_bits + 1 bits because the copy tail length needs to be
   smaller than ring-buffer size. */
static BROTLI_INLINE int ComputeRbBits(const BrotliEncoderParams* params) {}

static BROTLI_INLINE size_t MaxMetablockSize(
    const BrotliEncoderParams* params) {}

/* When searching for backward references and have not seen matches for a long
   time, we can skip some match lookups. Unsuccessful match lookups are very
   expensive and this kind of a heuristic speeds up compression quite a lot.
   At first 8 byte strides are taken and every second byte is put to hasher.
   After 4x more literals stride by 16 bytes, every put 4-th byte to hasher.
   Applied only to qualities 2 to 9. */
static BROTLI_INLINE size_t LiteralSpreeLengthForSparseSearch(
    const BrotliEncoderParams* params) {}

static BROTLI_INLINE void ChooseHasher(const BrotliEncoderParams* params,
                                       BrotliHasherParams* hparams) {}

#endif  /* BROTLI_ENC_QUALITY_H_ */