Commit c8ba8c51 authored by James Zern's avatar James Zern

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) {
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) {
return (mode - NEARESTMV);
......
......@@ -49,7 +49,7 @@ static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
for (k = 0; k < taps; ++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 */
x_q4 += x_step_q4;
......@@ -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];
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 */
x_q4 += x_step_q4;
......@@ -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];
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 */
y_q4 += y_step_q4;
......@@ -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];
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 */
y_q4 += y_step_q4;
......
......@@ -13,7 +13,7 @@
#include "./vpx_config.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,
uint8_t *dst, ptrdiff_t dst_stride,
......
......@@ -14,8 +14,8 @@
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_seg_common.h"
const vp9_prob vp9_kf_uv_mode_prob[VP9_INTRA_MODES]
[VP9_INTRA_MODES - 1] = {
const vp9_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 */,
......@@ -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]
[VP9_INTRA_MODES - 1] = {
[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[VP9_INTRA_MODES]
[VP9_INTRA_MODES - 1] = {
static const vp9_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 */,
......@@ -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]
[VP9_INTRA_MODES]
[VP9_INTRA_MODES - 1] = {
const vp9_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 */,
......@@ -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]
[VP9_INTER_MODES - 1] = {
[INTER_MODES - 1] = {
{2, 173, 34}, // 0 = both zero mv
{7, 145, 85}, // 1 = one zero mv + one a predicted mv
{7, 166, 63}, // 2 = two predicted mvs
......@@ -226,7 +226,7 @@ static const vp9_prob default_inter_mode_probs[INTER_MODE_CONTEXTS]
};
/* 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 */
-TM_PRED, 4, /* 1 = TM_NODE */
-V_PRED, 6, /* 2 = V_NODE */
......@@ -250,8 +250,8 @@ const vp9_tree_index vp9_partition_tree[6] = {
-PARTITION_VERT, -PARTITION_SPLIT
};
struct vp9_token vp9_intra_mode_encodings[VP9_INTRA_MODES];
struct vp9_token vp9_inter_mode_encodings[VP9_INTER_MODES];
struct vp9_token vp9_intra_mode_encodings[INTRA_MODES];
struct vp9_token vp9_inter_mode_encodings[INTER_MODES];
struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
......@@ -317,8 +317,8 @@ static const vp9_prob default_mbskip_probs[MBSKIP_CONTEXTS] = {
192, 128, 64
};
static const vp9_prob default_switchable_interp_prob[VP9_SWITCHABLE_FILTERS+1]
[VP9_SWITCHABLE_FILTERS-1] = {
static const vp9_prob default_switchable_interp_prob[SWITCHABLE_FILTERS+1]
[SWITCHABLE_FILTERS-1] = {
{ 235, 162, },
{ 36, 255, },
{ 34, 3, },
......@@ -338,11 +338,11 @@ void vp9_init_mbmode_probs(VP9_COMMON *cm) {
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_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() {
vp9_tokens_from_tree(vp9_intra_mode_encodings, vp9_intra_mode_tree);
......@@ -400,17 +400,17 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
counts->single_ref[i][j]);
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],
fc->inter_mode_probs[i], NEARESTMV);
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],
fc->y_mode_prob[i], 0);
for (i = 0; i < VP9_INTRA_MODES; ++i)
update_mode_probs(VP9_INTRA_MODES, vp9_intra_mode_tree,
for (i = 0; i < INTRA_MODES; ++i)
update_mode_probs(INTRA_MODES, vp9_intra_mode_tree,
counts->uv_mode[i], pre_fc->uv_mode_prob[i],
fc->uv_mode_prob[i], 0);
......@@ -421,8 +421,8 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
fc->partition_prob[INTER_FRAME][i], 0);
if (cm->mcomp_filter_type == SWITCHABLE) {
for (i = 0; i <= VP9_SWITCHABLE_FILTERS; i++)
update_mode_probs(VP9_SWITCHABLE_FILTERS, vp9_switchable_interp_tree,
for (i = 0; i <= SWITCHABLE_FILTERS; i++)
update_mode_probs(SWITCHABLE_FILTERS, vp9_switchable_interp_tree,
counts->switchable_interp[i],
pre_fc->switchable_interp_prob[i],
fc->switchable_interp_prob[i], 0);
......
......@@ -16,8 +16,8 @@
#define SUBMVREF_COUNT 5
#define TX_SIZE_CONTEXTS 2
#define VP9_MODE_UPDATE_PROB 252
#define VP9_SWITCHABLE_FILTERS 3 // number of switchable filters
#define MODE_UPDATE_PROB 252
#define SWITCHABLE_FILTERS 3 // number of switchable filters
// #define MODE_STATS
......@@ -35,24 +35,24 @@ struct tx_counts {
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_y_mode_prob[VP9_INTRA_MODES][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[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1];
extern const vp9_tree_index vp9_intra_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_inter_mode_encodings[VP9_INTER_MODES];
extern struct vp9_token vp9_intra_mode_encodings[INTRA_MODES];
extern struct vp9_token vp9_inter_mode_encodings[INTER_MODES];
// probability models for partition information
extern const vp9_tree_index vp9_partition_tree[];
extern struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
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();
......
......@@ -24,7 +24,7 @@ void vp9_init_mv_probs(struct VP9Common *cm);
void vp9_adapt_mv_probs(struct VP9Common *cm, int usehp);
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 */
#define MV_JOINTS 4
......
......@@ -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
// 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)
#endif // VP9_COMMON_VP9_FILTER_H_
......@@ -38,14 +38,14 @@
#define NUM_FRAME_CONTEXTS (1 << NUM_FRAME_CONTEXTS_LOG2)
typedef struct frame_contexts {
vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][VP9_INTRA_MODES - 1];
vp9_prob uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1];
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[NUM_FRAME_TYPES][NUM_PARTITION_CONTEXTS]
[PARTITION_TYPES - 1];
vp9_coeff_probs_model coef_probs[TX_SIZES][BLOCK_TYPES];
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS - 1];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1];
vp9_prob switchable_interp_prob[SWITCHABLE_FILTERS + 1]
[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];
......@@ -56,15 +56,15 @@ typedef struct frame_contexts {
} FRAME_CONTEXT;
typedef struct {
unsigned int y_mode[BLOCK_SIZE_GROUPS][VP9_INTRA_MODES];
unsigned int uv_mode[VP9_INTRA_MODES][VP9_INTRA_MODES];
unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
unsigned int partition[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
vp9_coeff_count_model coef[TX_SIZES][BLOCK_TYPES];
unsigned int eob_branch[TX_SIZES][BLOCK_TYPES][REF_TYPES]
[COEF_BANDS][PREV_COEF_CONTEXTS];
unsigned int switchable_interp[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS];
unsigned int inter_mode[INTER_MODE_CONTEXTS][VP9_INTER_MODES];
unsigned int switchable_interp[SWITCHABLE_FILTERS + 1]
[SWITCHABLE_FILTERS];
unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
unsigned int comp_inter[COMP_INTER_CONTEXTS][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] = {
{ 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(0xcc33ff) }, /* Magenta */
{ RGB_TO_YUV(0xff33cc) }, /* Pink */
......
......@@ -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_interp = left_in_image && left_mv_pred
? left_mbmi->interp_filter
: VP9_SWITCHABLE_FILTERS;
: SWITCHABLE_FILTERS;
// above
const int above_mv_pred = is_inter_mode(above_mbmi->mode);
const int above_interp = above_in_image && above_mv_pred
? above_mbmi->interp_filter
: VP9_SWITCHABLE_FILTERS;
: SWITCHABLE_FILTERS;
if (left_interp == above_interp)
return left_interp;
else if (left_interp == VP9_SWITCHABLE_FILTERS &&
above_interp != VP9_SWITCHABLE_FILTERS)
else if (left_interp == SWITCHABLE_FILTERS &&
above_interp != SWITCHABLE_FILTERS)
return above_interp;
else if (left_interp != VP9_SWITCHABLE_FILTERS &&
above_interp == VP9_SWITCHABLE_FILTERS)
else if (left_interp != SWITCHABLE_FILTERS &&
above_interp == SWITCHABLE_FILTERS)
return left_interp;
else
return VP9_SWITCHABLE_FILTERS;
return SWITCHABLE_FILTERS;
}
// Returns a context number for the given MB prediction signal
unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd) {
......
......@@ -285,7 +285,7 @@ intra_pred_allsizes(dc)
typedef void (*intra_pred_fn)(uint8_t *dst, ptrdiff_t stride,
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 void init_intra_pred_fn_ptrs(void) {
......
......@@ -13,11 +13,11 @@
#include "vp9/common/vp9_scale.h"
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) {
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) {
......@@ -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.
// Hardware implementations can calculate scale factor in device driver
// 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,
......@@ -73,8 +73,8 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
int other_w, int other_h,
int this_w, int this_h) {
if (!check_scale_factors(other_w, other_h, this_w, this_h)) {
scale->x_scale_fp = VP9_REF_INVALID_SCALE;
scale->y_scale_fp = VP9_REF_INVALID_SCALE;
scale->x_scale_fp = REF_INVALID_SCALE;
scale->y_scale_fp = REF_INVALID_SCALE;
return;
}
......
......@@ -14,9 +14,9 @@
#include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_convolve.h"
#define VP9_REF_SCALE_SHIFT 14
#define VP9_REF_NO_SCALE (1 << VP9_REF_SCALE_SHIFT)
#define VP9_REF_INVALID_SCALE -1
#define REF_SCALE_SHIFT 14
#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
#define REF_INVALID_SCALE -1
struct scale_factors {
int x_scale_fp; // horizontal fixed point scale factor
......@@ -39,13 +39,13 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
int this_w, int this_h);
static int vp9_is_valid_scale(const struct scale_factors *sf) {
return sf->x_scale_fp != VP9_REF_INVALID_SCALE &&
sf->y_scale_fp != VP9_REF_INVALID_SCALE;
return sf->x_scale_fp != REF_INVALID_SCALE &&
sf->y_scale_fp != REF_INVALID_SCALE;
}
static int vp9_is_scaled(const struct scale_factors *sf) {
return sf->x_scale_fp != VP9_REF_NO_SCALE ||
sf->y_scale_fp != VP9_REF_NO_SCALE;
return sf->x_scale_fp != REF_NO_SCALE ||
sf->y_scale_fp != REF_NO_SCALE;
}
#endif // VP9_COMMON_VP9_SCALE_H_
......@@ -81,7 +81,7 @@ static void var_filter_block2d_bil_first_pass(const uint8_t *src_ptr,
for (j = 0; j < output_width; j++) {
output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
(int)src_ptr[pixel_step] * vp9_filter[1],
VP9_FILTER_BITS);
FILTER_BITS);
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++) {
output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
(int)src_ptr[pixel_step] * vp9_filter[1],
VP9_FILTER_BITS);
FILTER_BITS);
src_ptr++;
}
......
......@@ -16,7 +16,7 @@
// This is meant to be a large, positive constant that can still be efficiently
// loaded as an immediate (on platforms like ARM, for example).
// Even relatively modest values like 100 would work fine.
#define VP9_LOTS_OF_BITS 0x40000000
#define LOTS_OF_BITS 0x40000000
int vp9_reader_init(vp9_reader *r, const uint8_t *buffer, size_t size) {
......@@ -41,13 +41,13 @@ void vp9_reader_fill(vp9_reader *r) {
const uint8_t *buffer = r->buffer;
VP9_BD_VALUE value = r->value;
int count = r->count;
int shift = VP9_BD_VALUE_SIZE - 8 - (count + 8);
int shift = BD_VALUE_SIZE - 8 - (count + 8);
int loop_end = 0;
const int bits_left = (int)((buffer_end - buffer)*CHAR_BIT);
const int x = shift + CHAR_BIT - bits_left;
if (x >= 0) {
count += VP9_LOTS_OF_BITS;
count += LOTS_OF_BITS;
loop_end = x;
}
......@@ -66,7 +66,7 @@ void vp9_reader_fill(vp9_reader *r) {
const uint8_t *vp9_reader_find_end(vp9_reader *r) {
// Find the end of the coded buffer
while (r->count > CHAR_BIT && r->count < VP9_BD_VALUE_SIZE) {
while (r->count > CHAR_BIT && r->count < BD_VALUE_SIZE) {
r->count -= CHAR_BIT;
r->buffer--;
}
......@@ -83,10 +83,10 @@ int vp9_reader_has_error(vp9_reader *r) {
//
// When reading a byte from the user's buffer, count is filled with 8 and
// one byte is filled into the value buffer. When we reach the end of the
// data, count is additionally filled with VP9_LOTS_OF_BITS. So when
// count == VP9_LOTS_OF_BITS - 1, the user's data has been exhausted.
// data, count is additionally filled with LOTS_OF_BITS. So when
// count == LOTS_OF_BITS - 1, the user's data has been exhausted.
//
// 1 if we have tried to decode bits after the end of stream was encountered.
// 0 No error.
return r->count > VP9_BD_VALUE_SIZE && r->count < VP9_LOTS_OF_BITS;
return r->count > BD_VALUE_SIZE && r->count < LOTS_OF_BITS;
}
......@@ -20,7 +20,7 @@
typedef size_t VP9_BD_VALUE;
#define VP9_BD_VALUE_SIZE ((int)sizeof(VP9_BD_VALUE)*CHAR_BIT)
#define BD_VALUE_SIZE ((int)sizeof(VP9_BD_VALUE)*CHAR_BIT)
typedef struct {
const uint8_t *buffer_end;
......@@ -52,7 +52,7 @@ static int vp9_read(vp9_reader *br, int probability) {
value = br->value;
count = br->count;
bigsplit = (VP9_BD_VALUE)split << (VP9_BD_VALUE_SIZE - 8);
bigsplit = (VP9_BD_VALUE)split << (BD_VALUE_SIZE - 8);
range = split;
......
......@@ -251,7 +251,7 @@ static INLINE void read_mv(vp9_reader *r, MV *mv, const MV *ref,
}
static void update_mv(vp9_reader *r, vp9_prob *p) {
if (vp9_read(r, VP9_NMV_UPDATE_PROB))
if (vp9_read(r, NMV_UPDATE_PROB))
*p = (vp9_read_literal(r, 7) << 1) | 1;
}
......@@ -345,17 +345,17 @@ static void read_ref_frames(VP9D_COMP *pbi, vp9_reader *r,
static void read_switchable_interp_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
int i, j;
for (j = 0; j < VP9_SWITCHABLE_FILTERS + 1; ++j)
for (i = 0; i < VP9_SWITCHABLE_FILTERS - 1; ++i)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
for (j = 0; j < SWITCHABLE_FILTERS + 1; ++j)
for (i = 0; i < SWITCHABLE_FILTERS - 1; ++i)
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &fc->switchable_interp_prob[j][i]);
}
static void read_inter_mode_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
int i, j;
for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
for (j = 0; j < VP9_INTER_MODES - 1; ++j)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
for (j = 0; j < INTER_MODES - 1; ++j)
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &fc->inter_mode_probs[i][j]);
}
......@@ -615,20 +615,20 @@ static void read_comp_pred(VP9_COMMON *cm, vp9_reader *r) {
if (cm->comp_pred_mode == HYBRID_PREDICTION)
for (i = 0; i < COMP_INTER_CONTEXTS; i++)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.comp_inter_prob[i]);
if (cm->comp_pred_mode != COMP_PREDICTION_ONLY)
for (i = 0; i < REF_CONTEXTS; i++) {
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.single_ref_prob[i][0]);
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.single_ref_prob[i][1]);
}
if (cm->comp_pred_mode != SINGLE_PREDICTION_ONLY)
for (i = 0; i < REF_CONTEXTS; i++)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.comp_ref_prob[i]);
}
......@@ -639,7 +639,7 @@ void vp9_prepare_read_mode_info(VP9D_COMP* pbi, vp9_reader *r) {
// TODO(jkoleszar): does this clear more than MBSKIP_CONTEXTS? Maybe remove.
// vpx_memset(cm->fc.mbskip_probs, 0, sizeof(cm->fc.mbskip_probs));
for (k = 0; k < MBSKIP_CONTEXTS; ++k)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.mbskip_probs[k]);
if (cm->frame_type != KEY_FRAME && !cm->intra_only) {
......@@ -653,19 +653,19 @@ void vp9_prepare_read_mode_info(VP9D_COMP* pbi, vp9_reader *r) {
read_switchable_interp_probs(&cm->fc, r);
for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.intra_inter_prob[i]);
read_comp_pred(cm, r);
for (j = 0; j < BLOCK_SIZE_GROUPS; j++)
for (i = 0; i < VP9_INTRA_MODES - 1; ++i)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
for (i = 0; i < INTRA_MODES - 1; ++i)
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.y_mode_prob[j][i]);
for (j = 0; j < NUM_PARTITION_CONTEXTS; ++j)
for (i = 0; i < PARTITION_TYPES - 1; ++i)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &cm->fc.partition_prob[INTER_FRAME][j][i]);
read_mv_probs(r, nmvc, xd->allow_high_precision_mv);
......
......@@ -63,17 +63,17 @@ static void read_tx_probs(struct tx_probs *tx_probs, vp9_reader *r) {
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
for (j = 0; j < TX_SIZES - 3; ++j)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &tx_probs->p8x8[i][j]);
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
for (j = 0; j < TX_SIZES - 2; ++j)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &tx_probs->p16x16[i][j]);
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
for (j = 0; j < TX_SIZES - 1; ++j)
if (vp9_read(r, VP9_MODE_UPDATE_PROB))
if (vp9_read(r, MODE_UPDATE_PROB))
vp9_diff_update_prob(r, &tx_probs->p32x32[i][j]);
}
......
......@@ -41,9 +41,9 @@ unsigned __int64 Sectionbits[500];
#endif
#ifdef ENTROPY_STATS
int intra_mode_stats[VP9_INTRA_MODES]
[VP9_INTRA_MODES]
[VP9_INTRA_MODES];
int intra_mode_stats[INTRA_MODES]
[INTRA_MODES]
[INTRA_MODES];
vp9_coeff_stats tree_update_hist[TX_SIZES][BLOCK_TYPES];
extern unsigned int active_section;
......@@ -54,8 +54,8 @@ extern unsigned int active_section;
int64_t tx_count_32x32p_stats[TX_SIZE_CONTEXTS][TX_SIZES];
int64_t tx_count_16x16p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 1];
int64_t tx_count_8x8p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 2];
int64_t switchable_interp_stats[VP9_SWITCHABLE_FILTERS+1]
[VP9_SWITCHABLE_FILTERS];
int64_t switchable_interp_stats[SWITCHABLE_FILTERS+1]
[SWITCHABLE_FILTERS];
void init_tx_count_stats() {
vp9_zero(tx_count_32x32p_stats);
......@@ -88,8 +88,8 @@ static void update_tx_count_stats(VP9_COMMON *cm) {
static void update_switchable_interp_stats(VP9_COMMON *cm) {
int i, j;
for (i = 0; i < VP9_SWITCHABLE_FILTERS+1; ++i)
for (j = 0; j < VP9_SWITCHABLE_FILTERS; ++j) {
for (i = 0; i < SWITCHABLE_FILTERS+1; ++i)
for (j = 0; j < SWITCHABL