Commit ac1e1b69 authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review

Merge "vpx_dsp/bitreader.h: vp9_->vpx_"

parents d4178156 bf82514b
......@@ -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];
......
This diff is collapsed.
......@@ -17,12 +17,12 @@ extern "C" {
#endif
struct VP9Decoder;
struct vp9_read_bit_buffer;
struct vpx_read_bit_buffer;
int vp9_read_sync_code(struct vp9_read_bit_buffer *const rb);
void vp9_read_frame_size(struct vp9_read_bit_buffer *rb,
int vp9_read_sync_code(struct vpx_read_bit_buffer *const rb);
void vp9_read_frame_size(struct vpx_read_bit_buffer *rb,
int *width, int *height);
BITSTREAM_PROFILE vp9_read_profile(struct vp9_read_bit_buffer *rb);
BITSTREAM_PROFILE vp9_read_profile(struct vpx_read_bit_buffer *rb);
void vp9_decode_frame(struct VP9Decoder *pbi,
const uint8_t *data, const uint8_t *data_end,
......
This diff is collapsed.
......@@ -19,8 +19,8 @@
extern "C" {
#endif
void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
int mi_row, int mi_col, vp9_reader *r,
void vpx_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
int mi_row, int mi_col, vpx_reader *r,
int x_mis, int y_mis);
#ifdef __cplusplus
......
......@@ -30,7 +30,7 @@ extern "C" {
// TODO(hkuang): combine this with TileWorkerData.
typedef struct TileData {
VP9_COMMON *cm;
vp9_reader bit_reader;
vpx_reader bit_reader;
DECLARE_ALIGNED(16, MACROBLOCKD, xd);
/* dqcoeff are shared by all the planes. So planes must be decoded serially */
DECLARE_ALIGNED(16, tran_low_t, dqcoeff[32 * 32]);
......@@ -38,7 +38,7 @@ typedef struct TileData {
typedef struct TileWorkerData {
struct VP9Decoder *pbi;
vp9_reader bit_reader;
vpx_reader bit_reader;
FRAME_COUNTS counts;
DECLARE_ALIGNED(16, MACROBLOCKD, xd);
/* dqcoeff are shared by all the planes. So planes must be decoded serially */
......
......@@ -38,10 +38,10 @@
++coef_counts[band][ctx][token]; \
} while (0)
static INLINE int read_coeff(const vp9_prob *probs, int n, vp9_reader *r) {
static INLINE int read_coeff(const vpx_prob *probs, int n, vpx_reader *r) {
int i, val = 0;
for (i = 0; i < n; ++i)
val = (val << 1) | vp9_read(r, probs[i]);
val = (val << 1) | vpx_read(r, probs[i]);
return val;
}
......@@ -49,15 +49,15 @@ static int decode_coefs(const MACROBLOCKD *xd,
PLANE_TYPE type,
tran_low_t *dqcoeff, TX_SIZE tx_size, const int16_t *dq,
int ctx, const int16_t *scan, const int16_t *nb,
vp9_reader *r) {
vpx_reader *r) {
FRAME_COUNTS *counts = xd->counts;
const int max_eob = 16 << (tx_size << 1);
const FRAME_CONTEXT *const fc = xd->fc;
const int ref = is_inter_block(&xd->mi[0]->mbmi);
int band, c = 0;
const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
const vpx_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
fc->coef_probs[tx_size][type][ref];
const vp9_prob *prob;
const vpx_prob *prob;
unsigned int (*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
unsigned int (*eob_branch_count)[COEFF_CONTEXTS];
uint8_t token_cache[32 * 32];
......@@ -117,12 +117,12 @@ static int decode_coefs(const MACROBLOCKD *xd,
prob = coef_probs[band][ctx];
if (counts)
++eob_branch_count[band][ctx];
if (!vp9_read(r, prob[EOB_CONTEXT_NODE])) {
if (!vpx_read(r, prob[EOB_CONTEXT_NODE])) {
INCREMENT_COUNT(EOB_MODEL_TOKEN);
break;
}
while (!vp9_read(r, prob[ZERO_CONTEXT_NODE])) {
while (!vpx_read(r, prob[ZERO_CONTEXT_NODE])) {
INCREMENT_COUNT(ZERO_TOKEN);
dqv = dq[1];
token_cache[scan[c]] = 0;
......@@ -134,13 +134,13 @@ static int decode_coefs(const MACROBLOCKD *xd,
prob = coef_probs[band][ctx];
}
if (!vp9_read(r, prob[ONE_CONTEXT_NODE])) {
if (!vpx_read(r, prob[ONE_CONTEXT_NODE])) {
INCREMENT_COUNT(ONE_TOKEN);
token = ONE_TOKEN;
val = 1;
} else {
INCREMENT_COUNT(TWO_TOKEN);
token = vp9_read_tree(r, vp9_coef_con_tree,
token = vpx_read_tree(r, vp9_coef_con_tree,
vp9_pareto8_full[prob[PIVOT_NODE] - 1]);
switch (token) {
case TWO_TOKEN:
......@@ -188,13 +188,13 @@ static int decode_coefs(const MACROBLOCKD *xd,
v = (val * dqv) >> dq_shift;
#if CONFIG_COEFFICIENT_RANGE_CHECKING
#if CONFIG_VP9_HIGHBITDEPTH
dqcoeff[scan[c]] = highbd_check_range((vp9_read_bit(r) ? -v : v),
dqcoeff[scan[c]] = highbd_check_range((vpx_read_bit(r) ? -v : v),
xd->bd);
#else
dqcoeff[scan[c]] = check_range(vp9_read_bit(r) ? -v : v);
dqcoeff[scan[c]] = check_range(vpx_read_bit(r) ? -v : v);
#endif // CONFIG_VP9_HIGHBITDEPTH
#else
dqcoeff[scan[c]] = vp9_read_bit(r) ? -v : v;
dqcoeff[scan[c]] = vpx_read_bit(r) ? -v : v;
#endif // CONFIG_COEFFICIENT_RANGE_CHECKING
token_cache[scan[c]] = vp9_pt_energy_class[token];
++c;
......@@ -253,7 +253,7 @@ void dec_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
int vp9_decode_block_tokens(MACROBLOCKD *xd,
int plane, const scan_order *sc,
int x, int y,
TX_SIZE tx_size, vp9_reader *r,
TX_SIZE tx_size, vpx_reader *r,
int seg_id) {
struct macroblockd_plane *const pd = &xd->plane[plane];
const int16_t *const dequant = pd->seg_dequant[seg_id];
......
......@@ -23,7 +23,7 @@ extern "C" {
int vp9_decode_block_tokens(MACROBLOCKD *xd,
int plane, const scan_order *sc,
int x, int y,
TX_SIZE tx_size, vp9_reader *r,
TX_SIZE tx_size, vpx_reader *r,
int seg_id);
#ifdef __cplusplus
......
......@@ -21,11 +21,11 @@ static int inv_recenter_nonneg(int v, int m) {
return (v & 1) ? m - ((v + 1) >> 1) : m + (v >> 1);
}
static int decode_uniform(vp9_reader *r) {
static int decode_uniform(vpx_reader *r) {
const int l = 8;
const int m = (1 << l) - 191;
const int v = vp9_read_literal(r, l - 1);
return v < m ? v : (v << 1) - m + vp9_read_bit(r);
const int v = vpx_read_literal(r, l - 1);
return v < m ? v : (v << 1) - m + vpx_read_bit(r);
}
static int inv_remap_prob(int v, int m) {
......@@ -58,19 +58,19 @@ static int inv_remap_prob(int v, int m) {
}
}
static int decode_term_subexp(vp9_reader *r) {
if (!vp9_read_bit(r))
return vp9_read_literal(r, 4);
if (!vp9_read_bit(r))
return vp9_read_literal(r, 4) + 16;
if (!vp9_read_bit(r))
return vp9_read_literal(r, 5) + 32;
static int decode_term_subexp(vpx_reader *r) {
if (!vpx_read_bit(r))
return vpx_read_literal(r, 4);
if (!vpx_read_bit(r))
return vpx_read_literal(r, 4) + 16;
if (!vpx_read_bit(r))
return vpx_read_literal(r, 5) + 32;
return decode_uniform(r) + 64;
}
void vp9_diff_update_prob(vp9_reader *r, vp9_prob* p) {
if (vp9_read(r, DIFF_UPDATE_PROB)) {
void vp9_diff_update_prob(vpx_reader *r, vpx_prob* p) {
if (vpx_read(r, DIFF_UPDATE_PROB)) {
const int delp = decode_term_subexp(r);
*p = (vp9_prob)inv_remap_prob(delp, *p);
*p = (vpx_prob)inv_remap_prob(delp, *p);
}
}
......@@ -18,7 +18,7 @@
extern "C" {
#endif
void vp9_diff_update_prob(vp9_reader *r, vp9_prob* p);
void vp9_diff_update_prob(vpx_reader *r, vpx_prob* p);
#ifdef __cplusplus
} // extern "C"
......
......@@ -45,12 +45,12 @@ static const struct vp9_token inter_mode_encodings[INTER_MODES] =
{{2, 2}, {6, 3}, {0, 1}, {7, 3}};
static void write_intra_mode(vp9_writer *w, PREDICTION_MODE mode,
const vp9_prob *probs) {
const vpx_prob *probs) {
vp9_write_token(w, vp9_intra_mode_tree, probs, &intra_mode_encodings[mode]);
}
static void write_inter_mode(vp9_writer *w, PREDICTION_MODE mode,
const vp9_prob *probs) {
const vpx_prob *probs) {
assert(is_inter_mode(mode));
vp9_write_token(w, vp9_inter_mode_tree, probs,
&inter_mode_encodings[INTER_OFFSET(mode)]);
......@@ -62,7 +62,7 @@ static void encode_unsigned_max(struct vp9_write_bit_buffer *wb,
}
static void prob_diff_update(const vp9_tree_index *tree,
vp9_prob probs[/*n - 1*/],
vpx_prob probs[/*n - 1*/],
const unsigned int counts[/*n - 1*/],
int n, vp9_writer *w) {
int i;
......@@ -81,7 +81,7 @@ static void write_selected_tx_size(const VP9_COMMON *cm,
TX_SIZE tx_size = xd->mi[0]->mbmi.tx_size;
BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
const TX_SIZE max_tx_size = max_txsize_lookup[bsize];
const vp9_prob *const tx_probs = get_tx_probs2(max_tx_size, xd,
const vpx_prob *const tx_probs = get_tx_probs2(max_tx_size, xd,
&cm->fc->tx_probs);
vp9_write(w, tx_size != TX_4X4, tx_probs[0]);
if (tx_size != TX_4X4 && max_tx_size >= TX_16X16) {
......@@ -254,7 +254,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, const MODE_INFO *mi,
if (seg->update_map) {
if (seg->temporal_update) {
const int pred_flag = mbmi->seg_id_predicted;
vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd);
vpx_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd);
vp9_write(w, pred_flag, pred_prob);
if (!pred_flag)
write_segment_id(w, seg, segment_id);
......@@ -290,7 +290,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, const MODE_INFO *mi,
write_intra_mode(w, mbmi->uv_mode, cm->fc->uv_mode_prob[mode]);
} else {
const int mode_ctx = mbmi_ext->mode_context[mbmi->ref_frame[0]];
const vp9_prob *const inter_probs = cm->fc->inter_mode_probs[mode_ctx];
const vpx_prob *const inter_probs = cm->fc->inter_mode_probs[mode_ctx];
write_ref_frames(cm, xd, w);
// If segment skip is not enabled code the mode.
......@@ -407,7 +407,7 @@ static void write_partition(const VP9_COMMON *const cm,
int hbs, int mi_row, int mi_col,
PARTITION_TYPE p, BLOCK_SIZE bsize, vp9_writer *w) {
const int ctx = partition_plane_context(xd, mi_row, mi_col, bsize);
const vp9_prob *const probs = xd->partition_probs[ctx];
const vpx_prob *const probs = xd->partition_probs[ctx];