Moved prob_dualpred to common.

Moved the prob_dualpred[] sturcture to common.
Created common prediction entry for Dual flag.

Change-Id: I9ac3d128bae6114f09e5c18216d4b95cf36453d5
This commit is contained in:
Paul Wilkins 2012-02-02 14:33:34 +00:00
Родитель 58ec6fe8c3
Коммит c98e9d2882
8 изменённых файлов: 23 добавлений и 23 удалений

Просмотреть файл

@ -241,6 +241,10 @@ typedef struct VP8Common
vp8_prob mod_refprobs[MAX_REF_FRAMES][PREDICTION_PROBS];
#endif
#if CONFIG_DUALPRED
vp8_prob prob_dualpred[3];
#endif /* CONFIG_DUALPRED */
FRAME_CONTEXT lfc_a; /* last alt ref entropy */
FRAME_CONTEXT lfc; /* last frame entropy */
FRAME_CONTEXT fc; /* this frame entropy */

Просмотреть файл

@ -22,7 +22,8 @@ typedef enum
PRED_SEG_ID = 0, // Segment identifier
#if CONFIG_COMPRED
PRED_REF = 1
PRED_REF = 1,
PRED_DUAL = 2
#endif
} PRED_ID;

Просмотреть файл

@ -521,9 +521,9 @@ static void mb_mode_mv_init(VP8D_COMP *pbi)
cm->dual_pred_mode += vp8_read(bc, 128);
if (cm->dual_pred_mode == HYBRID_PREDICTION)
{
pbi->prob_dualpred[0] = (vp8_prob)vp8_read_literal(bc, 8);
pbi->prob_dualpred[1] = (vp8_prob)vp8_read_literal(bc, 8);
pbi->prob_dualpred[2] = (vp8_prob)vp8_read_literal(bc, 8);
cm->prob_dualpred[0] = (vp8_prob)vp8_read_literal(bc, 8);
cm->prob_dualpred[1] = (vp8_prob)vp8_read_literal(bc, 8);
cm->prob_dualpred[2] = (vp8_prob)vp8_read_literal(bc, 8);
}
#endif /* CONFIG_DUALPRED */
@ -842,8 +842,8 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
#if CONFIG_DUALPRED
if (pbi->common.dual_pred_mode == DUAL_PREDICTION_ONLY ||
(pbi->common.dual_pred_mode == HYBRID_PREDICTION &&
vp8_read(bc, pbi->prob_dualpred[(mi[-1].mbmi.second_ref_frame != INTRA_FRAME) +
(mi[-mis].mbmi.second_ref_frame != INTRA_FRAME)])))
vp8_read(bc, cm->prob_dualpred[(mi[-1].mbmi.second_ref_frame != INTRA_FRAME) +
(mi[-mis].mbmi.second_ref_frame != INTRA_FRAME)])))
{
mbmi->second_ref_frame = mbmi->ref_frame + 1;
if (mbmi->second_ref_frame == 4)

Просмотреть файл

@ -130,9 +130,6 @@ typedef struct VP8Decompressor
#endif
vp8_prob prob_skip_false;
#if CONFIG_DUALPRED
vp8_prob prob_dualpred[3];
#endif /* CONFIG_DUALPRED */
#if CONFIG_ERROR_CONCEALMENT
MB_OVERLAP *overlaps;

Просмотреть файл

@ -1419,9 +1419,9 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
#if CONFIG_DUALPRED
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
{
cpi->prob_dualpred[0] = (prob_dual_pred[0] + cpi->prob_dualpred[0] + 1) >> 1;
cpi->prob_dualpred[1] = (prob_dual_pred[1] + cpi->prob_dualpred[1] + 1) >> 1;
cpi->prob_dualpred[2] = (prob_dual_pred[2] + cpi->prob_dualpred[2] + 1) >> 1;
pc->prob_dualpred[0] = (prob_dual_pred[0] + pc->prob_dualpred[0] + 1) >> 1;
pc->prob_dualpred[1] = (prob_dual_pred[1] + pc->prob_dualpred[1] + 1) >> 1;
pc->prob_dualpred[2] = (prob_dual_pred[2] + pc->prob_dualpred[2] + 1) >> 1;
}
#endif /* CONFIG_DUALPRED */
}
@ -1782,9 +1782,9 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
#if CONFIG_DUALPRED
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
{
cpi->prob_dualpred[0] = (prob_dual_pred[0] + cpi->prob_dualpred[0] + 1) >> 1;
cpi->prob_dualpred[1] = (prob_dual_pred[1] + cpi->prob_dualpred[1] + 1) >> 1;
cpi->prob_dualpred[2] = (prob_dual_pred[2] + cpi->prob_dualpred[2] + 1) >> 1;
pc->prob_dualpred[0] = (prob_dual_pred[0] + pc->prob_dualpred[0] + 1) >> 1;
pc->prob_dualpred[1] = (prob_dual_pred[1] + pc->prob_dualpred[1] + 1) >> 1;
pc->prob_dualpred[2] = (prob_dual_pred[2] + pc->prob_dualpred[2] + 1) >> 1;
}
#endif /* CONFIG_DUALPRED */
}

Просмотреть файл

@ -2355,9 +2355,9 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf)
cm->prob_gf_coded = 128;
cm->prob_intra_coded = 63;
#if CONFIG_DUALPRED
cpi->prob_dualpred[0] = 128;
cpi->prob_dualpred[1] = 128;
cpi->prob_dualpred[2] = 128;
cm->prob_dualpred[0] = 128;
cm->prob_dualpred[1] = 128;
cm->prob_dualpred[2] = 128;
#endif /* CONFIG_DUALPRED */
// Prime the recent reference frame useage counters.

Просмотреть файл

@ -509,9 +509,6 @@ typedef struct VP8_COMP
int prob_skip_false;
int last_skip_false_probs[3];
int last_skip_probs_q[3];
#if CONFIG_DUALPRED
int prob_dualpred[3];
#endif /* CONFIG_DUALPRED */
int recent_ref_frame_usage[MAX_REF_FRAMES];
int count_mb_ref_frame_usage[MAX_REF_FRAMES];

Просмотреть файл

@ -2103,6 +2103,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
int *best_single_rd_diff, int *best_dual_rd_diff,
int *best_hybrid_rd_diff)
{
VP8_COMMON *cm = &cpi->common;
BLOCK *b = &x->block[0];
BLOCKD *d = &x->e_mbd.block[0];
MACROBLOCKD *xd = &x->e_mbd;
@ -2631,7 +2632,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
MB_MODE_INFO *t = &x->e_mbd.mode_info_context[-cpi->common.mode_info_stride].mbmi;
MB_MODE_INFO *l = &x->e_mbd.mode_info_context[-1].mbmi;
int cnt = (t->second_ref_frame != INTRA_FRAME) + (l->second_ref_frame != INTRA_FRAME);
dualmode_cost = vp8_cost_bit(cpi->prob_dualpred[cnt], 0);
dualmode_cost = vp8_cost_bit(cm->prob_dualpred[cnt], 0);
}
#endif /* CONFIG_DUALPRED */
@ -2791,7 +2792,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
MB_MODE_INFO *t = &x->e_mbd.mode_info_context[-cpi->common.mode_info_stride].mbmi;
MB_MODE_INFO *l = &x->e_mbd.mode_info_context[-1].mbmi;
int cnt = (t->second_ref_frame != INTRA_FRAME) + (l->second_ref_frame != INTRA_FRAME);
dualmode_cost = vp8_cost_bit(cpi->prob_dualpred[cnt], 1);
dualmode_cost = vp8_cost_bit(cm->prob_dualpred[cnt], 1);
}
}
#endif /* CONFIG_DUALPRED */