chromium/third_party/libvpx/source/libvpx/vp9/common/vp9_entropy.h

/*
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef VPX_VP9_COMMON_VP9_ENTROPY_H_
#define VPX_VP9_COMMON_VP9_ENTROPY_H_

#include "vpx/vpx_integer.h"
#include "vpx_dsp/prob.h"

#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_enums.h"

#ifdef __cplusplus
extern "C" {
#endif

#define DIFF_UPDATE_PROB

// Coefficient token alphabet
#define ZERO_TOKEN
#define ONE_TOKEN
#define TWO_TOKEN
#define THREE_TOKEN
#define FOUR_TOKEN
#define CATEGORY1_TOKEN
#define CATEGORY2_TOKEN
#define CATEGORY3_TOKEN
#define CATEGORY4_TOKEN
#define CATEGORY5_TOKEN
#define CATEGORY6_TOKEN
#define EOB_TOKEN

#define ENTROPY_TOKENS

#define ENTROPY_NODES

DECLARE_ALIGNED();

#define CAT1_MIN_VAL
#define CAT2_MIN_VAL
#define CAT3_MIN_VAL
#define CAT4_MIN_VAL
#define CAT5_MIN_VAL
#define CAT6_MIN_VAL

// Extra bit probabilities.
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();

#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
DECLARE_ALIGNED();
#endif  // CONFIG_VP9_HIGHBITDEPTH

#define EOB_MODEL_TOKEN

#define DCT_MAX_VALUE
#if CONFIG_VP9_HIGHBITDEPTH
#define DCT_MAX_VALUE_HIGH10
#define DCT_MAX_VALUE_HIGH12
#endif  // CONFIG_VP9_HIGHBITDEPTH

/* Coefficients are predicted via a 3-dimensional probability table. */

#define REF_TYPES

/* Middle dimension reflects the coefficient position within the transform. */
#define COEF_BANDS

/* Inside dimension is measure of nearby complexity, that reflects the energy
   of nearby coefficients are nonzero.  For the first coefficient (DC, unless
   block type is 0), we look at the (already encoded) blocks above and to the
   left of the current block.  The context index is then the number (0,1,or 2)
   of these blocks having nonzero coefficients.
   After decoding a coefficient, the measure is determined by the size of the
   most recently decoded coefficient.
   Note that the intuitive meaning of this measure changes as coefficients
   are decoded, e.g., prior to the first token, a zero means that my neighbors
   are empty while, after the first token, because of the use of end-of-block,
   a zero means we just decoded a zero and hence guarantees that a non-zero
   coefficient will appear later in this block.  However, this shift
   in meaning is perfectly OK because our context depends also on the
   coefficient band (and since zigzag positions 0, 1, and 2 are in
   distinct bands). */

#define COEFF_CONTEXTS
#define BAND_COEFF_CONTEXTS(band)

// #define ENTROPY_STATS

vp9_coeff_count;
vp9_coeff_stats;

#define SUBEXP_PARAM
#define MODULUS_PARAM

struct VP9Common;
void vp9_default_coef_probs(struct VP9Common *cm);
void vp9_adapt_coef_probs(struct VP9Common *cm);

// This is the index in the scan order beyond which all coefficients for
// 8x8 transform and above are in the top band.
// This macro is currently unused but may be used by certain implementations
#define MAXBAND_INDEX

DECLARE_ALIGNED();
DECLARE_ALIGNED();

static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {}

// 128 lists of probabilities are stored for the following ONE node probs:
// 1, 3, 5, 7, ..., 253, 255
// In between probabilities are interpolated linearly
#define COEFF_PROB_MODELS

#define UNCONSTRAINED_NODES

#define PIVOT_NODE

#define MODEL_NODES
extern const vpx_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)];
extern const vpx_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];

vp9_coeff_probs_model;

vp9_coeff_count_model;

void vp9_model_to_full_probs(const vpx_prob *model, vpx_prob *full);

ENTROPY_CONTEXT;

static INLINE int combine_entropy_contexts(ENTROPY_CONTEXT a,
                                           ENTROPY_CONTEXT b) {}

static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
                                      const ENTROPY_CONTEXT *l) {}

#ifdef __cplusplus
}  // extern "C"
#endif

#endif  // VPX_VP9_COMMON_VP9_ENTROPY_H_