Commit 70ad6680 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

vpx_dsp/prob.h: vp9_ -> vpx_

change prefix vp9_ to vpx_ for non codec specific functions and data
structures.

Change-Id: I97c7e6422eceea99212b93f4942bc2187763a07c
parent cbce0037
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "vpx/vpx_integer.h" #include "vpx/vpx_integer.h"
// Unconstrained Node Tree // Unconstrained Node Tree
const vp9_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)] = { const vpx_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
2, 6, // 0 = LOW_VAL 2, 6, // 0 = LOW_VAL
-TWO_TOKEN, 4, // 1 = TWO -TWO_TOKEN, 4, // 1 = TWO
-THREE_TOKEN, -FOUR_TOKEN, // 2 = THREE -THREE_TOKEN, -FOUR_TOKEN, // 2 = THREE
......
...@@ -76,7 +76,7 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat6_prob_high12[18]); ...@@ -76,7 +76,7 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat6_prob_high12[18]);
#define EOB_MODEL_TOKEN 3 #define EOB_MODEL_TOKEN 3
typedef struct { typedef struct {
const vp9_tree_index *tree; const vpx_tree_index *tree;
const vpx_prob *prob; const vpx_prob *prob;
int len; int len;
int base_val; int base_val;
...@@ -160,7 +160,7 @@ static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) { ...@@ -160,7 +160,7 @@ static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
#define PIVOT_NODE 2 // which node is pivot #define PIVOT_NODE 2 // which node is pivot
#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES) #define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES)
extern const vp9_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)]; 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]; extern const vpx_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
typedef vpx_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS] typedef vpx_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS]
......
...@@ -220,7 +220,7 @@ static const vpx_prob default_inter_mode_probs[INTER_MODE_CONTEXTS] ...@@ -220,7 +220,7 @@ static const vpx_prob default_inter_mode_probs[INTER_MODE_CONTEXTS]
}; };
/* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */ /* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */
const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { const vpx_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
-DC_PRED, 2, /* 0 = DC_NODE */ -DC_PRED, 2, /* 0 = DC_NODE */
-TM_PRED, 4, /* 1 = TM_NODE */ -TM_PRED, 4, /* 1 = TM_NODE */
-V_PRED, 6, /* 2 = V_NODE */ -V_PRED, 6, /* 2 = V_NODE */
...@@ -232,13 +232,13 @@ const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = { ...@@ -232,13 +232,13 @@ const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
-D153_PRED, -D207_PRED /* 8 = D153_NODE */ -D153_PRED, -D207_PRED /* 8 = D153_NODE */
}; };
const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)] = { const vpx_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)] = {
-INTER_OFFSET(ZEROMV), 2, -INTER_OFFSET(ZEROMV), 2,
-INTER_OFFSET(NEARESTMV), 4, -INTER_OFFSET(NEARESTMV), 4,
-INTER_OFFSET(NEARMV), -INTER_OFFSET(NEWMV) -INTER_OFFSET(NEARMV), -INTER_OFFSET(NEWMV)
}; };
const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)] = { const vpx_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
-PARTITION_NONE, 2, -PARTITION_NONE, 2,
-PARTITION_HORZ, 4, -PARTITION_HORZ, 4,
-PARTITION_VERT, -PARTITION_SPLIT -PARTITION_VERT, -PARTITION_SPLIT
...@@ -328,7 +328,7 @@ static void init_mode_probs(FRAME_CONTEXT *fc) { ...@@ -328,7 +328,7 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
vp9_copy(fc->inter_mode_probs, default_inter_mode_probs); vp9_copy(fc->inter_mode_probs, default_inter_mode_probs);
} }
const vp9_tree_index vp9_switchable_interp_tree const vpx_tree_index vp9_switchable_interp_tree
[TREE_SIZE(SWITCHABLE_FILTERS)] = { [TREE_SIZE(SWITCHABLE_FILTERS)] = {
-EIGHTTAP, 2, -EIGHTTAP, 2,
-EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP -EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
...@@ -355,24 +355,24 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) { ...@@ -355,24 +355,24 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]); pre_fc->single_ref_prob[i][j], counts->single_ref[i][j]);
for (i = 0; i < INTER_MODE_CONTEXTS; i++) for (i = 0; i < INTER_MODE_CONTEXTS; i++)
vp9_tree_merge_probs(vp9_inter_mode_tree, pre_fc->inter_mode_probs[i], vpx_tree_merge_probs(vp9_inter_mode_tree, pre_fc->inter_mode_probs[i],
counts->inter_mode[i], fc->inter_mode_probs[i]); counts->inter_mode[i], fc->inter_mode_probs[i]);
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) for (i = 0; i < BLOCK_SIZE_GROUPS; i++)
vp9_tree_merge_probs(vp9_intra_mode_tree, pre_fc->y_mode_prob[i], vpx_tree_merge_probs(vp9_intra_mode_tree, pre_fc->y_mode_prob[i],
counts->y_mode[i], fc->y_mode_prob[i]); counts->y_mode[i], fc->y_mode_prob[i]);
for (i = 0; i < INTRA_MODES; ++i) for (i = 0; i < INTRA_MODES; ++i)
vp9_tree_merge_probs(vp9_intra_mode_tree, pre_fc->uv_mode_prob[i], vpx_tree_merge_probs(vp9_intra_mode_tree, pre_fc->uv_mode_prob[i],
counts->uv_mode[i], fc->uv_mode_prob[i]); counts->uv_mode[i], fc->uv_mode_prob[i]);
for (i = 0; i < PARTITION_CONTEXTS; i++) for (i = 0; i < PARTITION_CONTEXTS; i++)
vp9_tree_merge_probs(vp9_partition_tree, pre_fc->partition_prob[i], vpx_tree_merge_probs(vp9_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]); counts->partition[i], fc->partition_prob[i]);
if (cm->interp_filter == SWITCHABLE) { if (cm->interp_filter == SWITCHABLE) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
vp9_tree_merge_probs(vp9_switchable_interp_tree, vpx_tree_merge_probs(vp9_switchable_interp_tree,
pre_fc->switchable_interp_prob[i], pre_fc->switchable_interp_prob[i],
counts->switchable_interp[i], counts->switchable_interp[i],
fc->switchable_interp_prob[i]); fc->switchable_interp_prob[i]);
......
...@@ -82,10 +82,10 @@ extern const vpx_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES] ...@@ -82,10 +82,10 @@ extern const vpx_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1]; [INTRA_MODES - 1];
extern const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS] extern const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1]; [PARTITION_TYPES - 1];
extern const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)]; extern const vpx_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
extern const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)]; extern const vpx_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)];
extern const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)]; extern const vpx_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)];
extern const vp9_tree_index vp9_switchable_interp_tree extern const vpx_tree_index vp9_switchable_interp_tree
[TREE_SIZE(SWITCHABLE_FILTERS)]; [TREE_SIZE(SWITCHABLE_FILTERS)];
void vp9_setup_past_independence(struct VP9Common *cm); void vp9_setup_past_independence(struct VP9Common *cm);
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
// Integer pel reference mv threshold for use of high-precision 1/8 mv // Integer pel reference mv threshold for use of high-precision 1/8 mv
#define COMPANDED_MVREF_THRESH 8 #define COMPANDED_MVREF_THRESH 8
const vp9_tree_index vp9_mv_joint_tree[TREE_SIZE(MV_JOINTS)] = { const vpx_tree_index vp9_mv_joint_tree[TREE_SIZE(MV_JOINTS)] = {
-MV_JOINT_ZERO, 2, -MV_JOINT_ZERO, 2,
-MV_JOINT_HNZVZ, 4, -MV_JOINT_HNZVZ, 4,
-MV_JOINT_HZVNZ, -MV_JOINT_HNZVNZ -MV_JOINT_HZVNZ, -MV_JOINT_HNZVNZ
}; };
const vp9_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = { const vpx_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = {
-MV_CLASS_0, 2, -MV_CLASS_0, 2,
-MV_CLASS_1, 4, -MV_CLASS_1, 4,
6, 8, 6, 8,
...@@ -33,11 +33,11 @@ const vp9_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = { ...@@ -33,11 +33,11 @@ const vp9_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = {
-MV_CLASS_9, -MV_CLASS_10, -MV_CLASS_9, -MV_CLASS_10,
}; };
const vp9_tree_index vp9_mv_class0_tree[TREE_SIZE(CLASS0_SIZE)] = { const vpx_tree_index vp9_mv_class0_tree[TREE_SIZE(CLASS0_SIZE)] = {
-0, -1, -0, -1,
}; };
const vp9_tree_index vp9_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = { const vpx_tree_index vp9_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = {
-0, 2, -0, 2,
-1, 4, -1, 4,
-2, -3 -2, -3
...@@ -183,7 +183,7 @@ void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) { ...@@ -183,7 +183,7 @@ void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
const nmv_context *pre_fc = &cm->frame_contexts[cm->frame_context_idx].nmvc; const nmv_context *pre_fc = &cm->frame_contexts[cm->frame_context_idx].nmvc;
const nmv_context_counts *counts = &cm->counts.mv; const nmv_context_counts *counts = &cm->counts.mv;
vp9_tree_merge_probs(vp9_mv_joint_tree, pre_fc->joints, counts->joints, vpx_tree_merge_probs(vp9_mv_joint_tree, pre_fc->joints, counts->joints,
fc->joints); fc->joints);
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
...@@ -192,19 +192,19 @@ void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) { ...@@ -192,19 +192,19 @@ void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
const nmv_component_counts *c = &counts->comps[i]; const nmv_component_counts *c = &counts->comps[i];
comp->sign = mode_mv_merge_probs(pre_comp->sign, c->sign); comp->sign = mode_mv_merge_probs(pre_comp->sign, c->sign);
vp9_tree_merge_probs(vp9_mv_class_tree, pre_comp->classes, c->classes, vpx_tree_merge_probs(vp9_mv_class_tree, pre_comp->classes, c->classes,
comp->classes); comp->classes);
vp9_tree_merge_probs(vp9_mv_class0_tree, pre_comp->class0, c->class0, vpx_tree_merge_probs(vp9_mv_class0_tree, pre_comp->class0, c->class0,
comp->class0); comp->class0);
for (j = 0; j < MV_OFFSET_BITS; ++j) for (j = 0; j < MV_OFFSET_BITS; ++j)
comp->bits[j] = mode_mv_merge_probs(pre_comp->bits[j], c->bits[j]); comp->bits[j] = mode_mv_merge_probs(pre_comp->bits[j], c->bits[j]);
for (j = 0; j < CLASS0_SIZE; ++j) for (j = 0; j < CLASS0_SIZE; ++j)
vp9_tree_merge_probs(vp9_mv_fp_tree, pre_comp->class0_fp[j], vpx_tree_merge_probs(vp9_mv_fp_tree, pre_comp->class0_fp[j],
c->class0_fp[j], comp->class0_fp[j]); c->class0_fp[j], comp->class0_fp[j]);
vp9_tree_merge_probs(vp9_mv_fp_tree, pre_comp->fp, c->fp, comp->fp); vpx_tree_merge_probs(vp9_mv_fp_tree, pre_comp->fp, c->fp, comp->fp);
if (allow_hp) { if (allow_hp) {
comp->class0_hp = mode_mv_merge_probs(pre_comp->class0_hp, c->class0_hp); comp->class0_hp = mode_mv_merge_probs(pre_comp->class0_hp, c->class0_hp);
......
...@@ -77,10 +77,10 @@ typedef enum { ...@@ -77,10 +77,10 @@ typedef enum {
#define MV_UPP ((1 << MV_IN_USE_BITS) - 1) #define MV_UPP ((1 << MV_IN_USE_BITS) - 1)
#define MV_LOW (-(1 << MV_IN_USE_BITS)) #define MV_LOW (-(1 << MV_IN_USE_BITS))
extern const vp9_tree_index vp9_mv_joint_tree[]; extern const vpx_tree_index vp9_mv_joint_tree[];
extern const vp9_tree_index vp9_mv_class_tree[]; extern const vpx_tree_index vp9_mv_class_tree[];
extern const vp9_tree_index vp9_mv_class0_tree[]; extern const vpx_tree_index vp9_mv_class0_tree[];
extern const vp9_tree_index vp9_mv_fp_tree[]; extern const vpx_tree_index vp9_mv_fp_tree[];
typedef struct { typedef struct {
vpx_prob sign; vpx_prob sign;
......
...@@ -54,7 +54,7 @@ void vp9_set_segdata(struct segmentation *seg, int segment_id, ...@@ -54,7 +54,7 @@ void vp9_set_segdata(struct segmentation *seg, int segment_id,
seg->feature_data[segment_id][feature_id] = seg_data; seg->feature_data[segment_id][feature_id] = seg_data;
} }
const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)] = { const vpx_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)] = {
2, 4, 6, 8, 10, 12, 2, 4, 6, 8, 10, 12,
0, -1, -2, -3, -4, -5, -6, -7 0, -1, -2, -3, -4, -5, -6, -7
}; };
......
...@@ -76,7 +76,7 @@ static INLINE int get_segdata(const struct segmentation *seg, int segment_id, ...@@ -76,7 +76,7 @@ static INLINE int get_segdata(const struct segmentation *seg, int segment_id,
return seg->feature_data[segment_id][feature_id]; return seg->feature_data[segment_id][feature_id];
} }
extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)]; extern const vpx_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)];
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -61,7 +61,7 @@ static void encode_unsigned_max(struct vp9_write_bit_buffer *wb, ...@@ -61,7 +61,7 @@ static void encode_unsigned_max(struct vp9_write_bit_buffer *wb,
vp9_wb_write_literal(wb, data, get_unsigned_bits(max)); vp9_wb_write_literal(wb, data, get_unsigned_bits(max));
} }
static void prob_diff_update(const vp9_tree_index *tree, static void prob_diff_update(const vpx_tree_index *tree,
vpx_prob probs[/*n - 1*/], vpx_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/], const unsigned int counts[/*n - 1*/],
int n, vp9_writer *w) { int n, vp9_writer *w) {
......
...@@ -35,14 +35,14 @@ const unsigned int vp9_prob_cost[256] = { ...@@ -35,14 +35,14 @@ const unsigned int vp9_prob_cost[256] = {
22, 21, 19, 18, 16, 15, 13, 12, 10, 9, 7, 6, 22, 21, 19, 18, 16, 15, 13, 12, 10, 9, 7, 6,
4, 3, 1, 1}; 4, 3, 1, 1};
static void cost(int *costs, vp9_tree tree, const vpx_prob *probs, static void cost(int *costs, vpx_tree tree, const vpx_prob *probs,
int i, int c) { int i, int c) {
const vpx_prob prob = probs[i / 2]; const vpx_prob prob = probs[i / 2];
int b; int b;
for (b = 0; b <= 1; ++b) { for (b = 0; b <= 1; ++b) {
const int cc = c + vp9_cost_bit(prob, b); const int cc = c + vp9_cost_bit(prob, b);
const vp9_tree_index ii = tree[i + b]; const vpx_tree_index ii = tree[i + b];
if (ii <= 0) if (ii <= 0)
costs[-ii] = cc; costs[-ii] = cc;
...@@ -51,11 +51,11 @@ static void cost(int *costs, vp9_tree tree, const vpx_prob *probs, ...@@ -51,11 +51,11 @@ static void cost(int *costs, vp9_tree tree, const vpx_prob *probs,
} }
} }
void vp9_cost_tokens(int *costs, const vpx_prob *probs, vp9_tree tree) { void vp9_cost_tokens(int *costs, const vpx_prob *probs, vpx_tree tree) {
cost(costs, tree, probs, 0, 0); cost(costs, tree, probs, 0, 0);
} }
void vp9_cost_tokens_skip(int *costs, const vpx_prob *probs, vp9_tree tree) { void vp9_cost_tokens_skip(int *costs, const vpx_prob *probs, vpx_tree tree) {
assert(tree[0] <= 0 && tree[1] > 0); assert(tree[0] <= 0 && tree[1] > 0);
costs[-tree[0]] = vp9_cost_bit(probs[0], 0); costs[-tree[0]] = vp9_cost_bit(probs[0], 0);
......
...@@ -21,9 +21,9 @@ extern const unsigned int vp9_prob_cost[256]; ...@@ -21,9 +21,9 @@ extern const unsigned int vp9_prob_cost[256];
#define vp9_cost_zero(prob) (vp9_prob_cost[prob]) #define vp9_cost_zero(prob) (vp9_prob_cost[prob])
#define vp9_cost_one(prob) vp9_cost_zero(vp9_complement(prob)) #define vp9_cost_one(prob) vp9_cost_zero(vpx_complement(prob))
#define vp9_cost_bit(prob, bit) vp9_cost_zero((bit) ? vp9_complement(prob) \ #define vp9_cost_bit(prob, bit) vp9_cost_zero((bit) ? vpx_complement(prob) \
: (prob)) : (prob))
static INLINE unsigned int cost_branch256(const unsigned int ct[2], static INLINE unsigned int cost_branch256(const unsigned int ct[2],
...@@ -31,10 +31,10 @@ static INLINE unsigned int cost_branch256(const unsigned int ct[2], ...@@ -31,10 +31,10 @@ static INLINE unsigned int cost_branch256(const unsigned int ct[2],
return ct[0] * vp9_cost_zero(p) + ct[1] * vp9_cost_one(p); return ct[0] * vp9_cost_zero(p) + ct[1] * vp9_cost_one(p);
} }
static INLINE int treed_cost(vp9_tree tree, const vpx_prob *probs, static INLINE int treed_cost(vpx_tree tree, const vpx_prob *probs,
int bits, int len) { int bits, int len) {
int cost = 0; int cost = 0;
vp9_tree_index i = 0; vpx_tree_index i = 0;
do { do {
const int bit = (bits >> --len) & 1; const int bit = (bits >> --len) & 1;
...@@ -45,8 +45,8 @@ static INLINE int treed_cost(vp9_tree tree, const vpx_prob *probs, ...@@ -45,8 +45,8 @@ static INLINE int treed_cost(vp9_tree tree, const vpx_prob *probs,
return cost; return cost;
} }
void vp9_cost_tokens(int *costs, const vpx_prob *probs, vp9_tree tree); void vp9_cost_tokens(int *costs, const vpx_prob *probs, vpx_tree tree);
void vp9_cost_tokens_skip(int *costs, const vpx_prob *probs, vp9_tree tree); void vp9_cost_tokens_skip(int *costs, const vpx_prob *probs, vpx_tree tree);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -146,7 +146,7 @@ static int update_mv(vp9_writer *w, const unsigned int ct[2], vpx_prob *cur_p, ...@@ -146,7 +146,7 @@ static int update_mv(vp9_writer *w, const unsigned int ct[2], vpx_prob *cur_p,
return update; return update;
} }
static void write_mv_update(const vp9_tree_index *tree, static void write_mv_update(const vpx_tree_index *tree,
vpx_prob probs[/*n - 1*/], vpx_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/], const unsigned int counts[/*n - 1*/],
int n, vp9_writer *w) { int n, vp9_writer *w) {
......
...@@ -52,7 +52,7 @@ const TOKENVALUE *vp9_dct_cat_lt_10_value_tokens = dct_cat_lt_10_value_tokens + ...@@ -52,7 +52,7 @@ const TOKENVALUE *vp9_dct_cat_lt_10_value_tokens = dct_cat_lt_10_value_tokens +
/ 2; / 2;
// Array indices are identical to previously-existing CONTEXT_NODE indices // Array indices are identical to previously-existing CONTEXT_NODE indices
const vp9_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = { const vpx_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
-EOB_TOKEN, 2, // 0 = EOB -EOB_TOKEN, 2, // 0 = EOB
-ZERO_TOKEN, 4, // 1 = ZERO -ZERO_TOKEN, 4, // 1 = ZERO
-ONE_TOKEN, 6, // 2 = ONE -ONE_TOKEN, 6, // 2 = ONE
...@@ -66,12 +66,12 @@ const vp9_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = { ...@@ -66,12 +66,12 @@ const vp9_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
-CATEGORY5_TOKEN, -CATEGORY6_TOKEN // 10 = CAT_FIVE -CATEGORY5_TOKEN, -CATEGORY6_TOKEN // 10 = CAT_FIVE
}; };
static const vp9_tree_index cat1[2] = {0, 0}; static const vpx_tree_index cat1[2] = {0, 0};
static const vp9_tree_index cat2[4] = {2, 2, 0, 0}; static const vpx_tree_index cat2[4] = {2, 2, 0, 0};
static const vp9_tree_index cat3[6] = {2, 2, 4, 4, 0, 0}; static const vpx_tree_index cat3[6] = {2, 2, 4, 4, 0, 0};
static const vp9_tree_index cat4[8] = {2, 2, 4, 4, 6, 6, 0, 0}; static const vpx_tree_index cat4[8] = {2, 2, 4, 4, 6, 6, 0, 0};
static const vp9_tree_index cat5[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0}; static const vpx_tree_index cat5[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0};
static const vp9_tree_index cat6[28] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, static const vpx_tree_index cat6[28] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12,
14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 0, 0}; 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 0, 0};
static const int16_t zero_cost[] = {0}; static const int16_t zero_cost[] = {0};
...@@ -367,20 +367,20 @@ const int16_t vp9_cat6_high12_high_cost[2048] = { ...@@ -367,20 +367,20 @@ const int16_t vp9_cat6_high12_high_cost[2048] = {
#endif #endif
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
static const vp9_tree_index cat1_high10[2] = {0, 0}; static const vpx_tree_index cat1_high10[2] = {0, 0};
static const vp9_tree_index cat2_high10[4] = {2, 2, 0, 0}; static const vpx_tree_index cat2_high10[4] = {2, 2, 0, 0};
static const vp9_tree_index cat3_high10[6] = {2, 2, 4, 4, 0, 0}; static const vpx_tree_index cat3_high10[6] = {2, 2, 4, 4, 0, 0};
static const vp9_tree_index cat4_high10[8] = {2, 2, 4, 4, 6, 6, 0, 0}; static const vpx_tree_index cat4_high10[8] = {2, 2, 4, 4, 6, 6, 0, 0};
static const vp9_tree_index cat5_high10[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0}; static const vpx_tree_index cat5_high10[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0};
static const vp9_tree_index cat6_high10[32] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, static const vpx_tree_index cat6_high10[32] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10,
12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28,
30, 30, 0, 0}; 30, 30, 0, 0};
static const vp9_tree_index cat1_high12[2] = {0, 0}; static const vpx_tree_index cat1_high12[2] = {0, 0};
static const vp9_tree_index cat2_high12[4] = {2, 2, 0, 0}; static const vpx_tree_index cat2_high12[4] = {2, 2, 0, 0};
static const vp9_tree_index cat3_high12[6] = {2, 2, 4, 4, 0, 0}; static const vpx_tree_index cat3_high12[6] = {2, 2, 4, 4, 0, 0};
static const vp9_tree_index cat4_high12[8] = {2, 2, 4, 4, 6, 6, 0, 0}; static const vpx_tree_index cat4_high12[8] = {2, 2, 4, 4, 6, 6, 0, 0};
static const vp9_tree_index cat5_high12[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0}; static const vpx_tree_index cat5_high12[10] = {2, 2, 4, 4, 6, 6, 8, 8, 0, 0};
static const vp9_tree_index cat6_high12[36] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10, static const vpx_tree_index cat6_high12[36] = {2, 2, 4, 4, 6, 6, 8, 8, 10, 10,
12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28,
30, 30, 32, 32, 34, 34, 0, 0}; 30, 30, 32, 32, 34, 34, 0, 0};
#endif #endif
......
...@@ -41,8 +41,8 @@ typedef struct { ...@@ -41,8 +41,8 @@ typedef struct {
uint8_t skip_eob_node; uint8_t skip_eob_node;
} TOKENEXTRA; } TOKENEXTRA;
extern const vp9_tree_index vp9_coef_tree[]; extern const vpx_tree_index vp9_coef_tree[];
extern const vp9_tree_index vp9_coef_con_tree[]; extern const vpx_tree_index vp9_coef_con_tree[];
extern const struct vp9_token vp9_coef_encodings[]; extern const struct vp9_token vp9_coef_encodings[];
int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane); int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
#include "vp9/encoder/vp9_treewriter.h" #include "vp9/encoder/vp9_treewriter.h"
static void tree2tok(struct vp9_token *tokens, const vp9_tree_index *tree, static void tree2tok(struct vp9_token *tokens, const vpx_tree_index *tree,
int i, int v, int l) { int i, int v, int l) {
v += v; v += v;
++l; ++l;
do { do {
const vp9_tree_index j = tree[i++]; const vpx_tree_index j = tree[i++];
if (j <= 0) { if (j <= 0) {
tokens[-j].value = v; tokens[-j].value = v;
tokens[-j].len = l; tokens[-j].len = l;
...@@ -27,11 +27,11 @@ static void tree2tok(struct vp9_token *tokens, const vp9_tree_index *tree, ...@@ -27,11 +27,11 @@ static void tree2tok(struct vp9_token *tokens, const vp9_tree_index *tree,
} }
void vp9_tokens_from_tree(struct vp9_token *tokens, void vp9_tokens_from_tree(struct vp9_token *tokens,
const vp9_tree_index *tree) { const vpx_tree_index *tree) {
tree2tok(tokens, tree, 0, 0, 0); tree2tok(tokens, tree, 0, 0, 0);
} }
static unsigned int convert_distribution(unsigned int i, vp9_tree tree, static unsigned int convert_distribution(unsigned int i, vpx_tree tree,
unsigned int branch_ct[][2], unsigned int branch_ct[][2],
const unsigned int num_events[]) { const unsigned int num_events[]) {
unsigned int left, right; unsigned int left, right;
...@@ -51,7 +51,7 @@ static unsigned int convert_distribution(unsigned int i, vp9_tree tree, ...@@ -51,7 +51,7 @@ static unsigned int convert_distribution(unsigned int i, vp9_tree tree,
return left + right; return left + right;
} }
void vp9_tree_probs_from_distribution(vp9_tree tree, void vp9_tree_probs_from_distribution(vpx_tree tree,
unsigned int branch_ct[/* n-1 */][2], unsigned int branch_ct[/* n-1 */][2],
const unsigned int num_events[/* n */]) { const unsigned int num_events[/* n */]) {
convert_distribution(0, tree, branch_ct, num_events); convert_distribution(0, tree, branch_ct, num_events);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
extern "C" {