summaryrefslogtreecommitdiff
path: root/vp8/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'vp8/decoder')
-rw-r--r--vp8/decoder/decodemv.c28
-rw-r--r--vp8/decoder/decodframe.c53
2 files changed, 4 insertions, 77 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c
index 3cfdbac0b..072734271 100644
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -224,7 +224,6 @@ static void read_mvcontexts(vp8_reader *bc, MV_CONTEXT *mvc) {
} while (++i < 2);
}
-#if CONFIG_HIGH_PRECISION_MV
static int read_mvcomponent_hp(vp8_reader *r, const MV_CONTEXT_HP *mvc) {
const vp8_prob *const p = (const vp8_prob *) mvc;
int x = 0;
@@ -281,7 +280,6 @@ static void read_mvcontexts_hp(vp8_reader *bc, MV_CONTEXT_HP *mvc) {
} while (++p < pstop);
} while (++i < 2);
}
-#endif /* CONFIG_HIGH_PRECISION_MV */
// Read the referncence frame
static MV_REFERENCE_FRAME read_ref_frame(VP8D_COMP *pbi,
@@ -447,10 +445,8 @@ static void mb_mode_mv_init(VP8D_COMP *pbi) {
VP8_COMMON *const cm = & pbi->common;
vp8_reader *const bc = & pbi->bc;
MV_CONTEXT *const mvc = pbi->common.fc.mvc;
-#if CONFIG_HIGH_PRECISION_MV
MV_CONTEXT_HP *const mvc_hp = pbi->common.fc.mvc_hp;
MACROBLOCKD *const xd = & pbi->mb;
-#endif
vpx_memset(cm->mbskip_pred_probs, 0, sizeof(cm->mbskip_pred_probs));
if (pbi->common.mb_no_coeff_skip) {
@@ -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);
} while (++i < VP8_YMODES - 1);
}
-#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv)
read_mvcontexts_hp(bc, mvc_hp);
else
-#endif
read_mvcontexts(bc, mvc);
}
}
@@ -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_reader *const bc = & pbi->bc;
MV_CONTEXT *const mvc = pbi->common.fc.mvc;
-#if CONFIG_HIGH_PRECISION_MV
MV_CONTEXT_HP *const mvc_hp = pbi->common.fc.mvc_hp;
-#endif
const int mis = pbi->common.mode_info_stride;
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,
switch (blockmode) {
case NEW4X4:
-#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) {
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[1][mv_max_hp + (blockmv.as_mv.col)]++;
- } else
-#endif
- {
+ } else {
read_mv(bc, &blockmv.as_mv, (const MV_CONTEXT *) mvc);
cm->fc.MVcount[0][mv_max + (blockmv.as_mv.row >> 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,
blockmv.as_mv.col += best_mv.as_mv.col;
if (mbmi->second_ref_frame) {
-#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) {
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[1][mv_max_hp + (secondmv.as_mv.col)]++;
- } else
-#endif
- {
+ } else {
read_mv(bc, &secondmv.as_mv, (const MV_CONTEXT *) mvc);
cm->fc.MVcount[0][mv_max + (secondmv.as_mv.row >> 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,
break;
case NEWMV:
-#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) {
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[1][mv_max_hp + (mv->as_mv.col)]++;
- } else
-#endif
- {
+ } else {
read_mv(bc, &mv->as_mv, (const MV_CONTEXT *) mvc);
cm->fc.MVcount[0][mv_max + (mv->as_mv.row >> 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,
mb_to_top_edge,
mb_to_bottom_edge);
if (mbmi->second_ref_frame) {
-#if CONFIG_HIGH_PRECISION_MV
if (xd->allow_high_precision_mv) {
read_mv_hp(bc, &mbmi->second_mv.as_mv,
(const MV_CONTEXT_HP *) mvc_hp);
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)]++;
- } else
-#endif
- {
+ } else {
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[1][mv_max + (mbmi->second_mv.as_mv.col >> 1)]++;
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 0588d002b..4aa1df662 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -752,10 +752,8 @@ static void init_frame(VP8D_COMP *pbi) {
if (pc->frame_type == KEY_FRAME) {
/* Various keyframe initializations */
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,
sizeof(vp8_default_mv_context_hp));
-#endif
vp8_init_mbmode_probs(pc);
@@ -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) {
const vp8_prob grpupd = 192;
int i, j, k, l;
@@ -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[ALTREF_FRAME] = vp8_read_bit(bc);
-#if CONFIG_HIGH_PRECISION_MV
/* Is high precision mv allowed */
xd->allow_high_precision_mv = (unsigned char)vp8_read_bit(bc);
-#endif
// Read the type of subpel filter to use
#if CONFIG_SWITCHABLE_INTERP
if (vp8_read_bit(bc)) {
@@ -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_mbsplit_prob, pbi->common.fc.mbsplit_prob);
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);
-#endif
vp8_zero(pbi->common.fc.coef_counts);
vp8_zero(pbi->common.fc.coef_counts_8x8);
#if CONFIG_TX16X16
@@ -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.mbsplit_counts);
vp8_zero(pbi->common.fc.MVcount);
-#if CONFIG_HIGH_PRECISION_MV
vp8_zero(pbi->common.fc.MVcount_hp);
-#endif
vp8_zero(pbi->common.fc.mv_ref_ct);
vp8_zero(pbi->common.fc.mv_ref_ct_a);
#if COEFUPDATETYPE == 2
read_coef_probs2(pbi);
-#elif COEFUPDATETYPE == 3
- read_coef_probs3(pbi);
#else
read_coef_probs(pbi);
#endif