vp9_entropy.h revision ba164dffc5a6795bce97fae02b51ccf3330e15e4
1ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang/*
2ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang *
4ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang *  Use of this source code is governed by a BSD-style license
5ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang *  that can be found in the LICENSE file in the root of the source
6ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang *  tree. An additional intellectual property rights grant can be found
7ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang *  in the file PATENTS.  All contributing project authors may
8ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang *  be found in the AUTHORS file in the root of the source tree.
9ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang */
10ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
11ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#ifndef VP9_COMMON_VP9_ENTROPY_H_
12ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define VP9_COMMON_VP9_ENTROPY_H_
13ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
14ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#include "vpx/vpx_integer.h"
15ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#include "vp9/common/vp9_treecoder.h"
16ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#include "vp9/common/vp9_blockd.h"
17ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#include "vp9/common/vp9_common.h"
18ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
19ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang/* Coefficient token alphabet */
20ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
21ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define ZERO_TOKEN              0       /* 0         Extra Bits 0+0 */
22ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define ONE_TOKEN               1       /* 1         Extra Bits 0+1 */
23ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define TWO_TOKEN               2       /* 2         Extra Bits 0+1 */
24ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define THREE_TOKEN             3       /* 3         Extra Bits 0+1 */
25ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define FOUR_TOKEN              4       /* 4         Extra Bits 0+1 */
26ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_VAL_CATEGORY1       5       /* 5-6       Extra Bits 1+1 */
27ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_VAL_CATEGORY2       6       /* 7-10      Extra Bits 2+1 */
28ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_VAL_CATEGORY3       7       /* 11-18     Extra Bits 3+1 */
29ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_VAL_CATEGORY4       8       /* 19-34     Extra Bits 4+1 */
30ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_VAL_CATEGORY5       9       /* 35-66     Extra Bits 5+1 */
31ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_VAL_CATEGORY6       10      /* 67+       Extra Bits 14+1 */
32ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_EOB_TOKEN           11      /* EOB       Extra Bits 0+0 */
33ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define MAX_ENTROPY_TOKENS      12
34ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define ENTROPY_NODES           11
35ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define EOSB_TOKEN              127     /* Not signalled, encoder only */
36ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
37ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define INTER_MODE_CONTEXTS     7
38ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
39ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern const vp9_tree_index vp9_coef_tree[];
40ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
41ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_EOB_MODEL_TOKEN     3      /* EOB       Extra Bits 0+0 */
42ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern const vp9_tree_index vp9_coefmodel_tree[];
43ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
44ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern struct vp9_token vp9_coef_encodings[MAX_ENTROPY_TOKENS];
45ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
46ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangtypedef struct {
47ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  vp9_tree_p tree;
48ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  const vp9_prob *prob;
49ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  int len;
50ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  int base_val;
51ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang} vp9_extra_bit;
52ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
53ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern vp9_extra_bit vp9_extra_bits[12];    /* indexed by token value */
54ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
55ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define PROB_UPDATE_BASELINE_COST   7
56ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
57ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define MAX_PROB                255
58ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define DCT_MAX_VALUE           16384
59ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
60ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang/* Coefficients are predicted via a 3-dimensional probability table. */
61ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
62ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang/* Outside dimension.  0 = Y with DC, 1 = UV */
63ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define BLOCK_TYPES 2
64ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define REF_TYPES 2  // intra=0, inter=1
65ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
66ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang/* Middle dimension reflects the coefficient position within the transform. */
67ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define COEF_BANDS 6
68ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
69ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang/* Inside dimension is measure of nearby complexity, that reflects the energy
70ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   of nearby coefficients are nonzero.  For the first coefficient (DC, unless
71ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   block type is 0), we look at the (already encoded) blocks above and to the
72ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   left of the current block.  The context index is then the number (0,1,or 2)
73ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   of these blocks having nonzero coefficients.
74ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   After decoding a coefficient, the measure is determined by the size of the
75ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   most recently decoded coefficient.
76ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   Note that the intuitive meaning of this measure changes as coefficients
77ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   are decoded, e.g., prior to the first token, a zero means that my neighbors
78ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   are empty while, after the first token, because of the use of end-of-block,
79ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   a zero means we just decoded a zero and hence guarantees that a non-zero
80ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   coefficient will appear later in this block.  However, this shift
81ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   in meaning is perfectly OK because our context depends also on the
82ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   coefficient band (and since zigzag positions 0, 1, and 2 are in
83ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang   distinct bands). */
84ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
85ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang/*# define DC_TOKEN_CONTEXTS        3*/ /* 00, 0!0, !0!0 */
86ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define PREV_COEF_CONTEXTS          6
87ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
88ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// #define ENTROPY_STATS
89ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
90ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangtypedef unsigned int vp9_coeff_count[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
91ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                    [MAX_ENTROPY_TOKENS];
92ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangtypedef unsigned int vp9_coeff_stats[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
93ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                    [ENTROPY_NODES][2];
94ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangtypedef vp9_prob vp9_coeff_probs[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
95ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                [ENTROPY_NODES];
96ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
97ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define SUBEXP_PARAM                4   /* Subexponential code parameter */
98ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define MODULUS_PARAM               13  /* Modulus parameter */
99ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
100ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangstruct VP9Common;
101ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangvoid vp9_default_coef_probs(struct VP9Common *);
102ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_default_scan_4x4[16]);
103ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
104ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_col_scan_4x4[16]);
105ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_row_scan_4x4[16]);
106ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
107ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(64, const int, vp9_default_scan_8x8[64]);
108ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
109ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_col_scan_8x8[64]);
110ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_row_scan_8x8[64]);
111ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
112ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_default_scan_16x16[256]);
113ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
114ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_col_scan_16x16[256]);
115ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_row_scan_16x16[256]);
116ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
117ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern DECLARE_ALIGNED(16, const int, vp9_default_scan_32x32[1024]);
118ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
119ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangvoid vp9_coef_tree_initialize(void);
120ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangvoid vp9_adapt_coef_probs(struct VP9Common *);
121ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
122ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangstatic INLINE void vp9_reset_sb_tokens_context(MACROBLOCKD* const xd,
123ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                               BLOCK_SIZE_TYPE bsize) {
124ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  /* Clear entropy contexts */
125ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  const int bw = 1 << b_width_log2(bsize);
126ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  const int bh = 1 << b_height_log2(bsize);
127ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  int i;
128ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  for (i = 0; i < MAX_MB_PLANE; i++) {
129ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    vpx_memset(xd->plane[i].above_context, 0,
130ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang               sizeof(ENTROPY_CONTEXT) * bw >> xd->plane[i].subsampling_x);
131ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    vpx_memset(xd->plane[i].left_context, 0,
132ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang               sizeof(ENTROPY_CONTEXT) * bh >> xd->plane[i].subsampling_y);
133ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  }
134ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang}
135ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
136ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// This is the index in the scan order beyond which all coefficients for
137ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// 8x8 transform and above are in the top band.
138ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// For 4x4 blocks the index is less but to keep things common the lookup
139ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// table for 4x4 is padded out to this index.
140ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define MAXBAND_INDEX 21
141ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
142ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern const uint8_t vp9_coefband_trans_8x8plus[MAXBAND_INDEX + 1];
143ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern const uint8_t vp9_coefband_trans_4x4[MAXBAND_INDEX + 1];
144ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
145ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
146ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangstatic int get_coef_band(const uint8_t * band_translate, int coef_index) {
147ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  return (coef_index > MAXBAND_INDEX)
148ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    ? (COEF_BANDS-1) : band_translate[coef_index];
149ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang}
150ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
151ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern int vp9_get_coef_context(const int *scan, const int *neighbors,
152ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                int nb_pad, uint8_t *token_cache, int c, int l);
153ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangconst int *vp9_get_coef_neighbors_handle(const int *scan, int *pad);
154ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
155ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
156ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// 128 lists of probabilities are stored for the following ONE node probs:
157ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// 1, 3, 5, 7, ..., 253, 255
158ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang// In between probabilities are interpolated linearly
159ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
160ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define COEFPROB_MODELS             128
161ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
162ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define UNCONSTRAINED_NODES         3
163ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define MODEL_NODES                 (ENTROPY_NODES - UNCONSTRAINED_NODES)
164ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
165ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#define PIVOT_NODE                  2   // which node is pivot
166ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
167ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangtypedef vp9_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS]
168ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                      [PREV_COEF_CONTEXTS]
169ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                      [UNCONSTRAINED_NODES];
170ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
171ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangtypedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS]
172ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                          [PREV_COEF_CONTEXTS]
173ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                          [UNCONSTRAINED_NODES + 1];
174ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangtypedef unsigned int vp9_coeff_stats_model[REF_TYPES][COEF_BANDS]
175ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                          [PREV_COEF_CONTEXTS]
176ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                          [UNCONSTRAINED_NODES][2];
177ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern void vp9_full_to_model_count(unsigned int *model_count,
178ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang                                    unsigned int *full_count);
179ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern void vp9_full_to_model_counts(
180ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    vp9_coeff_count_model *model_count, vp9_coeff_count *full_count);
181ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
182ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangvoid vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full);
183ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
184ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangvoid vp9_model_to_full_probs_sb(
185ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    vp9_prob model[COEF_BANDS][PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES],
186ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    vp9_prob full[COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES]);
187ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
188ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangextern const vp9_prob vp9_modelcoefprobs[COEFPROB_MODELS][ENTROPY_NODES - 1];
189ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
190ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangstatic INLINE const int* get_scan_4x4(TX_TYPE tx_type) {
191ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  switch (tx_type) {
192ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    case ADST_DCT:
193ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_row_scan_4x4;
194ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    case DCT_ADST:
195ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_col_scan_4x4;
196ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    default:
197ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_default_scan_4x4;
198ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  }
199ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang}
200ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
201ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangstatic INLINE const int* get_scan_8x8(TX_TYPE tx_type) {
202ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  switch (tx_type) {
203ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    case ADST_DCT:
204ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_row_scan_8x8;
205ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    case DCT_ADST:
206ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_col_scan_8x8;
207ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    default:
208ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_default_scan_8x8;
209ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  }
210ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang}
211ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
212ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangstatic INLINE const int* get_scan_16x16(TX_TYPE tx_type) {
213ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  switch (tx_type) {
214ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    case ADST_DCT:
215ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_row_scan_16x16;
216ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    case DCT_ADST:
217ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_col_scan_16x16;
218ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang    default:
219ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang      return vp9_default_scan_16x16;
220ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang  }
221ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang}
222ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
223ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuangenum { VP9_COEF_UPDATE_PROB = 252 };
224ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang
225ba164dffc5a6795bce97fae02b51ccf3330e15e4hkuang#endif  // VP9_COMMON_VP9_ENTROPY_H_
226