Commit c8ba8c51 authored by James Zern's avatar James Zern
Browse files

cosmetics: strip 'VP9_' from defines in vp9 only code

Change-Id: I481d9bb2fa3ec72b6a83d5f04d545ad8013f295c
parent 2c6ba737
...@@ -89,9 +89,9 @@ static INLINE int is_inter_mode(MB_PREDICTION_MODE mode) { ...@@ -89,9 +89,9 @@ static INLINE int is_inter_mode(MB_PREDICTION_MODE mode) {
return mode >= NEARESTMV && mode <= NEWMV; return mode >= NEARESTMV && mode <= NEWMV;
} }
#define VP9_INTRA_MODES (TM_PRED + 1) #define INTRA_MODES (TM_PRED + 1)
#define VP9_INTER_MODES (1 + NEWMV - NEARESTMV) #define INTER_MODES (1 + NEWMV - NEARESTMV)
static INLINE int inter_mode_offset(MB_PREDICTION_MODE mode) { static INLINE int inter_mode_offset(MB_PREDICTION_MODE mode) {
return (mode - NEARESTMV); return (mode - NEARESTMV);
......
...@@ -49,7 +49,7 @@ static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -49,7 +49,7 @@ static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
for (k = 0; k < taps; ++k) for (k = 0; k < taps; ++k)
sum += src[src_x + k] * filter_x[k]; sum += src[src_x + k] * filter_x[k];
dst[x] = clip_pixel(ROUND_POWER_OF_TWO(sum, VP9_FILTER_BITS)); dst[x] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
/* Move to the next source pixel */ /* Move to the next source pixel */
x_q4 += x_step_q4; x_q4 += x_step_q4;
...@@ -91,7 +91,7 @@ static void convolve_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -91,7 +91,7 @@ static void convolve_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
sum += src[src_x + k] * filter_x[k]; sum += src[src_x + k] * filter_x[k];
dst[x] = ROUND_POWER_OF_TWO(dst[x] + dst[x] = ROUND_POWER_OF_TWO(dst[x] +
clip_pixel(ROUND_POWER_OF_TWO(sum, VP9_FILTER_BITS)), 1); clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1);
/* Move to the next source pixel */ /* Move to the next source pixel */
x_q4 += x_step_q4; x_q4 += x_step_q4;
...@@ -133,7 +133,7 @@ static void convolve_vert_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -133,7 +133,7 @@ static void convolve_vert_c(const uint8_t *src, ptrdiff_t src_stride,
sum += src[(src_y + k) * src_stride] * filter_y[k]; sum += src[(src_y + k) * src_stride] * filter_y[k];
dst[y * dst_stride] = dst[y * dst_stride] =
clip_pixel(ROUND_POWER_OF_TWO(sum, VP9_FILTER_BITS)); clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
/* Move to the next source pixel */ /* Move to the next source pixel */
y_q4 += y_step_q4; y_q4 += y_step_q4;
...@@ -175,7 +175,7 @@ static void convolve_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride, ...@@ -175,7 +175,7 @@ static void convolve_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
sum += src[(src_y + k) * src_stride] * filter_y[k]; sum += src[(src_y + k) * src_stride] * filter_y[k];
dst[y * dst_stride] = ROUND_POWER_OF_TWO(dst[y * dst_stride] + dst[y * dst_stride] = ROUND_POWER_OF_TWO(dst[y * dst_stride] +
clip_pixel(ROUND_POWER_OF_TWO(sum, VP9_FILTER_BITS)), 1); clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1);
/* Move to the next source pixel */ /* Move to the next source pixel */
y_q4 += y_step_q4; y_q4 += y_step_q4;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "./vpx_config.h" #include "./vpx_config.h"
#include "vpx/vpx_integer.h" #include "vpx/vpx_integer.h"
#define VP9_FILTER_BITS 7 #define FILTER_BITS 7
typedef void (*convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride, typedef void (*convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride, uint8_t *dst, ptrdiff_t dst_stride,
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "vp9/common/vp9_onyxc_int.h" #include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_seg_common.h" #include "vp9/common/vp9_seg_common.h"
const vp9_prob vp9_kf_uv_mode_prob[VP9_INTRA_MODES] const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES]
[VP9_INTRA_MODES - 1] = { [INTRA_MODES - 1] = {
{ 144, 11, 54, 157, 195, 130, 46, 58, 108 } /* y = dc */, { 144, 11, 54, 157, 195, 130, 46, 58, 108 } /* y = dc */,
{ 118, 15, 123, 148, 131, 101, 44, 93, 131 } /* y = v */, { 118, 15, 123, 148, 131, 101, 44, 93, 131 } /* y = v */,
{ 113, 12, 23, 188, 226, 142, 26, 32, 125 } /* y = h */, { 113, 12, 23, 188, 226, 142, 26, 32, 125 } /* y = h */,
...@@ -29,15 +29,15 @@ const vp9_prob vp9_kf_uv_mode_prob[VP9_INTRA_MODES] ...@@ -29,15 +29,15 @@ const vp9_prob vp9_kf_uv_mode_prob[VP9_INTRA_MODES]
}; };
static const vp9_prob default_if_y_probs[BLOCK_SIZE_GROUPS] static const vp9_prob default_if_y_probs[BLOCK_SIZE_GROUPS]
[VP9_INTRA_MODES - 1] = { [INTRA_MODES - 1] = {
{ 65, 32, 18, 144, 162, 194, 41, 51, 98 } /* block_size < 8x8 */, { 65, 32, 18, 144, 162, 194, 41, 51, 98 } /* block_size < 8x8 */,
{ 132, 68, 18, 165, 217, 196, 45, 40, 78 } /* block_size < 16x16 */, { 132, 68, 18, 165, 217, 196, 45, 40, 78 } /* block_size < 16x16 */,
{ 173, 80, 19, 176, 240, 193, 64, 35, 46 } /* block_size < 32x32 */, { 173, 80, 19, 176, 240, 193, 64, 35, 46 } /* block_size < 32x32 */,
{ 221, 135, 38, 194, 248, 121, 96, 85, 29 } /* block_size >= 32x32 */ { 221, 135, 38, 194, 248, 121, 96, 85, 29 } /* block_size >= 32x32 */
}; };
static const vp9_prob default_if_uv_probs[VP9_INTRA_MODES] static const vp9_prob default_if_uv_probs[INTRA_MODES]
[VP9_INTRA_MODES - 1] = { [INTRA_MODES - 1] = {
{ 120, 7, 76, 176, 208, 126, 28, 54, 103 } /* y = dc */, { 120, 7, 76, 176, 208, 126, 28, 54, 103 } /* y = dc */,
{ 48, 12, 154, 155, 139, 90, 34, 117, 119 } /* y = v */, { 48, 12, 154, 155, 139, 90, 34, 117, 119 } /* y = v */,
{ 67, 6, 25, 204, 243, 158, 13, 21, 96 } /* y = h */, { 67, 6, 25, 204, 243, 158, 13, 21, 96 } /* y = h */,
...@@ -98,9 +98,9 @@ static const vp9_prob default_partition_probs[NUM_FRAME_TYPES] ...@@ -98,9 +98,9 @@ static const vp9_prob default_partition_probs[NUM_FRAME_TYPES]
} }
}; };
const vp9_prob vp9_kf_y_mode_prob[VP9_INTRA_MODES] const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES]
[VP9_INTRA_MODES] [INTRA_MODES]
[VP9_INTRA_MODES - 1] = { [INTRA_MODES - 1] = {
{ /* above = dc */ { /* above = dc */
{ 137, 30, 42, 148, 151, 207, 70, 52, 91 } /* left = dc */, { 137, 30, 42, 148, 151, 207, 70, 52, 91 } /* left = dc */,
{ 92, 45, 102, 136, 116, 180, 74, 90, 100 } /* left = v */, { 92, 45, 102, 136, 116, 180, 74, 90, 100 } /* left = v */,
...@@ -215,7 +215,7 @@ const vp9_prob vp9_kf_y_mode_prob[VP9_INTRA_MODES] ...@@ -215,7 +215,7 @@ const vp9_prob vp9_kf_y_mode_prob[VP9_INTRA_MODES]
}; };
static const vp9_prob default_inter_mode_probs[INTER_MODE_CONTEXTS] static const vp9_prob default_inter_mode_probs[INTER_MODE_CONTEXTS]
[VP9_INTER_MODES - 1] = { [INTER_MODES - 1] = {
{2, 173, 34}, // 0 = both zero mv {2, 173, 34}, // 0 = both zero mv
{7, 145, 85}, // 1 = one zero mv + one a predicted mv {7, 145, 85}, // 1 = one zero mv + one a predicted mv
{7, 166, 63}, // 2 = two predicted mvs {7, 166, 63}, // 2 = two predicted mvs
...@@ -226,7 +226,7 @@ static const vp9_prob default_inter_mode_probs[INTER_MODE_CONTEXTS] ...@@ -226,7 +226,7 @@ static const vp9_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[VP9_INTRA_MODES * 2 - 2] = { const vp9_tree_index vp9_intra_mode_tree[INTRA_MODES * 2 - 2] = {
-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 */
...@@ -250,8 +250,8 @@ const vp9_tree_index vp9_partition_tree[6] = { ...@@ -250,8 +250,8 @@ const vp9_tree_index vp9_partition_tree[6] = {
-PARTITION_VERT, -PARTITION_SPLIT -PARTITION_VERT, -PARTITION_SPLIT
}; };
struct vp9_token vp9_intra_mode_encodings[VP9_INTRA_MODES]; struct vp9_token vp9_intra_mode_encodings[INTRA_MODES];
struct vp9_token vp9_inter_mode_encodings[VP9_INTER_MODES]; struct vp9_token vp9_inter_mode_encodings[INTER_MODES];
struct vp9_token vp9_partition_encodings[PARTITION_TYPES]; struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
...@@ -317,8 +317,8 @@ static const vp9_prob default_mbskip_probs[MBSKIP_CONTEXTS] = { ...@@ -317,8 +317,8 @@ static const vp9_prob default_mbskip_probs[MBSKIP_CONTEXTS] = {
192, 128, 64 192, 128, 64
}; };
static const vp9_prob default_switchable_interp_prob[VP9_SWITCHABLE_FILTERS+1] static const vp9_prob default_switchable_interp_prob[SWITCHABLE_FILTERS+1]
[VP9_SWITCHABLE_FILTERS-1] = { [SWITCHABLE_FILTERS-1] = {
{ 235, 162, }, { 235, 162, },
{ 36, 255, }, { 36, 255, },
{ 34, 3, }, { 34, 3, },
...@@ -338,11 +338,11 @@ void vp9_init_mbmode_probs(VP9_COMMON *cm) { ...@@ -338,11 +338,11 @@ void vp9_init_mbmode_probs(VP9_COMMON *cm) {
vp9_copy(cm->fc.mbskip_probs, default_mbskip_probs); vp9_copy(cm->fc.mbskip_probs, default_mbskip_probs);
} }
const vp9_tree_index vp9_switchable_interp_tree[VP9_SWITCHABLE_FILTERS*2-2] = { const vp9_tree_index vp9_switchable_interp_tree[SWITCHABLE_FILTERS*2-2] = {
-EIGHTTAP, 2, -EIGHTTAP, 2,
-EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP -EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
}; };
struct vp9_token vp9_switchable_interp_encodings[VP9_SWITCHABLE_FILTERS]; struct vp9_token vp9_switchable_interp_encodings[SWITCHABLE_FILTERS];
void vp9_entropy_mode_init() { void vp9_entropy_mode_init() {
vp9_tokens_from_tree(vp9_intra_mode_encodings, vp9_intra_mode_tree); vp9_tokens_from_tree(vp9_intra_mode_encodings, vp9_intra_mode_tree);
...@@ -400,17 +400,17 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) { ...@@ -400,17 +400,17 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
counts->single_ref[i][j]); counts->single_ref[i][j]);
for (i = 0; i < INTER_MODE_CONTEXTS; i++) for (i = 0; i < INTER_MODE_CONTEXTS; i++)
update_mode_probs(VP9_INTER_MODES, vp9_inter_mode_tree, update_mode_probs(INTER_MODES, vp9_inter_mode_tree,
counts->inter_mode[i], pre_fc->inter_mode_probs[i], counts->inter_mode[i], pre_fc->inter_mode_probs[i],
fc->inter_mode_probs[i], NEARESTMV); fc->inter_mode_probs[i], NEARESTMV);
for (i = 0; i < BLOCK_SIZE_GROUPS; i++) for (i = 0; i < BLOCK_SIZE_GROUPS; i++)
update_mode_probs(VP9_INTRA_MODES, vp9_intra_mode_tree, update_mode_probs(INTRA_MODES, vp9_intra_mode_tree,
counts->y_mode[i], pre_fc->y_mode_prob[i], counts->y_mode[i], pre_fc->y_mode_prob[i],
fc->y_mode_prob[i], 0); fc->y_mode_prob[i], 0);
for (i = 0; i < VP9_INTRA_MODES; ++i) for (i = 0; i < INTRA_MODES; ++i)
update_mode_probs(VP9_INTRA_MODES, vp9_intra_mode_tree, update_mode_probs(INTRA_MODES, vp9_intra_mode_tree,
counts->uv_mode[i], pre_fc->uv_mode_prob[i], counts->uv_mode[i], pre_fc->uv_mode_prob[i],
fc->uv_mode_prob[i], 0); fc->uv_mode_prob[i], 0);
...@@ -421,8 +421,8 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) { ...@@ -421,8 +421,8 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
fc->partition_prob[INTER_FRAME][i], 0); fc->partition_prob[INTER_FRAME][i], 0);
if (cm->mcomp_filter_type == SWITCHABLE) { if (cm->mcomp_filter_type == SWITCHABLE) {
for (i = 0; i <= VP9_SWITCHABLE_FILTERS; i++) for (i = 0; i <= SWITCHABLE_FILTERS; i++)
update_mode_probs(VP9_SWITCHABLE_FILTERS, vp9_switchable_interp_tree, update_mode_probs(SWITCHABLE_FILTERS, vp9_switchable_interp_tree,
counts->switchable_interp[i], counts->switchable_interp[i],
pre_fc->switchable_interp_prob[i], pre_fc->switchable_interp_prob[i],
fc->switchable_interp_prob[i], 0); fc->switchable_interp_prob[i], 0);
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#define SUBMVREF_COUNT 5 #define SUBMVREF_COUNT 5
#define TX_SIZE_CONTEXTS 2 #define TX_SIZE_CONTEXTS 2
#define VP9_MODE_UPDATE_PROB 252 #define MODE_UPDATE_PROB 252
#define VP9_SWITCHABLE_FILTERS 3 // number of switchable filters #define SWITCHABLE_FILTERS 3 // number of switchable filters
// #define MODE_STATS // #define MODE_STATS
...@@ -35,24 +35,24 @@ struct tx_counts { ...@@ -35,24 +35,24 @@ struct tx_counts {
unsigned int p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 2]; unsigned int p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 2];
}; };
extern const vp9_prob vp9_kf_uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1]; extern const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
extern const vp9_prob vp9_kf_y_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES] extern const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[VP9_INTRA_MODES - 1]; [INTRA_MODES - 1];
extern const vp9_tree_index vp9_intra_mode_tree[]; extern const vp9_tree_index vp9_intra_mode_tree[];
extern const vp9_tree_index vp9_inter_mode_tree[]; extern const vp9_tree_index vp9_inter_mode_tree[];
extern struct vp9_token vp9_intra_mode_encodings[VP9_INTRA_MODES]; extern struct vp9_token vp9_intra_mode_encodings[INTRA_MODES];
extern struct vp9_token vp9_inter_mode_encodings[VP9_INTER_MODES]; extern struct vp9_token vp9_inter_mode_encodings[INTER_MODES];
// probability models for partition information // probability models for partition information
extern const vp9_tree_index vp9_partition_tree[]; extern const vp9_tree_index vp9_partition_tree[];
extern struct vp9_token vp9_partition_encodings[PARTITION_TYPES]; extern struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
extern const vp9_tree_index vp9_switchable_interp_tree extern const vp9_tree_index vp9_switchable_interp_tree
[2 * (VP9_SWITCHABLE_FILTERS - 1)]; [2 * (SWITCHABLE_FILTERS - 1)];
extern struct vp9_token vp9_switchable_interp_encodings[VP9_SWITCHABLE_FILTERS]; extern struct vp9_token vp9_switchable_interp_encodings[SWITCHABLE_FILTERS];
void vp9_entropy_mode_init(); void vp9_entropy_mode_init();
......
...@@ -24,7 +24,7 @@ void vp9_init_mv_probs(struct VP9Common *cm); ...@@ -24,7 +24,7 @@ void vp9_init_mv_probs(struct VP9Common *cm);
void vp9_adapt_mv_probs(struct VP9Common *cm, int usehp); void vp9_adapt_mv_probs(struct VP9Common *cm, int usehp);
int vp9_use_mv_hp(const MV *ref); int vp9_use_mv_hp(const MV *ref);
#define VP9_NMV_UPDATE_PROB 252 #define NMV_UPDATE_PROB 252
/* Symbols for coding which components are zero jointly */ /* Symbols for coding which components are zero jointly */
#define MV_JOINTS 4 #define MV_JOINTS 4
......
...@@ -27,7 +27,7 @@ extern const int16_t vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][SUBPEL_TAPS]; ...@@ -27,7 +27,7 @@ extern const int16_t vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS][SUBPEL_TAPS];
// The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear // The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear
// filter kernel as a 2 tap filter. // filter kernel as a 2 tap filter.
#define VP9_BILINEAR_FILTERS_2TAP(x) \ #define BILINEAR_FILTERS_2TAP(x) \
(vp9_bilinear_filters[(x)] + SUBPEL_TAPS/2 - 1) (vp9_bilinear_filters[(x)] + SUBPEL_TAPS/2 - 1)
#endif // VP9_COMMON_VP9_FILTER_H_ #endif // VP9_COMMON_VP9_FILTER_H_
...@@ -38,14 +38,14 @@ ...@@ -38,14 +38,14 @@
#define NUM_FRAME_CONTEXTS (1 << NUM_FRAME_CONTEXTS_LOG2) #define NUM_FRAME_CONTEXTS (1 << NUM_FRAME_CONTEXTS_LOG2)
typedef struct frame_contexts { typedef struct frame_contexts {
vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][VP9_INTRA_MODES - 1]; vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1];
vp9_prob uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1]; vp9_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
vp9_prob partition_prob[NUM_FRAME_TYPES][NUM_PARTITION_CONTEXTS] vp9_prob partition_prob[NUM_FRAME_TYPES][NUM_PARTITION_CONTEXTS]
[PARTITION_TYPES - 1]; [PARTITION_TYPES - 1];
vp9_coeff_probs_model coef_probs[TX_SIZES][BLOCK_TYPES]; vp9_coeff_probs_model coef_probs[TX_SIZES][BLOCK_TYPES];
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1] vp9_prob switchable_interp_prob[SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS - 1]; [SWITCHABLE_FILTERS - 1];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1]; vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
vp9_prob intra_inter_prob[INTRA_INTER_CONTEXTS]; vp9_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
vp9_prob comp_inter_prob[COMP_INTER_CONTEXTS]; vp9_prob comp_inter_prob[COMP_INTER_CONTEXTS];
vp9_prob single_ref_prob[REF_CONTEXTS][2]; vp9_prob single_ref_prob[REF_CONTEXTS][2];
...@@ -56,15 +56,15 @@ typedef struct frame_contexts { ...@@ -56,15 +56,15 @@ typedef struct frame_contexts {
} FRAME_CONTEXT; } FRAME_CONTEXT;
typedef struct { typedef struct {
unsigned int y_mode[BLOCK_SIZE_GROUPS][VP9_INTRA_MODES]; unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
unsigned int uv_mode[VP9_INTRA_MODES][VP9_INTRA_MODES]; unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
unsigned int partition[NUM_PARTITION_CONTEXTS][PARTITION_TYPES]; unsigned int partition[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
vp9_coeff_count_model coef[TX_SIZES][BLOCK_TYPES]; vp9_coeff_count_model coef[TX_SIZES][BLOCK_TYPES];
unsigned int eob_branch[TX_SIZES][BLOCK_TYPES][REF_TYPES] unsigned int eob_branch[TX_SIZES][BLOCK_TYPES][REF_TYPES]
[COEF_BANDS][PREV_COEF_CONTEXTS]; [COEF_BANDS][PREV_COEF_CONTEXTS];
unsigned int switchable_interp[VP9_SWITCHABLE_FILTERS + 1] unsigned int switchable_interp[SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS]; [SWITCHABLE_FILTERS];
unsigned int inter_mode[INTER_MODE_CONTEXTS][VP9_INTER_MODES]; unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
unsigned int intra_inter[INTRA_INTER_CONTEXTS][2]; unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
unsigned int comp_inter[COMP_INTER_CONTEXTS][2]; unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
unsigned int single_ref[REF_CONTEXTS][2][2]; unsigned int single_ref[REF_CONTEXTS][2][2];
......
...@@ -53,7 +53,7 @@ static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = { ...@@ -53,7 +53,7 @@ static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = {
{ RGB_TO_YUV(0xCC33FF) }, /* Magenta */ { RGB_TO_YUV(0xCC33FF) }, /* Magenta */
}; };
static const unsigned char B_PREDICTION_MODE_colors[VP9_INTRA_MODES][3] = { static const unsigned char B_PREDICTION_MODE_colors[INTRA_MODES][3] = {
{ RGB_TO_YUV(0x6633ff) }, /* Purple */ { RGB_TO_YUV(0x6633ff) }, /* Purple */
{ RGB_TO_YUV(0xcc33ff) }, /* Magenta */ { RGB_TO_YUV(0xcc33ff) }, /* Magenta */
{ RGB_TO_YUV(0xff33cc) }, /* Pink */ { RGB_TO_YUV(0xff33cc) }, /* Pink */
......
...@@ -31,25 +31,25 @@ unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) { ...@@ -31,25 +31,25 @@ unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
const int left_mv_pred = is_inter_mode(left_mbmi->mode); const int left_mv_pred = is_inter_mode(left_mbmi->mode);
const int left_interp = left_in_image && left_mv_pred const int left_interp = left_in_image && left_mv_pred
? left_mbmi->interp_filter ? left_mbmi->interp_filter
: VP9_SWITCHABLE_FILTERS; : SWITCHABLE_FILTERS;
// above // above
const int above_mv_pred = is_inter_mode(above_mbmi->mode); const int above_mv_pred = is_inter_mode(above_mbmi->mode);
const int above_interp = above_in_image && above_mv_pred const int above_interp = above_in_image && above_mv_pred
? above_mbmi->interp_filter ? above_mbmi->interp_filter
: VP9_SWITCHABLE_FILTERS; : SWITCHABLE_FILTERS;
if (left_interp == above_interp) if (left_interp == above_interp)
return left_interp; return left_interp;
else if (left_interp == VP9_SWITCHABLE_FILTERS && else if (left_interp == SWITCHABLE_FILTERS &&
above_interp != VP9_SWITCHABLE_FILTERS) above_interp != SWITCHABLE_FILTERS)
return above_interp; return above_interp;
else if (left_interp != VP9_SWITCHABLE_FILTERS && else if (left_interp != SWITCHABLE_FILTERS &&
above_interp == VP9_SWITCHABLE_FILTERS) above_interp == SWITCHABLE_FILTERS)
return left_interp; return left_interp;
else else
return VP9_SWITCHABLE_FILTERS; return SWITCHABLE_FILTERS;
} }
// Returns a context number for the given MB prediction signal // Returns a context number for the given MB prediction signal
unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd) { unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd) {
......
...@@ -285,7 +285,7 @@ intra_pred_allsizes(dc) ...@@ -285,7 +285,7 @@ intra_pred_allsizes(dc)
typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride, typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
const uint8_t *above, const uint8_t *left); const uint8_t *above, const uint8_t *left);
static intra_pred_fn pred[VP9_INTRA_MODES][4]; static intra_pred_fn pred[INTRA_MODES][4];
static intra_pred_fn dc_pred[2][2][4]; static intra_pred_fn dc_pred[2][2][4];
static void init_intra_pred_fn_ptrs(void) { static void init_intra_pred_fn_ptrs(void) {
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#include "vp9/common/vp9_scale.h" #include "vp9/common/vp9_scale.h"
static INLINE int scaled_x(int val, const struct scale_factors *scale) { static INLINE int scaled_x(int val, const struct scale_factors *scale) {
return val * scale->x_scale_fp >> VP9_REF_SCALE_SHIFT; return val * scale->x_scale_fp >> REF_SCALE_SHIFT;
} }
static INLINE int scaled_y(int val, const struct scale_factors *scale) { static INLINE int scaled_y(int val, const struct scale_factors *scale) {
return val * scale->y_scale_fp >> VP9_REF_SCALE_SHIFT; return val * scale->y_scale_fp >> REF_SCALE_SHIFT;
} }
static int unscaled_value(int val, const struct scale_factors *scale) { static int unscaled_value(int val, const struct scale_factors *scale) {
...@@ -58,7 +58,7 @@ static int get_fixed_point_scale_factor(int other_size, int this_size) { ...@@ -58,7 +58,7 @@ static int get_fixed_point_scale_factor(int other_size, int this_size) {
// and use fixed point scaling factors in decoding and encoding routines. // and use fixed point scaling factors in decoding and encoding routines.
// Hardware implementations can calculate scale factor in device driver // Hardware implementations can calculate scale factor in device driver
// and use multiplication and shifting on hardware instead of division. // and use multiplication and shifting on hardware instead of division.
return (other_size << VP9_REF_SCALE_SHIFT) / this_size; return (other_size << REF_SCALE_SHIFT) / this_size;
} }
static int check_scale_factors(int other_w, int other_h, static int check_scale_factors(int other_w, int other_h,
...@@ -73,8 +73,8 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale, ...@@ -73,8 +73,8 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
int other_w, int other_h, int other_w, int other_h,
int this_w, int this_h) { int this_w, int this_h) {
if (!check_scale_factors(other_w, other_h, this_w, this_h)) { if (!check_scale_factors(other_w, other_h, this_w, this_h)) {
scale->x_scale_fp = VP9_REF_INVALID_SCALE; scale->x_scale_fp = REF_INVALID_SCALE;
scale->y_scale_fp = VP9_REF_INVALID_SCALE; scale->y_scale_fp = REF_INVALID_SCALE;
return; return;
} }
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
#include "vp9/common/vp9_mv.h" #include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_convolve.h" #include "vp9/common/vp9_convolve.h"
#define VP9_REF_SCALE_SHIFT 14 #define REF_SCALE_SHIFT 14
#define VP9_REF_NO_SCALE (1 << VP9_REF_SCALE_SHIFT) #define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
#define VP9_REF_INVALID_SCALE -1 #define REF_INVALID_SCALE -1
struct scale_factors { struct scale_factors {
int x_scale_fp; // horizontal fixed point scale factor int x_scale_fp; // horizontal fixed point scale factor
...@@ -39,13 +39,13 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale, ...@@ -39,13 +39,13 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
int this_w, int this_h); int this_w, int this_h);
static int vp9_is_valid_scale(const struct scale_factors *sf) { static int vp9_is_valid_scale(const struct scale_factors *sf) {
return sf->x_scale_fp != VP9_REF_INVALID_SCALE && return sf->x_scale_fp != REF_INVALID_SCALE &&
sf->y_scale_fp != VP9_REF_INVALID_SCALE; sf->y_scale_fp != REF_INVALID_SCALE;
} }
static int vp9_is_scaled(const struct scale_factors *sf) { static int vp9_is_scaled(const struct scale_factors *sf) {
return sf->x_scale_fp != VP9_REF_NO_SCALE || return sf->x_scale_fp != REF_NO_SCALE ||
sf->y_scale_fp != VP9_REF_NO_SCALE; sf->y_scale_fp != REF_NO_SCALE;
} }
#endif // VP9_COMMON_VP9_SCALE_H_ #endif // VP9_COMMON_VP9_SCALE_H_
...@@ -81,7 +81,7 @@ static void var_filter_block2d_bil_first_pass(const uint8_t *src_ptr, ...@@ -81,7 +81,7 @@ static void var_filter_block2d_bil_first_pass(const uint8_t *src_ptr,
for (j = 0; j < output_width; j++) { for (j = 0; j < output_width; j++) {
output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
(int)src_ptr[pixel_step] * vp9_filter[1], (int)src_ptr[pixel_step] * vp9_filter[1],
VP9_FILTER_BITS); FILTER_BITS);
src_ptr++; src_ptr++;
} }
...@@ -133,7 +133,7 @@ static void var_filter_block2d_bil_second_pass(const uint16_t *src_ptr, ...@@ -133,7 +133,7 @@ static void var_filter_block2d_bil_second_pass(const uint16_t *src_ptr,
for (j = 0; j < output_width; j++) { for (j = 0; j < output_width; j</