Commit 2af5473a authored by Deb Mukherjee's avatar Deb Mukherjee
Browse files

Merging in high_precision_mv experiment

Merged in the high_precision_mv experiment to make it easier
to work on new mv encoding strategies. Also removed
coef_update_probs3().

Change-Id: I82d3b0bb642419fe05dba82528bc9ba010e90924
parent fcbff9ee
...@@ -216,7 +216,6 @@ HAVE_LIST=" ...@@ -216,7 +216,6 @@ HAVE_LIST="
EXPERIMENT_LIST=" EXPERIMENT_LIST="
csm csm
featureupdates featureupdates
high_precision_mv
sixteenth_subpel_uv sixteenth_subpel_uv
comp_intra_pred comp_intra_pred
superblocks superblocks
......
...@@ -404,9 +404,7 @@ typedef struct MacroBlockD { ...@@ -404,9 +404,7 @@ typedef struct MacroBlockD {
vp8_subpix_fn_t subpixel_predict_avg8x4; vp8_subpix_fn_t subpixel_predict_avg8x4;
vp8_subpix_fn_t subpixel_predict_avg8x8; vp8_subpix_fn_t subpixel_predict_avg8x8;
vp8_subpix_fn_t subpixel_predict_avg16x16; vp8_subpix_fn_t subpixel_predict_avg16x16;
#if CONFIG_HIGH_PRECISION_MV
int allow_high_precision_mv; int allow_high_precision_mv;
#endif /* CONFIG_HIGH_PRECISION_MV */
void *current_bc; void *current_bc;
......
...@@ -100,7 +100,7 @@ extern DECLARE_ALIGNED(16, const int, vp8_coef_bands_16x16[256]); ...@@ -100,7 +100,7 @@ extern DECLARE_ALIGNED(16, const int, vp8_coef_bands_16x16[256]);
#define SUBEXP_PARAM 4 /* Subexponential code parameter */ #define SUBEXP_PARAM 4 /* Subexponential code parameter */
#define MODULUS_PARAM 13 /* Modulus parameter */ #define MODULUS_PARAM 13 /* Modulus parameter */
#define COEFUPDATETYPE 1 /* coef update type to use (1/2/3) */ #define COEFUPDATETYPE 1 /* coef update type to use (1/2) */
extern DECLARE_ALIGNED(16, const unsigned char, vp8_prev_token_class[MAX_ENTROPY_TOKENS]); extern DECLARE_ALIGNED(16, const unsigned char, vp8_prev_token_class[MAX_ENTROPY_TOKENS]);
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "onyxc_int.h" #include "onyxc_int.h"
#include "entropymv.h" #include "entropymv.h"
#if CONFIG_HIGH_PRECISION_MV
const MV_CONTEXT_HP vp8_mv_update_probs_hp[2] = { const MV_CONTEXT_HP vp8_mv_update_probs_hp[2] = {
{{ {{
237, 237,
...@@ -47,7 +46,6 @@ const MV_CONTEXT_HP vp8_default_mv_context_hp[2] = { ...@@ -47,7 +46,6 @@ const MV_CONTEXT_HP vp8_default_mv_context_hp[2] = {
} }
} }
}; };
#endif /* CONFIG_HIGH_PRECISION_MV */
const MV_CONTEXT vp8_mv_update_probs[2] = { const MV_CONTEXT vp8_mv_update_probs[2] = {
{{ {{
...@@ -84,7 +82,6 @@ const MV_CONTEXT vp8_default_mv_context[2] = { ...@@ -84,7 +82,6 @@ const MV_CONTEXT vp8_default_mv_context[2] = {
} }
}; };
#if CONFIG_HIGH_PRECISION_MV
const vp8_tree_index vp8_small_mvtree_hp [30] = { const vp8_tree_index vp8_small_mvtree_hp [30] = {
2, 16, 2, 16,
4, 10, 4, 10,
...@@ -103,7 +100,6 @@ const vp8_tree_index vp8_small_mvtree_hp [30] = { ...@@ -103,7 +100,6 @@ const vp8_tree_index vp8_small_mvtree_hp [30] = {
-14, -15 -14, -15
}; };
struct vp8_token_struct vp8_small_mvencodings_hp [16]; struct vp8_token_struct vp8_small_mvencodings_hp [16];
#endif /* CONFIG_HIGH_PRECISION_MV */
const vp8_tree_index vp8_small_mvtree [14] = { const vp8_tree_index vp8_small_mvtree [14] = {
2, 8, 2, 8,
...@@ -196,7 +192,6 @@ static void compute_component_probs( ...@@ -196,7 +192,6 @@ static void compute_component_probs(
} }
} }
#if CONFIG_HIGH_PRECISION_MV
static void compute_component_probs_hp( static void compute_component_probs_hp(
const unsigned int events [MVvals_hp], const unsigned int events [MVvals_hp],
vp8_prob Pnew [MVPcount_hp], vp8_prob Pnew [MVPcount_hp],
...@@ -268,13 +263,10 @@ static void compute_component_probs_hp( ...@@ -268,13 +263,10 @@ static void compute_component_probs_hp(
while (++j < mvlong_width_hp); while (++j < mvlong_width_hp);
} }
} }
#endif /* CONFIG_HIGH_PRECISION_MV */
void vp8_entropy_mv_init() { void vp8_entropy_mv_init() {
vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree); vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree);
#if CONFIG_HIGH_PRECISION_MV
vp8_tokens_from_tree(vp8_small_mvencodings_hp, vp8_small_mvtree_hp); vp8_tokens_from_tree(vp8_small_mvencodings_hp, vp8_small_mvtree_hp);
#endif
} }
// #define MV_COUNT_TESTING // #define MV_COUNT_TESTING
...@@ -293,7 +285,6 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) { ...@@ -293,7 +285,6 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) {
printf("},\n"); printf("},\n");
} }
printf("};\n"); printf("};\n");
#if CONFIG_HIGH_PRECISION_MV
printf("static const unsigned int\nMVcount_hp[2][MVvals_hp]={\n"); printf("static const unsigned int\nMVcount_hp[2][MVvals_hp]={\n");
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
printf(" { "); printf(" { ");
...@@ -304,7 +295,6 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) { ...@@ -304,7 +295,6 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) {
printf("},\n"); printf("},\n");
} }
printf("};\n"); printf("};\n");
#endif
#endif /* MV_COUNT_TESTING */ #endif /* MV_COUNT_TESTING */
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
...@@ -357,7 +347,6 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) { ...@@ -357,7 +347,6 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) {
else cm->fc.mvc[i].prob[MVPbits + t] = prob; else cm->fc.mvc[i].prob[MVPbits + t] = prob;
} }
} }
#if CONFIG_HIGH_PRECISION_MV
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
int prob; int prob;
unsigned int is_short_ct[2]; unsigned int is_short_ct[2];
...@@ -408,5 +397,4 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) { ...@@ -408,5 +397,4 @@ void vp8_adapt_mv_probs(VP8_COMMON *cm) {
else cm->fc.mvc_hp[i].prob[MVPbits_hp + t] = prob; else cm->fc.mvc_hp[i].prob[MVPbits_hp + t] = prob;
} }
} }
#endif
} }
...@@ -42,7 +42,6 @@ typedef struct mv_context { ...@@ -42,7 +42,6 @@ typedef struct mv_context {
extern const MV_CONTEXT vp8_mv_update_probs[2], vp8_default_mv_context[2]; extern const MV_CONTEXT vp8_mv_update_probs[2], vp8_default_mv_context[2];
#if CONFIG_HIGH_PRECISION_MV
enum { enum {
mv_max_hp = 2047, /* max absolute value of a MV component */ mv_max_hp = 2047, /* max absolute value of a MV component */
MVvals_hp = (2 * mv_max_hp) + 1, /* # possible values "" */ MVvals_hp = (2 * mv_max_hp) + 1, /* # possible values "" */
...@@ -69,14 +68,10 @@ typedef struct mv_context_hp { ...@@ -69,14 +68,10 @@ typedef struct mv_context_hp {
extern const MV_CONTEXT_HP vp8_mv_update_probs_hp[2], vp8_default_mv_context_hp[2]; extern const MV_CONTEXT_HP vp8_mv_update_probs_hp[2], vp8_default_mv_context_hp[2];
#endif /* CONFIG_HIGH_PRECISION_MV */
extern const vp8_tree_index vp8_small_mvtree[]; extern const vp8_tree_index vp8_small_mvtree[];
extern struct vp8_token_struct vp8_small_mvencodings [8]; extern struct vp8_token_struct vp8_small_mvencodings [8];
#if CONFIG_HIGH_PRECISION_MV
extern const vp8_tree_index vp8_small_mvtree_hp[]; extern const vp8_tree_index vp8_small_mvtree_hp[];
extern struct vp8_token_struct vp8_small_mvencodings_hp [16]; extern struct vp8_token_struct vp8_small_mvencodings_hp [16];
#endif
void vp8_entropy_mv_init(); void vp8_entropy_mv_init();
struct VP8Common; struct VP8Common;
......
...@@ -133,7 +133,6 @@ void vp8_find_near_mvs ...@@ -133,7 +133,6 @@ void vp8_find_near_mvs
/* Make sure that the 1/8th bits of the Mvs are zero if high_precision /* Make sure that the 1/8th bits of the Mvs are zero if high_precision
* is not being used, by truncating the last bit towards 0 * is not being used, by truncating the last bit towards 0
*/ */
#if CONFIG_HIGH_PRECISION_MV
if (!xd->allow_high_precision_mv) { if (!xd->allow_high_precision_mv) {
if (best_mv->as_mv.row & 1) if (best_mv->as_mv.row & 1)
best_mv->as_mv.row += (best_mv->as_mv.row > 0 ? -1 : 1); best_mv->as_mv.row += (best_mv->as_mv.row > 0 ? -1 : 1);
...@@ -148,7 +147,6 @@ void vp8_find_near_mvs ...@@ -148,7 +147,6 @@ void vp8_find_near_mvs
if (nearby->as_mv.col & 1) if (nearby->as_mv.col & 1)
nearby->as_mv.col += (nearby->as_mv.col > 0 ? -1 : 1); nearby->as_mv.col += (nearby->as_mv.col > 0 ? -1 : 1);
} }
#endif
// TODO: move clamp outside findnearmv // TODO: move clamp outside findnearmv
vp8_clamp_mv2(nearest, xd); vp8_clamp_mv2(nearest, xd);
......
...@@ -56,13 +56,9 @@ typedef struct frame_contexts { ...@@ -56,13 +56,9 @@ typedef struct frame_contexts {
vp8_prob coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; vp8_prob coef_probs_16x16 [BLOCK_TYPES_16X16] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
#endif #endif
MV_CONTEXT mvc[2]; MV_CONTEXT mvc[2];
#if CONFIG_HIGH_PRECISION_MV
MV_CONTEXT_HP mvc_hp[2]; MV_CONTEXT_HP mvc_hp[2];
#endif
MV_CONTEXT pre_mvc[2]; MV_CONTEXT pre_mvc[2];
#if CONFIG_HIGH_PRECISION_MV
MV_CONTEXT_HP pre_mvc_hp[2]; MV_CONTEXT_HP pre_mvc_hp[2];
#endif
vp8_prob pre_bmode_prob [VP8_BINTRAMODES - 1]; vp8_prob pre_bmode_prob [VP8_BINTRAMODES - 1];
vp8_prob pre_ymode_prob [VP8_YMODES - 1]; /* interframe intra mode probs */ vp8_prob pre_ymode_prob [VP8_YMODES - 1]; /* interframe intra mode probs */
vp8_prob pre_uv_mode_prob [VP8_YMODES][VP8_UV_MODES - 1]; vp8_prob pre_uv_mode_prob [VP8_YMODES][VP8_UV_MODES - 1];
...@@ -93,9 +89,7 @@ typedef struct frame_contexts { ...@@ -93,9 +89,7 @@ typedef struct frame_contexts {
[PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS];
#endif #endif
unsigned int MVcount [2] [MVvals]; unsigned int MVcount [2] [MVvals];
#if CONFIG_HIGH_PRECISION_MV
unsigned int MVcount_hp [2] [MVvals_hp]; unsigned int MVcount_hp [2] [MVvals_hp];
#endif
#if CONFIG_SWITCHABLE_INTERP #if CONFIG_SWITCHABLE_INTERP
vp8_prob switchable_interp_prob[VP8_SWITCHABLE_FILTERS+1] vp8_prob switchable_interp_prob[VP8_SWITCHABLE_FILTERS+1]
[VP8_SWITCHABLE_FILTERS-1]; [VP8_SWITCHABLE_FILTERS-1];
......
...@@ -224,7 +224,6 @@ static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc) { ...@@ -224,7 +224,6 @@ static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc) {
} while (++i < 2); } while (++i < 2);
} }
#if CONFIG_HIGH_PRECISION_MV
static int read_mvcomponent_hp(vp8_reader *r, const MV_CONTEXT_HP *mvc) { static int read_mvcomponent_hp(vp8_reader *r, const MV_CONTEXT_HP *mvc) {
const vp8_prob *const p = (const vp8_prob *) mvc; const vp8_prob *const p = (const vp8_prob *) mvc;
int x = 0; int x = 0;
...@@ -281,7 +280,6 @@ static void read_mvcontexts_hp(vp8_reader *bc, MV_CONTEXT_HP *mvc) { ...@@ -281,7 +280,6 @@ static void read_mvcontexts_hp(vp8_reader *bc, MV_CONTEXT_HP *mvc) {
} while (++p < pstop); } while (++p < pstop);
} while (++i < 2); } while (++i < 2);
} }
#endif /* CONFIG_HIGH_PRECISION_MV */
// Read the referncence frame // Read the referncence frame
static MV_REFERENCE_FRAME read_ref_frame(VP8D_COMP *pbi, static MV_REFERENCE_FRAME read_ref_frame(VP8D_COMP *pbi,
...@@ -447,10 +445,8 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) { ...@@ -447,10 +445,8 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) {
VP8_COMMON *const cm = & pbi->common; VP8_COMMON *const cm = & pbi->common;
vp8_reader *const bc = & pbi->bc; vp8_reader *const bc = & pbi->bc;
MV_CONTEXT *const mvc = pbi->common.fc.mvc; MV_CONTEXT *const mvc = pbi->common.fc.mvc;
#if CONFIG_HIGH_PRECISION_MV
MV_CONTEXT_HP *const mvc_hp = pbi->common.fc.mvc_hp; MV_CONTEXT_HP *const mvc_hp = pbi->common.fc.mvc_hp;
MACROBLOCKD *const xd = & pbi->mb; MACROBLOCKD *const xd = & pbi->mb;
#endif
vpx_memset(cm->mbskip_pred_probs, 0, sizeof(cm->mbskip_pred_probs)); vpx_memset(cm->mbskip_pred_probs, 0, sizeof(cm->mbskip_pred_probs));
if (pbi->common.mb_no_coeff_skip) { if (pbi->common.mb_no_coeff_skip) {
...@@ -495,11 +491,9 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) { ...@@ -495,11 +491,9 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) {
cm->fc.ymode_prob[i] = (vp8_prob) vp8_read_literal(bc, 8); cm->fc.ymode_prob[i] = (vp8_prob) vp8_read_literal(bc, 8);
} while (++i < VP8_YMODES - 1); } while (++i < VP8_YMODES - 1);
} }
#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) if (xd->allow_high_precision_mv)
read_mvcontexts_hp(bc, mvc_hp); read_mvcontexts_hp(bc, mvc_hp);
else else
#endif
read_mvcontexts(bc, mvc); read_mvcontexts(bc, mvc);
} }
} }
...@@ -563,9 +557,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -563,9 +557,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
VP8_COMMON *const cm = & pbi->common; VP8_COMMON *const cm = & pbi->common;
vp8_reader *const bc = & pbi->bc; vp8_reader *const bc = & pbi->bc;
MV_CONTEXT *const mvc = pbi->common.fc.mvc; MV_CONTEXT *const mvc = pbi->common.fc.mvc;
#if CONFIG_HIGH_PRECISION_MV
MV_CONTEXT_HP *const mvc_hp = pbi->common.fc.mvc_hp; MV_CONTEXT_HP *const mvc_hp = pbi->common.fc.mvc_hp;
#endif
const int mis = pbi->common.mode_info_stride; const int mis = pbi->common.mode_info_stride;
MACROBLOCKD *const xd = & pbi->mb; MACROBLOCKD *const xd = & pbi->mb;
...@@ -719,14 +711,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -719,14 +711,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
switch (blockmode) { switch (blockmode) {
case NEW4X4: case NEW4X4:
#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) { if (xd->allow_high_precision_mv) {
read_mv_hp(bc, &blockmv.as_mv, (const MV_CONTEXT_HP *) mvc_hp); read_mv_hp(bc, &blockmv.as_mv, (const MV_CONTEXT_HP *) mvc_hp);
cm->fc.MVcount_hp[0][mv_max_hp + (blockmv.as_mv.row)]++; cm->fc.MVcount_hp[0][mv_max_hp + (blockmv.as_mv.row)]++;
cm->fc.MVcount_hp[1][mv_max_hp + (blockmv.as_mv.col)]++; cm->fc.MVcount_hp[1][mv_max_hp + (blockmv.as_mv.col)]++;
} else } else {
#endif
{
read_mv(bc, &blockmv.as_mv, (const MV_CONTEXT *) mvc); read_mv(bc, &blockmv.as_mv, (const MV_CONTEXT *) mvc);
cm->fc.MVcount[0][mv_max + (blockmv.as_mv.row >> 1)]++; cm->fc.MVcount[0][mv_max + (blockmv.as_mv.row >> 1)]++;
cm->fc.MVcount[1][mv_max + (blockmv.as_mv.col >> 1)]++; cm->fc.MVcount[1][mv_max + (blockmv.as_mv.col >> 1)]++;
...@@ -735,14 +724,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -735,14 +724,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
blockmv.as_mv.col += best_mv.as_mv.col; blockmv.as_mv.col += best_mv.as_mv.col;
if (mbmi->second_ref_frame) { if (mbmi->second_ref_frame) {
#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) { if (xd->allow_high_precision_mv) {
read_mv_hp(bc, &secondmv.as_mv, (const MV_CONTEXT_HP *) mvc_hp); read_mv_hp(bc, &secondmv.as_mv, (const MV_CONTEXT_HP *) mvc_hp);
cm->fc.MVcount_hp[0][mv_max_hp + (secondmv.as_mv.row)]++; cm->fc.MVcount_hp[0][mv_max_hp + (secondmv.as_mv.row)]++;
cm->fc.MVcount_hp[1][mv_max_hp + (secondmv.as_mv.col)]++; cm->fc.MVcount_hp[1][mv_max_hp + (secondmv.as_mv.col)]++;
} else } else {
#endif
{
read_mv(bc, &secondmv.as_mv, (const MV_CONTEXT *) mvc); read_mv(bc, &secondmv.as_mv, (const MV_CONTEXT *) mvc);
cm->fc.MVcount[0][mv_max + (secondmv.as_mv.row >> 1)]++; cm->fc.MVcount[0][mv_max + (secondmv.as_mv.row >> 1)]++;
cm->fc.MVcount[1][mv_max + (secondmv.as_mv.col >> 1)]++; cm->fc.MVcount[1][mv_max + (secondmv.as_mv.col >> 1)]++;
...@@ -851,14 +837,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -851,14 +837,11 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
break; break;
case NEWMV: case NEWMV:
#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) { if (xd->allow_high_precision_mv) {
read_mv_hp(bc, &mv->as_mv, (const MV_CONTEXT_HP *) mvc_hp); read_mv_hp(bc, &mv->as_mv, (const MV_CONTEXT_HP *) mvc_hp);
cm->fc.MVcount_hp[0][mv_max_hp + (mv->as_mv.row)]++; cm->fc.MVcount_hp[0][mv_max_hp + (mv->as_mv.row)]++;
cm->fc.MVcount_hp[1][mv_max_hp + (mv->as_mv.col)]++; cm->fc.MVcount_hp[1][mv_max_hp + (mv->as_mv.col)]++;
} else } else {
#endif
{
read_mv(bc, &mv->as_mv, (const MV_CONTEXT *) mvc); read_mv(bc, &mv->as_mv, (const MV_CONTEXT *) mvc);
cm->fc.MVcount[0][mv_max + (mv->as_mv.row >> 1)]++; cm->fc.MVcount[0][mv_max + (mv->as_mv.row >> 1)]++;
cm->fc.MVcount[1][mv_max + (mv->as_mv.col >> 1)]++; cm->fc.MVcount[1][mv_max + (mv->as_mv.col >> 1)]++;
...@@ -877,15 +860,12 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi, ...@@ -877,15 +860,12 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
mb_to_top_edge, mb_to_top_edge,
mb_to_bottom_edge); mb_to_bottom_edge);
if (mbmi->second_ref_frame) { if (mbmi->second_ref_frame) {
#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) { if (xd->allow_high_precision_mv) {
read_mv_hp(bc, &mbmi->second_mv.as_mv, read_mv_hp(bc, &mbmi->second_mv.as_mv,
(const MV_CONTEXT_HP *) mvc_hp); (const MV_CONTEXT_HP *) mvc_hp);
cm->fc.MVcount_hp[0][mv_max_hp + (mbmi->second_mv.as_mv.row)]++; cm->fc.MVcount_hp[0][mv_max_hp + (mbmi->second_mv.as_mv.row)]++;
cm->fc.MVcount_hp[1][mv_max_hp + (mbmi->second_mv.as_mv.col)]++; cm->fc.MVcount_hp[1][mv_max_hp + (mbmi->second_mv.as_mv.col)]++;
} else } else {
#endif
{
read_mv(bc, &mbmi->second_mv.as_mv, (const MV_CONTEXT *) mvc); read_mv(bc, &mbmi->second_mv.as_mv, (const MV_CONTEXT *) mvc);
cm->fc.MVcount[0][mv_max + (mbmi->second_mv.as_mv.row >> 1)]++; cm->fc.MVcount[0][mv_max + (mbmi->second_mv.as_mv.row >> 1)]++;
cm->fc.MVcount[1][mv_max + (mbmi->second_mv.as_mv.col >> 1)]++; cm->fc.MVcount[1][mv_max + (mbmi->second_mv.as_mv.col >> 1)]++;
......
...@@ -752,10 +752,8 @@ static void init_frame(VP8D_COMP *pbi) { ...@@ -752,10 +752,8 @@ static void init_frame(VP8D_COMP *pbi) {
if (pc->frame_type == KEY_FRAME) { if (pc->frame_type == KEY_FRAME) {
/* Various keyframe initializations */ /* Various keyframe initializations */
vpx_memcpy(pc->fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context)); vpx_memcpy(pc->fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context));
#if CONFIG_HIGH_PRECISION_MV
vpx_memcpy(pc->fc.mvc_hp, vp8_default_mv_context_hp, vpx_memcpy(pc->fc.mvc_hp, vp8_default_mv_context_hp,
sizeof(vp8_default_mv_context_hp)); sizeof(vp8_default_mv_context_hp));
#endif
vp8_init_mbmode_probs(pc); vp8_init_mbmode_probs(pc);
...@@ -815,49 +813,6 @@ static void init_frame(VP8D_COMP *pbi) { ...@@ -815,49 +813,6 @@ static void init_frame(VP8D_COMP *pbi) {
} }
static void read_coef_probs3(VP8D_COMP *pbi) {
const vp8_prob grpupd = 216;
int i, j, k, l;
vp8_reader *const bc = & pbi->bc;
VP8_COMMON *const pc = & pbi->common;
for (i = 0; i < BLOCK_TYPES; i++)
for (l = 0; l < ENTROPY_NODES; l++) {
if (vp8_read(bc, grpupd)) {
// printf("Decoding %d\n", l);
for (j = !i; j < COEF_BANDS; j++)
for (k = 0; k < PREV_COEF_CONTEXTS; k++) {
if (k >= 3 && ((i == 0 && j == 1) ||
(i > 0 && j == 0)))
continue;
{
vp8_prob *const p = pc->fc.coef_probs [i][j][k] + l;
int u = vp8_read(bc, COEF_UPDATE_PROB);
if (u) *p = read_prob_diff_update(bc, *p);
}
}
}
}
if (pbi->common.txfm_mode == ALLOW_8X8) {
for (i = 0; i < BLOCK_TYPES_8X8; i++)
for (l = 0; l < ENTROPY_NODES; l++) {
if (vp8_read(bc, grpupd)) {
for (j = !i; j < COEF_BANDS; j++)
for (k = 0; k < PREV_COEF_CONTEXTS; k++) {
if (k >= 3 && ((i == 0 && j == 1) ||
(i > 0 && j == 0)))
continue;
{
vp8_prob *const p = pc->fc.coef_probs_8x8 [i][j][k] + l;
int u = vp8_read(bc, COEF_UPDATE_PROB_8X8);
if (u) *p = read_prob_diff_update(bc, *p);
}
}
}
}
}
}
static void read_coef_probs2(VP8D_COMP *pbi) { static void read_coef_probs2(VP8D_COMP *pbi) {
const vp8_prob grpupd = 192; const vp8_prob grpupd = 192;
int i, j, k, l; int i, j, k, l;
...@@ -1288,10 +1243,8 @@ int vp8_decode_frame(VP8D_COMP *pbi) { ...@@ -1288,10 +1243,8 @@ int vp8_decode_frame(VP8D_COMP *pbi) {
pc->ref_frame_sign_bias[GOLDEN_FRAME] = vp8_read_bit(bc); pc->ref_frame_sign_bias[GOLDEN_FRAME] = vp8_read_bit(bc);
pc->ref_frame_sign_bias[ALTREF_FRAME] = vp8_read_bit(bc); pc->ref_frame_sign_bias[ALTREF_FRAME] = vp8_read_bit(bc);
#if CONFIG_HIGH_PRECISION_MV
/* Is high precision mv allowed */ /* Is high precision mv allowed */
xd->allow_high_precision_mv = (unsigned char)vp8_read_bit(bc); xd->allow_high_precision_mv = (unsigned char)vp8_read_bit(bc);
#endif
// Read the type of subpel filter to use // Read the type of subpel filter to use
#if CONFIG_SWITCHABLE_INTERP #if CONFIG_SWITCHABLE_INTERP
if (vp8_read_bit(bc)) { if (vp8_read_bit(bc)) {
...@@ -1336,9 +1289,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) { ...@@ -1336,9 +1289,7 @@ int vp8_decode_frame(VP8D_COMP *pbi) {
vp8_copy(pbi->common.fc.pre_sub_mv_ref_prob, pbi->common.fc.sub_mv_ref_prob); vp8_copy(pbi->common.fc.pre_sub_mv_ref_prob, pbi->common.fc.sub_mv_ref_prob);
vp8_copy(pbi->common.fc.pre_mbsplit_prob, pbi->common.fc.mbsplit_prob); vp8_copy(pbi->common.fc.pre_mbsplit_prob, pbi->common.fc.mbsplit_prob);
vp8_copy(pbi->common.fc.pre_mvc, pbi->common.fc.mvc); vp8_copy(pbi->common.fc.pre_mvc, pbi->common.fc.mvc);
#if CONFIG_HIGH_PRECISION_MV
vp8_copy(pbi->common.fc.pre_mvc_hp, pbi->common.fc.mvc_hp); vp8_copy(pbi->common.fc.pre_mvc_hp, pbi->common.fc.mvc_hp);
#endif
vp8_zero(pbi->common.fc.coef_counts); vp8_zero(pbi->common.fc.coef_counts);
vp8_zero(pbi->common.fc.coef_counts_8x8); vp8_zero(pbi->common.fc.coef_counts_8x8);
#if CONFIG_TX16X16 #if CONFIG_TX16X16
...@@ -1351,15 +1302,11 @@ int vp8_decode_frame(VP8D_COMP *pbi) { ...@@ -1351,15 +1302,11 @@ int vp8_decode_frame(VP8D_COMP *pbi) {
vp8_zero(pbi->common.fc.sub_mv_ref_counts); vp8_zero(pbi->common.fc.sub_mv_ref_counts);
vp8_zero(pbi->common.fc.mbsplit_counts); vp8_zero(pbi->common.fc.mbsplit_counts);
vp8_zero(pbi->common.fc.MVcount); vp8_zero(pbi->common.fc.MVcount);
#if CONFIG_HIGH_PRECISION_MV
vp8_zero(pbi->common.fc.MVcount_hp); vp8_zero(pbi->common.fc.MVcount_hp);
#endif
vp8_zero(pbi->common.fc.mv_ref_ct); vp8_zero(pbi->common.fc.mv_ref_ct);
vp8_zero(pbi->common.fc.mv_ref_ct_a); vp8_zero(pbi->common.fc.mv_ref_ct_a);
#if COEFUPDATETYPE == 2 #if COEFUPDATETYPE == 2
read_coef_probs2(pbi); read_coef_probs2(pbi);
#elif COEFUPDATETYPE == 3
read_coef_probs3(pbi);
#else #else
read_coef_probs(pbi); read_coef_probs(pbi);
#endif #endif
......
...@@ -556,7 +556,6 @@ static void write_mv ...@@ -556,7 +556,6 @@ static void write_mv
vp8_encode_motion_vector(w, &e, mvc); vp8_encode_motion_vector(w, &e, mvc);
} }
#if CONFIG_HIGH_PRECISION_MV
static void write_mv_hp static void write_mv_hp
( (
vp8_writer *w, const MV *mv, const int_mv *ref, const MV_CONTEXT_HP *mvc vp8_writer *w, const MV *mv, const int_mv *ref, const MV_CONTEXT_HP *mvc
...@@ -567,7 +566,6 @@ static void write_mv_hp ...@@ -567,7 +566,6 @@ static void write_mv_hp
vp8_encode_motion_vector_hp(w, &e, mvc); vp8_encode_motion_vector_hp(w, &e, mvc);
} }
#endif
// This function writes the current macro block's segnment id to the bitstream // This function writes the current macro block's segnment id to the bitstream
// It should only be called if a segment map update is indicated.