Commit 30226a65 authored by Deb Mukherjee's avatar Deb Mukherjee

Cosmetic renaming VP9_MVREFS to VP9_INTER_MODES

NO bitstream change

Change-Id: I79f6146dac5fdd157051b6f8dc611c0b7b5e5f7f
parent 83885235
......@@ -115,7 +115,7 @@ typedef enum {
#define VP9_INTRA_MODES (TM_PRED + 1)
#define VP9_MVREFS (1 + NEWMV - NEARESTMV)
#define VP9_INTER_MODES (1 + NEWMV - NEARESTMV)
#define WHT_UPSCALE_FACTOR 2
......
......@@ -96,7 +96,7 @@ const vp9_tree_index vp9_partition_tree[6] = {
struct vp9_token vp9_intra_mode_encodings[VP9_INTRA_MODES];
struct vp9_token vp9_sb_mv_ref_encoding_array[VP9_MVREFS];
struct vp9_token vp9_sb_mv_ref_encoding_array[VP9_INTER_MODES];
struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
......@@ -178,7 +178,7 @@ void vp9_init_mode_contexts(VP9_COMMON *pc) {
void vp9_accum_mv_refs(VP9_COMMON *pc,
MB_PREDICTION_MODE m,
const int context) {
unsigned int (*inter_mode_counts)[VP9_MVREFS - 1][2] =
unsigned int (*inter_mode_counts)[VP9_INTER_MODES - 1][2] =
pc->fc.inter_mode_counts;
if (m == ZEROMV) {
......@@ -202,12 +202,12 @@ void vp9_accum_mv_refs(VP9_COMMON *pc,
#define MVREF_MAX_UPDATE_FACTOR 128
void vp9_adapt_mode_context(VP9_COMMON *pc) {
int i, j;
unsigned int (*inter_mode_counts)[VP9_MVREFS - 1][2] =
unsigned int (*inter_mode_counts)[VP9_INTER_MODES - 1][2] =
pc->fc.inter_mode_counts;
vp9_prob (*mode_context)[VP9_MVREFS - 1] = pc->fc.inter_mode_probs;
vp9_prob (*mode_context)[VP9_INTER_MODES - 1] = pc->fc.inter_mode_probs;
for (j = 0; j < INTER_MODE_CONTEXTS; j++) {
for (i = 0; i < VP9_MVREFS - 1; i++) {
for (i = 0; i < VP9_INTER_MODES - 1; i++) {
int count = inter_mode_counts[j][i][0] + inter_mode_counts[j][i][1];
int factor;
count = count > MVREF_COUNT_SAT ? MVREF_COUNT_SAT : count;
......
......@@ -30,7 +30,7 @@ extern struct vp9_token vp9_intra_mode_encodings[VP9_INTRA_MODES];
/* Inter mode values do not start at zero */
extern struct vp9_token vp9_sb_mv_ref_encoding_array[VP9_MVREFS];
extern struct vp9_token vp9_sb_mv_ref_encoding_array[VP9_INTER_MODES];
// probability models for partition information
extern const vp9_tree_index vp9_partition_tree[];
......
......@@ -71,7 +71,7 @@ static int check_mv_bounds(int_mv *mv,
}
vp9_prob *vp9_mv_ref_probs(VP9_COMMON *pc,
vp9_prob p[VP9_MVREFS - 1],
vp9_prob p[VP9_INTER_MODES - 1],
const int context);
void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *pc,
......
......@@ -12,7 +12,7 @@
#include "vp9/common/vp9_entropy.h"
const vp9_prob vp9_default_inter_mode_probs[INTER_MODE_CONTEXTS]
[VP9_MVREFS - 1] = {
[VP9_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
......
......@@ -14,6 +14,6 @@
#include "vp9/common/vp9_entropy.h"
extern const int vp9_default_inter_mode_probs[INTER_MODE_CONTEXTS]
[VP9_MVREFS - 1];
[VP9_INTER_MODES - 1];
#endif // VP9_COMMON_VP9_MODECONT_H_
......@@ -76,9 +76,9 @@ typedef struct frame_contexts {
unsigned int switchable_interp_count[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][VP9_MVREFS - 1];
vp9_prob pre_inter_mode_probs[INTER_MODE_CONTEXTS][VP9_MVREFS - 1];
unsigned int inter_mode_counts[INTER_MODE_CONTEXTS][VP9_MVREFS - 1][2];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1];
vp9_prob pre_inter_mode_probs[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1];
unsigned int inter_mode_counts[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1][2];
} FRAME_CONTEXT;
typedef enum {
......
......@@ -360,7 +360,7 @@ static void read_switchable_interp_probs(VP9_COMMON* const cm, vp9_reader *r) {
static void read_inter_mode_probs(VP9_COMMON *const cm, vp9_reader *r) {
int i, j;
for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
for (j = 0; j < VP9_MVREFS - 1; ++j) {
for (j = 0; j < VP9_INTER_MODES - 1; ++j) {
if (vp9_read(r, VP9_DEF_UPDATE_PROB)) {
// cm->fc.inter_mode_probs[i][j] = vp9_read_prob(r);
cm->fc.inter_mode_probs[i][j] =
......@@ -567,7 +567,7 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
if (mbmi->ref_frame) {
int_mv nearest, nearby, best_mv;
int_mv nearest_second, nearby_second, best_mv_second;
vp9_prob mv_ref_p[VP9_MVREFS - 1];
vp9_prob mv_ref_p[VP9_INTER_MODES - 1];
const MV_REFERENCE_FRAME ref_frame = mbmi->ref_frame;
{
......
......@@ -427,7 +427,7 @@ static void update_inter_mode_probs(VP9_COMMON *pc, vp9_writer* const bc) {
int i, j;
for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
for (j = 0; j < VP9_MVREFS - 1; j++) {
for (j = 0; j < VP9_INTER_MODES - 1; j++) {
vp9_cond_prob_diff_update(bc, &pc->fc.inter_mode_probs[i][j],
VP9_DEF_UPDATE_PROB,
pc->fc.inter_mode_counts[i][j]);
......@@ -708,7 +708,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
write_intra_mode(bc, mi->uv_mode,
pc->fc.uv_mode_prob[mode]);
} else {
vp9_prob mv_ref_p[VP9_MVREFS - 1];
vp9_prob mv_ref_p[VP9_INTER_MODES - 1];
vp9_mv_ref_probs(&cpi->common, mv_ref_p, mi->mb_mode_context[rf]);
......
......@@ -466,9 +466,9 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
void vp9_update_mode_context_stats(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
int i, j;
unsigned int (*inter_mode_counts)[VP9_MVREFS - 1][2] =
unsigned int (*inter_mode_counts)[VP9_INTER_MODES - 1][2] =
cm->fc.inter_mode_counts;
int64_t (*mv_ref_stats)[VP9_MVREFS - 1][2] = cpi->mv_ref_stats;
int64_t (*mv_ref_stats)[VP9_INTER_MODES - 1][2] = cpi->mv_ref_stats;
FILE *f;
// Read the past stats counters
......@@ -482,7 +482,7 @@ void vp9_update_mode_context_stats(VP9_COMP *cpi) {
// Add in the values for this frame
for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
for (j = 0; j < VP9_MVREFS - 1; j++) {
for (j = 0; j < VP9_INTER_MODES - 1; j++) {
mv_ref_stats[i][j][0] += (int64_t)inter_mode_counts[i][j][0];
mv_ref_stats[i][j][1] += (int64_t)inter_mode_counts[i][j][1];
}
......@@ -499,13 +499,14 @@ void print_mode_context(VP9_COMP *cpi) {
int i, j;
fprintf(f, "#include \"vp9_entropy.h\"\n");
fprintf(f,
"const int inter_mode_probs[INTER_MODE_CONTEXTS][VP9_MVREFS - 1] =");
fprintf(
f,
"const int inter_mode_probs[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1] =");
fprintf(f, "{\n");
for (j = 0; j < INTER_MODE_CONTEXTS; j++) {
fprintf(f, " {/* %d */ ", j);
fprintf(f, " ");
for (i = 0; i < VP9_MVREFS - 1; i++) {
for (i = 0; i < VP9_INTER_MODES - 1; i++) {
int this_prob;
int64_t count = cpi->mv_ref_stats[j][i][0] + cpi->mv_ref_stats[j][i][1];
if (count)
......
......@@ -85,8 +85,8 @@ typedef struct {
vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
[VP9_SWITCHABLE_FILTERS - 1];
int inter_mode_counts[INTER_MODE_CONTEXTS][VP9_MVREFS - 1][2];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][VP9_MVREFS - 1];
int inter_mode_counts[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1][2];
vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1];
} CODING_CONTEXT;
......@@ -597,7 +597,7 @@ typedef struct VP9_COMP {
#endif
#ifdef ENTROPY_STATS
int64_t mv_ref_stats[INTER_MODE_CONTEXTS][VP9_MVREFS - 1][2];
int64_t mv_ref_stats[INTER_MODE_CONTEXTS][VP9_INTER_MODES - 1][2];
#endif
} VP9_COMP;
......
......@@ -946,7 +946,7 @@ int vp9_cost_mv_ref(VP9_COMP *cpi,
if (!vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP)) {
VP9_COMMON *pc = &cpi->common;
vp9_prob p [VP9_MVREFS - 1];
vp9_prob p[VP9_INTER_MODES - 1];
assert(NEARESTMV <= m && m <= NEWMV);
vp9_mv_ref_probs(pc, p, mode_context);
return cost_token(vp9_sb_mv_ref_tree, p,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment