Commit bf82514b authored by Yaowu Xu's avatar Yaowu Xu

vpx_dsp/bitreader.h: vp9_->vpx_

Replace vp9_ in names to vpx_ as they are not codec specific.

Change-Id: I2e583aa63dee769353ada4b42417aa15c4074ebb
parent 149822e3
......@@ -69,8 +69,8 @@ TEST(VP9, TestBitIO) {
// First bit should be zero
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
vp9_reader br;
vp9_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
vpx_reader br;
vpx_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
bit_rnd.Reset(random_seed);
for (int i = 0; i < kBitsToTest; ++i) {
if (bit_method == 2) {
......@@ -78,7 +78,7 @@ TEST(VP9, TestBitIO) {
} else if (bit_method == 3) {
bit = bit_rnd(2);
}
GTEST_ASSERT_EQ(vp9_read(&br, probas[i]), bit)
GTEST_ASSERT_EQ(vpx_read(&br, probas[i]), bit)
<< "pos: " << i << " / " << kBitsToTest
<< " bit_method: " << bit_method
<< " method: " << method;
......
......@@ -166,7 +166,7 @@ typedef struct macroblockd {
int up_available;
int left_available;
const vp9_prob (*partition_probs)[PARTITION_TYPES - 1];
const vpx_prob (*partition_probs)[PARTITION_TYPES - 1];
/* Distance of MB away from frame edges */
int mb_to_left_edge;
......@@ -262,7 +262,7 @@ static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
}
}
static INLINE const vp9_prob *get_y_mode_probs(const MODE_INFO *mi,
static INLINE const vpx_prob *get_y_mode_probs(const MODE_INFO *mi,
const MODE_INFO *above_mi,
const MODE_INFO *left_mi,
int block) {
......
......@@ -27,30 +27,30 @@ const vp9_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
-CATEGORY5_TOKEN, -CATEGORY6_TOKEN // 7 = CAT_FIVE
};
const vp9_prob vp9_cat1_prob[] = { 159 };
const vp9_prob vp9_cat2_prob[] = { 165, 145 };
const vp9_prob vp9_cat3_prob[] = { 173, 148, 140 };
const vp9_prob vp9_cat4_prob[] = { 176, 155, 140, 135 };
const vp9_prob vp9_cat5_prob[] = { 180, 157, 141, 134, 130 };
const vp9_prob vp9_cat6_prob[] = {
const vpx_prob vp9_cat1_prob[] = { 159 };
const vpx_prob vp9_cat2_prob[] = { 165, 145 };
const vpx_prob vp9_cat3_prob[] = { 173, 148, 140 };
const vpx_prob vp9_cat4_prob[] = { 176, 155, 140, 135 };
const vpx_prob vp9_cat5_prob[] = { 180, 157, 141, 134, 130 };
const vpx_prob vp9_cat6_prob[] = {
254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129
};
#if CONFIG_VP9_HIGHBITDEPTH
const vp9_prob vp9_cat1_prob_high10[] = { 159 };
const vp9_prob vp9_cat2_prob_high10[] = { 165, 145 };
const vp9_prob vp9_cat3_prob_high10[] = { 173, 148, 140 };
const vp9_prob vp9_cat4_prob_high10[] = { 176, 155, 140, 135 };
const vp9_prob vp9_cat5_prob_high10[] = { 180, 157, 141, 134, 130 };
const vp9_prob vp9_cat6_prob_high10[] = {
const vpx_prob vp9_cat1_prob_high10[] = { 159 };
const vpx_prob vp9_cat2_prob_high10[] = { 165, 145 };
const vpx_prob vp9_cat3_prob_high10[] = { 173, 148, 140 };
const vpx_prob vp9_cat4_prob_high10[] = { 176, 155, 140, 135 };
const vpx_prob vp9_cat5_prob_high10[] = { 180, 157, 141, 134, 130 };
const vpx_prob vp9_cat6_prob_high10[] = {
255, 255, 254, 254, 254, 252, 249, 243,
230, 196, 177, 153, 140, 133, 130, 129
};
const vp9_prob vp9_cat1_prob_high12[] = { 159 };
const vp9_prob vp9_cat2_prob_high12[] = { 165, 145 };
const vp9_prob vp9_cat3_prob_high12[] = { 173, 148, 140 };
const vp9_prob vp9_cat4_prob_high12[] = { 176, 155, 140, 135 };
const vp9_prob vp9_cat5_prob_high12[] = { 180, 157, 141, 134, 130 };
const vp9_prob vp9_cat6_prob_high12[] = {
const vpx_prob vp9_cat1_prob_high12[] = { 159 };
const vpx_prob vp9_cat2_prob_high12[] = { 165, 145 };
const vpx_prob vp9_cat3_prob_high12[] = { 173, 148, 140 };
const vpx_prob vp9_cat4_prob_high12[] = { 176, 155, 140, 135 };
const vpx_prob vp9_cat5_prob_high12[] = { 180, 157, 141, 134, 130 };
const vpx_prob vp9_cat6_prob_high12[] = {
255, 255, 255, 255, 254, 254, 254, 252, 249,
243, 230, 196, 177, 153, 140, 133, 130, 129
};
......@@ -147,7 +147,7 @@ const uint8_t vp9_pt_energy_class[ENTROPY_TOKENS] = {
// by averaging :
// vp9_pareto8_full[l][node] = (vp9_pareto8_full[l-1][node] +
// vp9_pareto8_full[l+1][node] ) >> 1;
const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
const vpx_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
{ 3, 86, 128, 6, 86, 23, 88, 29},
{ 6, 86, 128, 11, 87, 42, 91, 52},
{ 9, 86, 129, 17, 88, 61, 94, 76},
......@@ -742,14 +742,14 @@ static const vp9_coeff_probs_model default_coef_probs_32x32[PLANE_TYPES] = {
}
};
static void extend_to_full_distribution(vp9_prob *probs, vp9_prob p) {
static void extend_to_full_distribution(vpx_prob *probs, vpx_prob p) {
memcpy(probs, vp9_pareto8_full[p = 0 ? 0 : p - 1],
MODEL_NODES * sizeof(vp9_prob));
MODEL_NODES * sizeof(vpx_prob));
}
void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full) {
void vp9_model_to_full_probs(const vpx_prob *model, vpx_prob *full) {
if (full != model)
memcpy(full, model, sizeof(vp9_prob) * UNCONSTRAINED_NODES);
memcpy(full, model, sizeof(vpx_prob) * UNCONSTRAINED_NODES);
extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]);
}
......
......@@ -77,7 +77,7 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_cat6_prob_high12[18]);
typedef struct {
const vp9_tree_index *tree;
const vp9_prob *prob;
const vpx_prob *prob;
int len;
int base_val;
const int16_t *cost;
......@@ -161,16 +161,16 @@ static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES)
extern const vp9_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)];
extern const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
extern const vpx_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
typedef vp9_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS]
typedef vpx_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS]
[COEFF_CONTEXTS][UNCONSTRAINED_NODES];
typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS]
[COEFF_CONTEXTS]
[UNCONSTRAINED_NODES + 1];
void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full);
void vp9_model_to_full_probs(const vpx_prob *model, vpx_prob *full);
typedef char ENTROPY_CONTEXT;
......
......@@ -13,7 +13,7 @@
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_seg_common.h"
const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = {
const vpx_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = {
{ // above = dc
{ 137, 30, 42, 148, 151, 207, 70, 52, 91 }, // left = dc
{ 92, 45, 102, 136, 116, 180, 74, 90, 100 }, // left = v
......@@ -127,7 +127,7 @@ const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES][INTRA_MODES - 1] = {
}
};
const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1] = {
const vpx_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1] = {
{ 144, 11, 54, 157, 195, 130, 46, 58, 108 }, // y = dc
{ 118, 15, 123, 148, 131, 101, 44, 93, 131 }, // y = v
{ 113, 12, 23, 188, 226, 142, 26, 32, 125 }, // y = h
......@@ -140,14 +140,14 @@ const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1] = {
{ 102, 19, 66, 162, 182, 122, 35, 59, 128 } // y = tm
};
static const vp9_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = {
static const vpx_prob default_if_y_probs[BLOCK_SIZE_GROUPS][INTRA_MODES - 1] = {
{ 65, 32, 18, 144, 162, 194, 41, 51, 98 }, // block_size < 8x8
{ 132, 68, 18, 165, 217, 196, 45, 40, 78 }, // block_size < 16x16
{ 173, 80, 19, 176, 240, 193, 64, 35, 46 }, // block_size < 32x32
{ 221, 135, 38, 194, 248, 121, 96, 85, 29 } // block_size >= 32x32
};
static const vp9_prob default_if_uv_probs[INTRA_MODES][INTRA_MODES - 1] = {
static const vpx_prob default_if_uv_probs[INTRA_MODES][INTRA_MODES - 1] = {
{ 120, 7, 76, 176, 208, 126, 28, 54, 103 }, // y = dc
{ 48, 12, 154, 155, 139, 90, 34, 117, 119 }, // y = v
{ 67, 6, 25, 204, 243, 158, 13, 21, 96 }, // y = h
......@@ -160,7 +160,7 @@ static const vp9_prob default_if_uv_probs[INTRA_MODES][INTRA_MODES - 1] = {
{ 101, 21, 107, 181, 192, 103, 19, 67, 125 } // y = tm
};
const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1] = {
// 8x8 -> 4x4
{ 158, 97, 94 }, // a/l both not split
......@@ -184,7 +184,7 @@ const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
{ 12, 3, 3 }, // a/l both split
};
static const vp9_prob default_partition_probs[PARTITION_CONTEXTS]
static const vpx_prob default_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1] = {
// 8x8 -> 4x4
{ 199, 122, 141 }, // a/l both not split
......@@ -208,7 +208,7 @@ static const vp9_prob default_partition_probs[PARTITION_CONTEXTS]
{ 10, 7, 6 }, // a/l both split
};
static const vp9_prob default_inter_mode_probs[INTER_MODE_CONTEXTS]
static const vpx_prob default_inter_mode_probs[INTER_MODE_CONTEXTS]
[INTER_MODES - 1] = {
{2, 173, 34}, // 0 = both zero mv
{7, 145, 85}, // 1 = one zero mv + one a predicted mv
......@@ -244,19 +244,19 @@ const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
-PARTITION_VERT, -PARTITION_SPLIT
};
static const vp9_prob default_intra_inter_p[INTRA_INTER_CONTEXTS] = {
static const vpx_prob default_intra_inter_p[INTRA_INTER_CONTEXTS] = {
9, 102, 187, 225
};
static const vp9_prob default_comp_inter_p[COMP_INTER_CONTEXTS] = {
static const vpx_prob default_comp_inter_p[COMP_INTER_CONTEXTS] = {
239, 183, 119, 96, 41
};
static const vp9_prob default_comp_ref_p[REF_CONTEXTS] = {
static const vpx_prob default_comp_ref_p[REF_CONTEXTS] = {
50, 126, 123, 221, 226
};
static const vp9_prob default_single_ref_p[REF_CONTEXTS][2] = {
static const vpx_prob default_single_ref_p[REF_CONTEXTS][2] = {
{ 33, 16 },
{ 77, 74 },
{ 142, 142 },
......@@ -302,11 +302,11 @@ void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p,
ct_8x8p[0][1] = tx_count_8x8p[TX_8X8];
}
static const vp9_prob default_skip_probs[SKIP_CONTEXTS] = {
static const vpx_prob default_skip_probs[SKIP_CONTEXTS] = {
192, 128, 64
};
static const vp9_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
static const vpx_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1] = {
{ 235, 162, },
{ 36, 255, },
......
......@@ -28,9 +28,9 @@ extern "C" {
struct VP9Common;
struct tx_probs {
vp9_prob p32x32[TX_SIZE_CONTEXTS][TX_SIZES - 1];
vp9_prob p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 2];
vp9_prob p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 3];
vpx_prob p32x32[TX_SIZE_CONTEXTS][TX_SIZES - 1];
vpx_prob p16x16[TX_SIZE_CONTEXTS][TX_SIZES - 2];
vpx_prob p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 3];
};
struct tx_counts {
......@@ -41,19 +41,19 @@ struct tx_counts {
};
typedef struct frame_contexts {
vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1];
vp9_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
vp9_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
vpx_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1];
vpx_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
vpx_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
vp9_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
vp9_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
vpx_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
[SWITCHABLE_FILTERS - 1];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
vp9_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
vp9_prob comp_inter_prob[COMP_INTER_CONTEXTS];
vp9_prob single_ref_prob[REF_CONTEXTS][2];
vp9_prob comp_ref_prob[REF_CONTEXTS];
vpx_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
vpx_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
vpx_prob comp_inter_prob[COMP_INTER_CONTEXTS];
vpx_prob single_ref_prob[REF_CONTEXTS][2];
vpx_prob comp_ref_prob[REF_CONTEXTS];
struct tx_probs tx_probs;
vp9_prob skip_probs[SKIP_CONTEXTS];
vpx_prob skip_probs[SKIP_CONTEXTS];
nmv_context nmvc;
int initialized;
} FRAME_CONTEXT;
......@@ -77,10 +77,10 @@ typedef struct FRAME_COUNTS {
nmv_context_counts mv;
} FRAME_COUNTS;
extern const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
extern const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
extern const vpx_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
extern const vpx_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1];
extern const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
extern const vpx_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1];
extern const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
extern const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)];
......
......@@ -83,18 +83,18 @@ extern const vp9_tree_index vp9_mv_class0_tree[];
extern const vp9_tree_index vp9_mv_fp_tree[];
typedef struct {
vp9_prob sign;
vp9_prob classes[MV_CLASSES - 1];
vp9_prob class0[CLASS0_SIZE - 1];
vp9_prob bits[MV_OFFSET_BITS];
vp9_prob class0_fp[CLASS0_SIZE][MV_FP_SIZE - 1];
vp9_prob fp[MV_FP_SIZE - 1];
vp9_prob class0_hp;
vp9_prob hp;
vpx_prob sign;
vpx_prob classes[MV_CLASSES - 1];
vpx_prob class0[CLASS0_SIZE - 1];
vpx_prob bits[MV_OFFSET_BITS];
vpx_prob class0_fp[CLASS0_SIZE][MV_FP_SIZE - 1];
vpx_prob fp[MV_FP_SIZE - 1];
vpx_prob class0_hp;
vpx_prob hp;
} nmv_component;
typedef struct {
vp9_prob joints[MV_JOINTS - 1];
vpx_prob joints[MV_JOINTS - 1];
nmv_component comps[2];
} nmv_context;
......
......@@ -345,7 +345,7 @@ static INLINE void set_partition_probs(const VP9_COMMON *const cm,
xd->partition_probs =
frame_is_intra_only(cm) ?
&vp9_kf_partition_probs[0] :
(const vp9_prob (*)[PARTITION_TYPES - 1])cm->fc->partition_prob;
(const vpx_prob (*)[PARTITION_TYPES - 1])cm->fc->partition_prob;
}
static INLINE void vp9_init_macroblockd(VP9_COMMON *cm, MACROBLOCKD *xd,
......@@ -373,7 +373,7 @@ static INLINE void vp9_init_macroblockd(VP9_COMMON *cm, MACROBLOCKD *xd,
set_partition_probs(cm, xd);
}
static INLINE const vp9_prob* get_partition_probs(const MACROBLOCKD *xd,
static INLINE const vpx_prob* get_partition_probs(const MACROBLOCKD *xd,
int ctx) {
return xd->partition_probs[ctx];
}
......
......@@ -47,7 +47,7 @@ static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) {
return above_sip + left_sip;
}
static INLINE vp9_prob vp9_get_pred_prob_seg_id(const struct segmentation *seg,
static INLINE vpx_prob vp9_get_pred_prob_seg_id(const struct segmentation *seg,
const MACROBLOCKD *xd) {
return seg->pred_probs[vp9_get_pred_context_seg_id(xd)];
}
......@@ -60,7 +60,7 @@ static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) {
return above_skip + left_skip;
}
static INLINE vp9_prob vp9_get_skip_prob(const VP9_COMMON *cm,
static INLINE vpx_prob vp9_get_skip_prob(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->skip_probs[vp9_get_skip_context(xd)];
}
......@@ -69,14 +69,14 @@ int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
int vp9_get_intra_inter_context(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm,
static INLINE vpx_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->intra_inter_prob[vp9_get_intra_inter_context(xd)];
}
int vp9_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm,
static INLINE vpx_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->comp_inter_prob[vp9_get_reference_mode_context(cm, xd)];
}
......@@ -84,7 +84,7 @@ static INLINE vp9_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm,
int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
static INLINE vpx_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = vp9_get_pred_context_comp_ref_p(cm, xd);
return cm->fc->comp_ref_prob[pred_context];
......@@ -92,14 +92,14 @@ static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm,
static INLINE vpx_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0];
}
int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm,
static INLINE vpx_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1];
}
......@@ -127,7 +127,7 @@ static INLINE int get_tx_size_context(const MACROBLOCKD *xd) {
return (above_ctx + left_ctx) > max_tx_size;
}
static INLINE const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
static INLINE const vpx_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
const struct tx_probs *tx_probs) {
switch (max_tx_size) {
case TX_8X8:
......@@ -142,7 +142,7 @@ static INLINE const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
}
}
static INLINE const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size,
static INLINE const vpx_prob *get_tx_probs2(TX_SIZE max_tx_size,
const MACROBLOCKD *xd,
const struct tx_probs *tx_probs) {
return get_tx_probs(max_tx_size, get_tx_size_context(xd), tx_probs);
......
......@@ -42,8 +42,8 @@ struct segmentation {
uint8_t abs_delta;
uint8_t temporal_update;
vp9_prob tree_probs[SEG_TREE_PROBS];
vp9_prob pred_probs[PREDICTION_PROBS];
vpx_prob tree_probs[SEG_TREE_PROBS];
vpx_prob pred_probs[PREDICTION_PROBS];
int16_t feature_data[MAX_SEGMENTS][SEG_LVL_MAX];
unsigned int feature_mask[MAX_SEGMENTS];
......
......@@ -74,19 +74,19 @@ static int read_is_valid(const uint8_t *start, size_t len, const uint8_t *end) {
return len != 0 && len <= (size_t)(end - start);
}
static int decode_unsigned_max(struct vp9_read_bit_buffer *rb, int max) {
static int decode_unsigned_max(struct vpx_read_bit_buffer *rb, int max) {
const int data = vp9_rb_read_literal(rb, get_unsigned_bits(max));
return data > max ? max : data;
}
static TX_MODE read_tx_mode(vp9_reader *r) {
TX_MODE tx_mode = vp9_read_literal(r, 2);
static TX_MODE read_tx_mode(vpx_reader *r) {
TX_MODE tx_mode = vpx_read_literal(r, 2);
if (tx_mode == ALLOW_32X32)
tx_mode += vp9_read_bit(r);
tx_mode += vpx_read_bit(r);
return tx_mode;
}
static void read_tx_mode_probs(struct tx_probs *tx_probs, vp9_reader *r) {
static void read_tx_mode_probs(struct tx_probs *tx_probs, vpx_reader *r) {
int i, j;
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
......@@ -102,14 +102,14 @@ static void read_tx_mode_probs(struct tx_probs *tx_probs, vp9_reader *r) {
vp9_diff_update_prob(r, &tx_probs->p32x32[i][j]);
}
static void read_switchable_interp_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
static void read_switchable_interp_probs(FRAME_CONTEXT *fc, vpx_reader *r) {
int i, j;
for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j)
for (i = 0; i < SWITCHABLE_FILTERS - 1; ++i)
vp9_diff_update_prob(r, &fc->switchable_interp_prob[j][i]);
}
static void read_inter_mode_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
static void read_inter_mode_probs(FRAME_CONTEXT *fc, vpx_reader *r) {
int i, j;
for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
for (j = 0; j < INTER_MODES - 1; ++j)
......@@ -117,9 +117,9 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
}
static REFERENCE_MODE read_frame_reference_mode(const VP9_COMMON *cm,
vp9_reader *r) {
vpx_reader *r) {
if (is_compound_reference_allowed(cm)) {
return vp9_read_bit(r) ? (vp9_read_bit(r) ? REFERENCE_MODE_SELECT
return vpx_read_bit(r) ? (vpx_read_bit(r) ? REFERENCE_MODE_SELECT
: COMPOUND_REFERENCE)
: SINGLE_REFERENCE;
} else {
......@@ -127,7 +127,7 @@ static REFERENCE_MODE read_frame_reference_mode(const VP9_COMMON *cm,
}
}
static void read_frame_reference_mode_probs(VP9_COMMON *cm, vp9_reader *r) {
static void read_frame_reference_mode_probs(VP9_COMMON *cm, vpx_reader *r) {
FRAME_CONTEXT *const fc = cm->fc;
int i;
......@@ -146,14 +146,14 @@ static void read_frame_reference_mode_probs(VP9_COMMON *cm, vp9_reader *r) {
vp9_diff_update_prob(r, &fc->comp_ref_prob[i]);
}
static void update_mv_probs(vp9_prob *p, int n, vp9_reader *r) {
static void update_mv_probs(vpx_prob *p, int n, vpx_reader *r) {
int i;
for (i = 0; i < n; ++i)
if (vp9_read(r, MV_UPDATE_PROB))
p[i] = (vp9_read_literal(r, 7) << 1) | 1;
if (vpx_read(r, MV_UPDATE_PROB))
p[i] = (vpx_read_literal(r, 7) << 1) | 1;
}
static void read_mv_probs(nmv_context *ctx, int allow_hp, vp9_reader *r) {
static void read_mv_probs(nmv_context *ctx, int allow_hp, vpx_reader *r) {
int i, j;
update_mv_probs(ctx->joints, MV_JOINTS - 1, r);
......@@ -362,7 +362,7 @@ static void inverse_transform_block_intra(MACROBLOCKD* xd, int plane,
}
static void predict_and_reconstruct_intra_block(MACROBLOCKD *const xd,
vp9_reader *r,
vpx_reader *r,
MB_MODE_INFO *const mbmi,
int plane,
int row, int col,
......@@ -392,7 +392,7 @@ static void predict_and_reconstruct_intra_block(MACROBLOCKD *const xd,
}
}
static int reconstruct_inter_block(MACROBLOCKD *const xd, vp9_reader *r,
static int reconstruct_inter_block(MACROBLOCKD *const xd, vpx_reader *r,
MB_MODE_INFO *const mbmi, int plane,
int row, int col, TX_SIZE tx_size) {
struct macroblockd_plane *const pd = &xd->plane[plane];
......@@ -812,7 +812,7 @@ static MB_MODE_INFO *set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd,
int mi_row, int mi_col,
vp9_reader *r, BLOCK_SIZE bsize,
vpx_reader *r, BLOCK_SIZE bsize,
int bwl, int bhl) {
VP9_COMMON *const cm = &pbi->common;
const int less8x8 = bsize < BLOCK_8X8;
......@@ -832,7 +832,7 @@ static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd,
VPX_CODEC_CORRUPT_FRAME, "Invalid block size.");
}
vp9_read_mode_info(pbi, xd, mi_row, mi_col, r, x_mis, y_mis);
vpx_read_mode_info(pbi, xd, mi_row, mi_col, r, x_mis, y_mis);
if (mbmi->skip) {
dec_reset_skip_context(xd);
......@@ -893,7 +893,7 @@ static void decode_block(VP9Decoder *const pbi, MACROBLOCKD *const xd,
}
}
xd->corrupted |= vp9_reader_has_error(r);
xd->corrupted |= vpx_reader_has_error(r);
}
static INLINE int dec_partition_plane_context(const MACROBLOCKD *xd,
......@@ -923,19 +923,19 @@ static INLINE void dec_update_partition_context(MACROBLOCKD *xd,
}
static PARTITION_TYPE read_partition(MACROBLOCKD *xd, int mi_row, int mi_col,
vp9_reader *r,
vpx_reader *r,
int has_rows, int has_cols, int bsl) {
const int ctx = dec_partition_plane_context(xd, mi_row, mi_col, bsl);
const vp9_prob *const probs = get_partition_probs(xd, ctx);
const vpx_prob *const probs = get_partition_probs(xd, ctx);
FRAME_COUNTS *counts = xd->counts;
PARTITION_TYPE p;
if (has_rows && has_cols)
p = (PARTITION_TYPE)vp9_read_tree(r, vp9_partition_tree, probs);
p = (PARTITION_TYPE)vpx_read_tree(r, vp9_partition_tree, probs);
else if (!has_rows && has_cols)
p = vp9_read(r, probs[1]) ? PARTITION_SPLIT : PARTITION_HORZ;
p = vpx_read(r, probs[1]) ? PARTITION_SPLIT : PARTITION_HORZ;
else if (has_rows && !has_cols)
p = vp9_read(r, probs[2]) ? PARTITION_SPLIT : PARTITION_VERT;
p = vpx_read(r, probs[2]) ? PARTITION_SPLIT : PARTITION_VERT;
else
p = PARTITION_SPLIT;
......@@ -948,7 +948,7 @@ static PARTITION_TYPE read_partition(MACROBLOCKD *xd, int mi_row, int mi_col,
// TODO(slavarnway): eliminate bsize and subsize in future commits
static void decode_partition(VP9Decoder *const pbi, MACROBLOCKD *const xd,
int mi_row, int mi_col,
vp9_reader* r, BLOCK_SIZE bsize