#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
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];
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) {
#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;
/* 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[];
}
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,
#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
#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_
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 {
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] =
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;
{
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]);
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]);
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
// 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];
}
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)
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;
#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;
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,