vp8_tokens_from_tree(vp8_uv_mode_encodings, vp8_uv_mode_tree);
vp8_tokens_from_tree(vp8_mbsplit_encodings, vp8_mbsplit_tree);
- vp8_tokens_from_tree(VP8_MVREFENCODINGS, vp8_mv_ref_tree);
- vp8_tokens_from_tree(VP8_SUBMVREFENCODINGS, vp8_sub_mv_ref_tree);
+ vp8_tokens_from_tree_offset(vp8_mv_ref_encoding_array,
+ vp8_mv_ref_tree, NEARESTMV);
+ vp8_tokens_from_tree_offset(vp8_sub_mv_ref_encoding_array,
+ vp8_sub_mv_ref_tree, LEFT4X4);
vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree);
}
extern struct vp8_token_struct vp8_mv_ref_encoding_array [VP8_MVREFS];
extern struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
-#define VP8_MVREFENCODINGS (vp8_mv_ref_encoding_array - NEARESTMV)
-#define VP8_SUBMVREFENCODINGS (vp8_sub_mv_ref_encoding_array - LEFT4X4)
-
-
extern const vp8_tree_index vp8_small_mvtree[];
extern struct vp8_token_struct vp8_small_mvencodings [8];
tree2tok(p, t, 0, 0, 0);
}
+void vp8_tokens_from_tree_offset(struct vp8_token_struct *p, vp8_tree t,
+ int offset)
+{
+ tree2tok(p - offset, t, 0, 0, 0);
+}
+
static void branch_counts(
int n, /* n = size of alphabet */
vp8_token tok [ /* n */ ],
/* Construct encoding array from tree. */
void vp8_tokens_from_tree(struct vp8_token_struct *, vp8_tree);
+void vp8_tokens_from_tree_offset(struct vp8_token_struct *, vp8_tree,
+ int offset);
/* Convert array of token occurrence counts into a table of probabilities
assert(NEARESTMV <= m && m <= SPLITMV);
- vp8_write_token(w, vp8_mv_ref_tree, p, VP8_MVREFENCODINGS + m);
+ vp8_write_token(w, vp8_mv_ref_tree, p,
+ vp8_mv_ref_encoding_array - NEARESTMV + m);
}
static void write_sub_mv_ref
{
assert(LEFT4X4 <= m && m <= NEW4X4);
- vp8_write_token(w, vp8_sub_mv_ref_tree, p, VP8_SUBMVREFENCODINGS + m);
+ vp8_write_token(w, vp8_sub_mv_ref_tree, p,
+ vp8_sub_mv_ref_encoding_array - LEFT4X4 + m);
}
static void write_mv
vp8_prob p [VP8_MVREFS-1];
assert(NEARESTMV <= m && m <= SPLITMV);
vp8_mv_ref_probs(p, near_mv_ref_ct);
- return vp8_cost_token(vp8_mv_ref_tree, p, VP8_MVREFENCODINGS + m);
+ return vp8_cost_token(vp8_mv_ref_tree, p,
+ vp8_mv_ref_encoding_array - NEARESTMV + m);
}
void vp8_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, MV *mv)