Rename "dual" prediction to "compound" prediction.

Change-Id: Ibcd2b9b247ff9f83331dac47f91ec285e8955ff1
This commit is contained in:
Ronald S. Bultje 2012-02-28 17:25:45 -08:00
parent d476165107
commit 921b1c3c94
11 changed files with 175 additions and 179 deletions

View File

@ -213,7 +213,7 @@ void vp8_create_common(VP8_COMMON *oci)
oci->txfm_mode = ONLY_4X4;
#endif
oci->mb_no_coeff_skip = 1;
oci->dual_pred_mode = HYBRID_PREDICTION;
oci->comp_pred_mode = HYBRID_PREDICTION;
oci->no_lpf = 0;
oci->filter_type = NORMAL_LOOPFILTER;
oci->use_bilinear_mc_filter = 0;

View File

@ -40,7 +40,7 @@ void vp8_initialize_common(void);
#define NUM_YV12_BUFFERS 4
#define DUAL_PRED_CONTEXTS 2
#define COMP_PRED_CONTEXTS 2
typedef struct frame_contexts
{
@ -79,10 +79,10 @@ typedef enum
typedef enum
{
SINGLE_PREDICTION_ONLY = 0,
DUAL_PREDICTION_ONLY = 1,
COMP_PREDICTION_ONLY = 1,
HYBRID_PREDICTION = 2,
NB_PREDICTION_TYPES = 3,
} DUALPREDMODE_TYPE;
} COMPPREDMODE_TYPE;
#if CONFIG_T8X8
/* TODO: allows larger transform */
@ -153,7 +153,7 @@ typedef struct VP8Common
#if CONFIG_T8X8
TXFM_MODE txfm_mode;
#endif
DUALPREDMODE_TYPE dual_pred_mode;
COMPPREDMODE_TYPE comp_pred_mode;
int no_lpf;
int use_bilinear_mc_filter;
int full_pixel;
@ -237,7 +237,7 @@ typedef struct VP8Common
vp8_prob ref_pred_probs[PREDICTION_PROBS];
vp8_prob mod_refprobs[MAX_REF_FRAMES][PREDICTION_PROBS];
vp8_prob prob_dualpred[DUAL_PRED_CONTEXTS];
vp8_prob prob_comppred[COMP_PRED_CONTEXTS];
FRAME_CONTEXT lfc_a; /* last alt ref entropy */
FRAME_CONTEXT lfc; /* last frame entropy */

View File

@ -37,8 +37,8 @@ unsigned char get_pred_context( VP8_COMMON *const cm,
(m - cm->mode_info_stride)->mbmi.ref_predicted;
break;
case PRED_DUAL:
// Context based on use of dual pred flag by neighbours
case PRED_COMP:
// Context based on use of comp pred flag by neighbours
//pred_context =
// ((m - 1)->mbmi.second_ref_frame != INTRA_FRAME) +
// ((m - cm->mode_info_stride)->mbmi.second_ref_frame != INTRA_FRAME);
@ -89,11 +89,11 @@ vp8_prob get_pred_prob( VP8_COMMON *const cm,
pred_probability = cm->ref_pred_probs[pred_context];
break;
case PRED_DUAL:
case PRED_COMP:
// In keeping with convention elsewhre the probability returned is
// the probability of a "0" outcome which in this case means the
// probability of dual pred off.
pred_probability = cm->prob_dualpred[pred_context];
// probability of comp pred off.
pred_probability = cm->prob_comppred[pred_context];
break;
default:

View File

@ -21,7 +21,7 @@ typedef enum
{
PRED_SEG_ID = 0, // Segment identifier
PRED_REF = 1,
PRED_DUAL = 2
PRED_COMP = 2
} PRED_ID;

View File

@ -526,14 +526,14 @@ static void mb_mode_mv_init(VP8D_COMP *pbi)
// frame prediction fails.
compute_mod_refprobs( cm );
pbi->common.dual_pred_mode = vp8_read(bc, 128);
if (cm->dual_pred_mode)
cm->dual_pred_mode += vp8_read(bc, 128);
if (cm->dual_pred_mode == HYBRID_PREDICTION)
pbi->common.comp_pred_mode = vp8_read(bc, 128);
if (cm->comp_pred_mode)
cm->comp_pred_mode += vp8_read(bc, 128);
if (cm->comp_pred_mode == HYBRID_PREDICTION)
{
int i;
for ( i = 0; i < DUAL_PRED_CONTEXTS; i++ )
cm->prob_dualpred[i] = (vp8_prob)vp8_read_literal(bc, 8);
for ( i = 0; i < COMP_PRED_CONTEXTS; i++ )
cm->prob_comppred[i] = (vp8_prob)vp8_read_literal(bc, 8);
}
if (vp8_read_bit(bc))
@ -856,9 +856,9 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
propagate_mv: /* same MV throughout */
if ( cm->dual_pred_mode == DUAL_PREDICTION_ONLY ||
(cm->dual_pred_mode == HYBRID_PREDICTION &&
vp8_read(bc, get_pred_prob( cm, xd, PRED_DUAL ))) )
if ( cm->comp_pred_mode == COMP_PREDICTION_ONLY ||
(cm->comp_pred_mode == HYBRID_PREDICTION &&
vp8_read(bc, get_pred_prob( cm, xd, PRED_COMP ))) )
{
mbmi->second_ref_frame = mbmi->ref_frame + 1;
if (mbmi->second_ref_frame == 4)

View File

@ -627,31 +627,31 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
vp8_write_literal(w, pc->prob_last_coded, 8);
vp8_write_literal(w, pc->prob_gf_coded, 8);
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
vp8_write(w, 1, 128);
vp8_write(w, 1, 128);
for (i = 0; i < DUAL_PRED_CONTEXTS; i++)
for (i = 0; i < COMP_PRED_CONTEXTS; i++)
{
if (cpi->single_pred_count[i] + cpi->dual_pred_count[i])
if (cpi->single_pred_count[i] + cpi->comp_pred_count[i])
{
pc->prob_dualpred[i] = cpi->single_pred_count[i] * 255 /
(cpi->single_pred_count[i] + cpi->dual_pred_count[i]);
if (pc->prob_dualpred[i] < 1)
pc->prob_dualpred[i] = 1;
pc->prob_comppred[i] = cpi->single_pred_count[i] * 255 /
(cpi->single_pred_count[i] + cpi->comp_pred_count[i]);
if (pc->prob_comppred[i] < 1)
pc->prob_comppred[i] = 1;
}
else
{
pc->prob_dualpred[i] = 128;
pc->prob_comppred[i] = 128;
}
vp8_write_literal(w, pc->prob_dualpred[i], 8);
vp8_write_literal(w, pc->prob_comppred[i], 8);
}
}
else if (cpi->common.dual_pred_mode == SINGLE_PREDICTION_ONLY)
else if (cpi->common.comp_pred_mode == SINGLE_PREDICTION_ONLY)
{
vp8_write(w, 0, 128);
}
else /* dual prediction only */
else /* compound prediction only */
{
vp8_write(w, 1, 128);
vp8_write(w, 0, 128);
@ -844,11 +844,11 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
#endif
write_mv(w, &mi->mv.as_mv, &best_mv, mvc);
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
vp8_write(w,
mi->second_ref_frame != INTRA_FRAME,
get_pred_prob( pc, xd, PRED_DUAL ) );
get_pred_prob( pc, xd, PRED_COMP ) );
}
if (mi->second_ref_frame)
{
@ -925,11 +925,11 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
}
break;
default:
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
vp8_write(w,
mi->second_ref_frame != INTRA_FRAME,
get_pred_prob( pc, xd, PRED_DUAL ) );
get_pred_prob( pc, xd, PRED_COMP ) );
}
break;
}
@ -1014,31 +1014,31 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
vp8_write_literal(w, pc->prob_last_coded, 8);
vp8_write_literal(w, pc->prob_gf_coded, 8);
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
vp8_write(w, 1, 128);
vp8_write(w, 1, 128);
for (i = 0; i < DUAL_PRED_CONTEXTS; i++)
for (i = 0; i < COMP_PRED_CONTEXTS; i++)
{
if (cpi->single_pred_count[i] + cpi->dual_pred_count[i])
if (cpi->single_pred_count[i] + cpi->comp_pred_count[i])
{
pc->prob_dualpred[i] = cpi->single_pred_count[i] * 255 /
(cpi->single_pred_count[i] + cpi->dual_pred_count[i]);
if (pc->prob_dualpred[i] < 1)
pc->prob_dualpred[i] = 1;
pc->prob_comppred[i] = cpi->single_pred_count[i] * 255 /
(cpi->single_pred_count[i] + cpi->comp_pred_count[i]);
if (pc->prob_comppred[i] < 1)
pc->prob_comppred[i] = 1;
}
else
{
pc->prob_dualpred[i] = 128;
pc->prob_comppred[i] = 128;
}
vp8_write_literal(w, pc->prob_dualpred[i], 8);
vp8_write_literal(w, pc->prob_comppred[i], 8);
}
}
else if (cpi->common.dual_pred_mode == SINGLE_PREDICTION_ONLY)
else if (cpi->common.comp_pred_mode == SINGLE_PREDICTION_ONLY)
{
vp8_write(w, 0, 128);
}
else /* dual prediction only */
else /* compound prediction only */
{
vp8_write(w, 1, 128);
vp8_write(w, 0, 128);
@ -1211,11 +1211,10 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
#endif
write_mv(w, &mi->mv.as_mv, &best_mv, mvc);
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
vp8_write(w, mi->second_ref_frame != INTRA_FRAME,
get_pred_prob( pc, xd, PRED_DUAL ) );
get_pred_prob( pc, xd, PRED_COMP ) );
}
if (mi->second_ref_frame)
{
@ -1286,10 +1285,10 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
}
break;
default:
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
vp8_write(w, mi->second_ref_frame != INTRA_FRAME,
get_pred_prob( pc, xd, PRED_DUAL ) );
get_pred_prob( pc, xd, PRED_COMP ) );
}
break;
}

View File

@ -1130,9 +1130,9 @@ static void encode_frame_internal(VP8_COMP *cpi)
// re-initencode frame context.
init_encode_frame_mb_context(cpi);
cpi->rd_single_diff = cpi->rd_dual_diff = cpi->rd_hybrid_diff = 0;
cpi->rd_single_diff = cpi->rd_comp_diff = cpi->rd_hybrid_diff = 0;
vpx_memset(cpi->single_pred_count, 0, sizeof(cpi->single_pred_count));
vpx_memset(cpi->dual_pred_count, 0, sizeof(cpi->dual_pred_count));
vpx_memset(cpi->comp_pred_count, 0, sizeof(cpi->comp_pred_count));
{
struct vpx_usec_timer emr_timer;
@ -1239,11 +1239,11 @@ void vp8_encode_frame(VP8_COMP *cpi)
{
int frame_type, pred_type;
int redo = 0;
int single_diff, dual_diff, hybrid_diff;
int single_diff, comp_diff, hybrid_diff;
/*
* This code does a single RD pass over the whole frame assuming
* either dual, single or hybrid prediction as per whatever has
* either compound, single or hybrid prediction as per whatever has
* worked best for that type of frame in the past.
* It also predicts whether another coding mode would have worked
* better that this coding mode. If that is the case, it remembers
@ -1264,7 +1264,7 @@ void vp8_encode_frame(VP8_COMP *cpi)
cpi->rd_prediction_type_threshes[frame_type][0] &&
cpi->rd_prediction_type_threshes[frame_type][1] >
cpi->rd_prediction_type_threshes[frame_type][2])
pred_type = DUAL_PREDICTION_ONLY;
pred_type = COMP_PREDICTION_ONLY;
else if (cpi->rd_prediction_type_threshes[frame_type][0] >
cpi->rd_prediction_type_threshes[frame_type][1] &&
cpi->rd_prediction_type_threshes[frame_type][0] >
@ -1273,38 +1273,38 @@ void vp8_encode_frame(VP8_COMP *cpi)
else
pred_type = HYBRID_PREDICTION;
cpi->common.dual_pred_mode = pred_type;
cpi->common.comp_pred_mode = pred_type;
encode_frame_internal(cpi);
single_diff = cpi->rd_single_diff / cpi->common.MBs;
cpi->rd_prediction_type_threshes[frame_type][0] += single_diff;
cpi->rd_prediction_type_threshes[frame_type][0] >>= 1;
dual_diff = cpi->rd_dual_diff / cpi->common.MBs;
cpi->rd_prediction_type_threshes[frame_type][1] += dual_diff;
comp_diff = cpi->rd_comp_diff / cpi->common.MBs;
cpi->rd_prediction_type_threshes[frame_type][1] += comp_diff;
cpi->rd_prediction_type_threshes[frame_type][1] >>= 1;
hybrid_diff = cpi->rd_hybrid_diff / cpi->common.MBs;
cpi->rd_prediction_type_threshes[frame_type][2] += hybrid_diff;
cpi->rd_prediction_type_threshes[frame_type][2] >>= 1;
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
int single_count_zero = 0;
int dual_count_zero = 0;
int comp_count_zero = 0;
int i;
for ( i = 0; i < DUAL_PRED_CONTEXTS; i++ )
for ( i = 0; i < COMP_PRED_CONTEXTS; i++ )
{
single_count_zero += cpi->single_pred_count[i];
dual_count_zero += cpi->dual_pred_count[i];
comp_count_zero += cpi->comp_pred_count[i];
}
if (dual_count_zero == 0)
if (comp_count_zero == 0)
{
cpi->common.dual_pred_mode = SINGLE_PREDICTION_ONLY;
cpi->common.comp_pred_mode = SINGLE_PREDICTION_ONLY;
}
else if (single_count_zero == 0)
{
cpi->common.dual_pred_mode = DUAL_PREDICTION_ONLY;
cpi->common.comp_pred_mode = COMP_PREDICTION_ONLY;
}
}
}
@ -1547,7 +1547,7 @@ int vp8cx_encode_inter_macroblock
// For now this codebase is limited to a single rd encode path
{
int zbin_mode_boost_enabled = cpi->zbin_mode_boost_enabled;
int single, dual, hybrid;
int single, compound, hybrid;
/* Are we using the fast quantizer for the mode selection? */
if(cpi->sf.use_fastquant_for_pick)
@ -1562,22 +1562,22 @@ int vp8cx_encode_inter_macroblock
cpi->zbin_mode_boost_enabled = 0;
}
vp8_rd_pick_inter_mode(cpi, x, recon_yoffset, recon_uvoffset, &rate,
&distortion, &intra_error, &single, &dual, &hybrid);
&distortion, &intra_error, &single, &compound, &hybrid);
cpi->rd_single_diff += single;
cpi->rd_dual_diff += dual;
cpi->rd_comp_diff += compound;
cpi->rd_hybrid_diff += hybrid;
if (x->e_mbd.mode_info_context->mbmi.ref_frame &&
x->e_mbd.mode_info_context->mbmi.mode != SPLITMV)
{
unsigned char pred_context;
pred_context = get_pred_context( cm, xd, PRED_DUAL );
pred_context = get_pred_context( cm, xd, PRED_COMP );
if (xd->mode_info_context->mbmi.second_ref_frame == INTRA_FRAME)
cpi->single_pred_count[pred_context]++;
else
cpi->dual_pred_count[pred_context]++;
cpi->comp_pred_count[pred_context]++;
}
#if CONFIG_T8X8

View File

@ -696,19 +696,19 @@ void vp8_set_speed_features(VP8_COMP *cpi)
sf->thresh_mult[THR_SPLITG ] = 5000;
sf->thresh_mult[THR_SPLITA ] = 5000;
sf->thresh_mult[THR_DUAL_ZEROLG ] = 0;
sf->thresh_mult[THR_DUAL_NEARESTLG] = 0;
sf->thresh_mult[THR_DUAL_NEARLG ] = 0;
sf->thresh_mult[THR_DUAL_ZEROLA ] = 0;
sf->thresh_mult[THR_DUAL_NEARESTLA] = 0;
sf->thresh_mult[THR_DUAL_NEARLA ] = 0;
sf->thresh_mult[THR_DUAL_ZEROGA ] = 0;
sf->thresh_mult[THR_DUAL_NEARESTGA] = 0;
sf->thresh_mult[THR_DUAL_NEARGA ] = 0;
sf->thresh_mult[THR_COMP_ZEROLG ] = 0;
sf->thresh_mult[THR_COMP_NEARESTLG] = 0;
sf->thresh_mult[THR_COMP_NEARLG ] = 0;
sf->thresh_mult[THR_COMP_ZEROLA ] = 0;
sf->thresh_mult[THR_COMP_NEARESTLA] = 0;
sf->thresh_mult[THR_COMP_NEARLA ] = 0;
sf->thresh_mult[THR_COMP_ZEROGA ] = 0;
sf->thresh_mult[THR_COMP_NEARESTGA] = 0;
sf->thresh_mult[THR_COMP_NEARGA ] = 0;
sf->thresh_mult[THR_DUAL_NEWLG ] = 1000;
sf->thresh_mult[THR_DUAL_NEWLA ] = 1000;
sf->thresh_mult[THR_DUAL_NEWGA ] = 1000;
sf->thresh_mult[THR_COMP_NEWLG ] = 1000;
sf->thresh_mult[THR_COMP_NEWLA ] = 1000;
sf->thresh_mult[THR_COMP_NEWGA ] = 1000;
sf->first_step = 0;
sf->max_step_search_steps = MAX_MVSEARCH_STEPS;
@ -750,19 +750,19 @@ void vp8_set_speed_features(VP8_COMP *cpi)
sf->thresh_mult[THR_SPLITG ] = 4500;
sf->thresh_mult[THR_SPLITA ] = 4500;
sf->thresh_mult[THR_DUAL_ZEROLG ] = 0;
sf->thresh_mult[THR_DUAL_NEARESTLG] = 0;
sf->thresh_mult[THR_DUAL_NEARLG ] = 0;
sf->thresh_mult[THR_DUAL_ZEROLA ] = 0;
sf->thresh_mult[THR_DUAL_NEARESTLA] = 0;
sf->thresh_mult[THR_DUAL_NEARLA ] = 0;
sf->thresh_mult[THR_DUAL_ZEROGA ] = 0;
sf->thresh_mult[THR_DUAL_NEARESTGA] = 0;
sf->thresh_mult[THR_DUAL_NEARGA ] = 0;
sf->thresh_mult[THR_COMP_ZEROLG ] = 0;
sf->thresh_mult[THR_COMP_NEARESTLG] = 0;
sf->thresh_mult[THR_COMP_NEARLG ] = 0;
sf->thresh_mult[THR_COMP_ZEROLA ] = 0;
sf->thresh_mult[THR_COMP_NEARESTLA] = 0;
sf->thresh_mult[THR_COMP_NEARLA ] = 0;
sf->thresh_mult[THR_COMP_ZEROGA ] = 0;
sf->thresh_mult[THR_COMP_NEARESTGA] = 0;
sf->thresh_mult[THR_COMP_NEARGA ] = 0;
sf->thresh_mult[THR_DUAL_NEWLG ] = 1000;
sf->thresh_mult[THR_DUAL_NEWLA ] = 1000;
sf->thresh_mult[THR_DUAL_NEWGA ] = 1000;
sf->thresh_mult[THR_COMP_NEWLG ] = 1000;
sf->thresh_mult[THR_COMP_NEWLA ] = 1000;
sf->thresh_mult[THR_COMP_NEWGA ] = 1000;
if (Speed > 0)
{
@ -814,19 +814,19 @@ void vp8_set_speed_features(VP8_COMP *cpi)
sf->thresh_mult[THR_SPLITA ] = 20000;
}
sf->thresh_mult[THR_DUAL_ZEROLG ] = 1500;
sf->thresh_mult[THR_DUAL_NEARESTLG] = 1500;
sf->thresh_mult[THR_DUAL_NEARLG ] = 1500;
sf->thresh_mult[THR_DUAL_ZEROLA ] = 1500;
sf->thresh_mult[THR_DUAL_NEARESTLA] = 1500;
sf->thresh_mult[THR_DUAL_NEARLA ] = 1500;
sf->thresh_mult[THR_DUAL_ZEROGA ] = 1500;
sf->thresh_mult[THR_DUAL_NEARESTGA] = 1500;
sf->thresh_mult[THR_DUAL_NEARGA ] = 1500;
sf->thresh_mult[THR_COMP_ZEROLG ] = 1500;
sf->thresh_mult[THR_COMP_NEARESTLG] = 1500;
sf->thresh_mult[THR_COMP_NEARLG ] = 1500;
sf->thresh_mult[THR_COMP_ZEROLA ] = 1500;
sf->thresh_mult[THR_COMP_NEARESTLA] = 1500;
sf->thresh_mult[THR_COMP_NEARLA ] = 1500;
sf->thresh_mult[THR_COMP_ZEROGA ] = 1500;
sf->thresh_mult[THR_COMP_NEARESTGA] = 1500;
sf->thresh_mult[THR_COMP_NEARGA ] = 1500;
sf->thresh_mult[THR_DUAL_NEWLG ] = 2000;
sf->thresh_mult[THR_DUAL_NEWLA ] = 2000;
sf->thresh_mult[THR_DUAL_NEWGA ] = 2000;
sf->thresh_mult[THR_COMP_NEWLG ] = 2000;
sf->thresh_mult[THR_COMP_NEWLA ] = 2000;
sf->thresh_mult[THR_COMP_NEWGA ] = 2000;
}
if (Speed > 2)
@ -865,19 +865,19 @@ void vp8_set_speed_features(VP8_COMP *cpi)
sf->thresh_mult[THR_SPLITA ] = 50000;
}
sf->thresh_mult[THR_DUAL_ZEROLG ] = 2000;
sf->thresh_mult[THR_DUAL_NEARESTLG] = 2000;
sf->thresh_mult[THR_DUAL_NEARLG ] = 2000;
sf->thresh_mult[THR_DUAL_ZEROLA ] = 2000;
sf->thresh_mult[THR_DUAL_NEARESTLA] = 2000;
sf->thresh_mult[THR_DUAL_NEARLA ] = 2000;
sf->thresh_mult[THR_DUAL_ZEROGA ] = 2000;
sf->thresh_mult[THR_DUAL_NEARESTGA] = 2000;
sf->thresh_mult[THR_DUAL_NEARGA ] = 2000;
sf->thresh_mult[THR_COMP_ZEROLG ] = 2000;
sf->thresh_mult[THR_COMP_NEARESTLG] = 2000;
sf->thresh_mult[THR_COMP_NEARLG ] = 2000;
sf->thresh_mult[THR_COMP_ZEROLA ] = 2000;
sf->thresh_mult[THR_COMP_NEARESTLA] = 2000;
sf->thresh_mult[THR_COMP_NEARLA ] = 2000;
sf->thresh_mult[THR_COMP_ZEROGA ] = 2000;
sf->thresh_mult[THR_COMP_NEARESTGA] = 2000;
sf->thresh_mult[THR_COMP_NEARGA ] = 2000;
sf->thresh_mult[THR_DUAL_NEWLG ] = 2500;
sf->thresh_mult[THR_DUAL_NEWLA ] = 2500;
sf->thresh_mult[THR_DUAL_NEWGA ] = 2500;
sf->thresh_mult[THR_COMP_NEWLG ] = 2500;
sf->thresh_mult[THR_COMP_NEWLA ] = 2500;
sf->thresh_mult[THR_COMP_NEWGA ] = 2500;
sf->improved_quant = 0;
sf->improved_dct = 0;
@ -922,26 +922,26 @@ void vp8_set_speed_features(VP8_COMP *cpi)
if ((cpi->ref_frame_flags & (VP8_LAST_FLAG | VP8_GOLD_FLAG)) != (VP8_LAST_FLAG | VP8_GOLD_FLAG))
{
sf->thresh_mult[THR_DUAL_ZEROLG ] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEARESTLG] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEARLG ] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEWLG ] = INT_MAX;
sf->thresh_mult[THR_COMP_ZEROLG ] = INT_MAX;
sf->thresh_mult[THR_COMP_NEARESTLG] = INT_MAX;
sf->thresh_mult[THR_COMP_NEARLG ] = INT_MAX;
sf->thresh_mult[THR_COMP_NEWLG ] = INT_MAX;
}
if ((cpi->ref_frame_flags & (VP8_LAST_FLAG | VP8_ALT_FLAG)) != (VP8_LAST_FLAG | VP8_ALT_FLAG))
{
sf->thresh_mult[THR_DUAL_ZEROLA ] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEARESTLA] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEARLA ] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEWLA ] = INT_MAX;
sf->thresh_mult[THR_COMP_ZEROLA ] = INT_MAX;
sf->thresh_mult[THR_COMP_NEARESTLA] = INT_MAX;
sf->thresh_mult[THR_COMP_NEARLA ] = INT_MAX;
sf->thresh_mult[THR_COMP_NEWLA ] = INT_MAX;
}
if ((cpi->ref_frame_flags & (VP8_GOLD_FLAG | VP8_ALT_FLAG)) != (VP8_GOLD_FLAG | VP8_ALT_FLAG))
{
sf->thresh_mult[THR_DUAL_ZEROGA ] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEARESTGA] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEARGA ] = INT_MAX;
sf->thresh_mult[THR_DUAL_NEWGA ] = INT_MAX;
sf->thresh_mult[THR_COMP_ZEROGA ] = INT_MAX;
sf->thresh_mult[THR_COMP_NEARESTGA] = INT_MAX;
sf->thresh_mult[THR_COMP_NEARGA ] = INT_MAX;
sf->thresh_mult[THR_COMP_NEWGA ] = INT_MAX;
}
// Slow quant, dct and trellis not worthwhile for first pass
@ -1578,8 +1578,8 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf)
cm->prob_last_coded = 128;
cm->prob_gf_coded = 128;
cm->prob_intra_coded = 63;
for ( i = 0; i < DUAL_PRED_CONTEXTS; i++ )
cm->prob_dualpred[i] = 128;
for ( i = 0; i < COMP_PRED_CONTEXTS; i++ )
cm->prob_comppred[i] = 128;
// Prime the recent reference frame useage counters.
// Hereafter they will be maintained as a sort of moving average

View File

@ -191,21 +191,21 @@ typedef enum
THR_B_PRED = 19,
THR_I8X8_PRED = 20,
THR_DUAL_ZEROLG = 21,
THR_DUAL_NEARESTLG = 22,
THR_DUAL_NEARLG = 23,
THR_COMP_ZEROLG = 21,
THR_COMP_NEARESTLG = 22,
THR_COMP_NEARLG = 23,
THR_DUAL_ZEROLA = 24,
THR_DUAL_NEARESTLA = 25,
THR_DUAL_NEARLA = 26,
THR_COMP_ZEROLA = 24,
THR_COMP_NEARESTLA = 25,
THR_COMP_NEARLA = 26,
THR_DUAL_ZEROGA = 27,
THR_DUAL_NEARESTGA = 28,
THR_DUAL_NEARGA = 29,
THR_COMP_ZEROGA = 27,
THR_COMP_NEARESTGA = 28,
THR_COMP_NEARGA = 29,
THR_DUAL_NEWLG = 30,
THR_DUAL_NEWLA = 31,
THR_DUAL_NEWGA = 32,
THR_COMP_NEWLG = 30,
THR_COMP_NEWLA = 31,
THR_COMP_NEWGA = 32,
}
THR_MODES;
@ -357,10 +357,10 @@ typedef struct VP8_COMP
int rd_thresh_mult[MAX_MODES];
int rd_baseline_thresh[MAX_MODES];
int rd_threshes[MAX_MODES];
int64_t rd_single_diff, rd_dual_diff, rd_hybrid_diff;
int64_t rd_single_diff, rd_comp_diff, rd_hybrid_diff;
int rd_prediction_type_threshes[4][NB_PREDICTION_TYPES];
int dual_pred_count[DUAL_PRED_CONTEXTS];
int single_pred_count[DUAL_PRED_CONTEXTS];
int comp_pred_count[COMP_PRED_CONTEXTS];
int single_pred_count[COMP_PRED_CONTEXTS];
int RDMULT;
int RDDIV ;

View File

@ -105,7 +105,7 @@ const MB_PREDICTION_MODE vp8_mode_order[MAX_MODES] =
B_PRED,
I8X8_PRED,
/* dual prediction modes */
/* compound prediction modes */
ZEROMV,
NEARESTMV,
NEARMV,
@ -155,7 +155,7 @@ const MV_REFERENCE_FRAME vp8_ref_frame_order[MAX_MODES] =
INTRA_FRAME,
INTRA_FRAME,
/* dual prediction modes */
/* compound prediction modes */
LAST_FRAME,
LAST_FRAME,
LAST_FRAME,
@ -179,7 +179,7 @@ const MV_REFERENCE_FRAME vp8_second_ref_frame_order[MAX_MODES] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
/* dual prediction modes */
/* compound prediction modes */
GOLDEN_FRAME,
GOLDEN_FRAME,
GOLDEN_FRAME,
@ -2446,7 +2446,7 @@ void vp8_estimate_ref_frame_costs(VP8_COMP *cpi, unsigned int * ref_costs )
void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset,
int *returnrate, int *returndistortion, int *returnintra,
int *best_single_rd_diff, int *best_dual_rd_diff,
int *best_single_rd_diff, int *best_comp_rd_diff,
int *best_hybrid_rd_diff)
{
VP8_COMMON *cm = &cpi->common;
@ -2471,7 +2471,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
int distortion;
int best_rd = INT_MAX;
int best_intra_rd = INT_MAX;
int best_dual_rd = INT_MAX;
int best_comp_rd = INT_MAX;
int best_single_rd = INT_MAX;
int best_hybrid_rd = INT_MAX;
int rate2, distortion2;
@ -2584,7 +2584,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
int this_rd = INT_MAX;
int disable_skip = 0;
int other_cost = 0;
int dualmode_cost = 0;
int compmode_cost = 0;
int mode_excluded = 0;
// Test best rd so far against threshold for trying this mode.
@ -2980,8 +2980,8 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
vp8_set_mbmode_and_mvs(x, this_mode, &mode_mv[this_mode]);
vp8_build_inter16x16_predictors_mby(&x->e_mbd);
dualmode_cost =
vp8_cost_bit( get_pred_prob( cm, xd, PRED_DUAL ), 0 );
compmode_cost =
vp8_cost_bit( get_pred_prob( cm, xd, PRED_COMP ), 0 );
if (cpi->active_map_enabled && x->active_ptr[0] == 0) {
x->skip = 1;
@ -3061,7 +3061,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
cpi->common.full_pixel);
rate2 += rate_uv;
distortion2 += distortion_uv;
mode_excluded = cpi->common.dual_pred_mode == DUAL_PREDICTION_ONLY;
mode_excluded = cpi->common.comp_pred_mode == COMP_PREDICTION_ONLY;
break;
default:
@ -3072,7 +3072,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
int ref1 = x->e_mbd.mode_info_context->mbmi.ref_frame;
int ref2 = x->e_mbd.mode_info_context->mbmi.second_ref_frame;
mode_excluded = cpi->common.dual_pred_mode == SINGLE_PREDICTION_ONLY;
mode_excluded = cpi->common.comp_pred_mode == SINGLE_PREDICTION_ONLY;
switch (this_mode)
{
case NEWMV:
@ -3165,8 +3165,8 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
/* We don't include the cost of the second reference here, because there are only
* three options: Last/Golden, ARF/Last or Golden/ARF, or in other words if you
* present them in that order, the second one is always known if the first is known */
dualmode_cost =
vp8_cost_bit( get_pred_prob( cm, xd, PRED_DUAL ), 1 );
compmode_cost =
vp8_cost_bit( get_pred_prob( cm, xd, PRED_COMP ), 1 );
}
// Where skip is allowable add in the default per mb cost for the no skip case.
@ -3179,9 +3179,9 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
rate2 += prob_skip_cost;
}
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
rate2 += dualmode_cost;
rate2 += compmode_cost;
}
@ -3272,8 +3272,8 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
if (!disable_skip &&
(this_mode == SPLITMV || x->e_mbd.mode_info_context->mbmi.ref_frame == INTRA_FRAME))
{
if (this_rd < best_dual_rd)
best_dual_rd = this_rd;
if (this_rd < best_comp_rd)
best_comp_rd = this_rd;
if (this_rd < best_single_rd)
best_single_rd = this_rd;
if (this_rd < best_hybrid_rd)
@ -3332,22 +3332,22 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
cpi->rd_threshes[mode_index] = (cpi->rd_baseline_thresh[mode_index] >> 7) * cpi->rd_thresh_mult[mode_index];
}
/* keep record of best dual/single-only prediction */
/* keep record of best compound/single-only prediction */
if (!disable_skip &&
x->e_mbd.mode_info_context->mbmi.ref_frame != INTRA_FRAME &&
this_mode != SPLITMV)
{
int single_rd, hybrid_rd, single_rate, hybrid_rate;
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION)
{
single_rate = rate2 - dualmode_cost;
single_rate = rate2 - compmode_cost;
hybrid_rate = rate2;
}
else
{
single_rate = rate2;
hybrid_rate = rate2 + dualmode_cost;
hybrid_rate = rate2 + compmode_cost;
}
single_rd = RDCOST(x->rdmult, x->rddiv, single_rate, distortion2);
@ -3357,18 +3357,15 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
single_rd < best_single_rd)
{
best_single_rd = single_rd;
if (0) printf("single rd [DMC: %d]: %d\n", dualmode_cost, single_rd);
}
else if (x->e_mbd.mode_info_context->mbmi.second_ref_frame != INTRA_FRAME &&
single_rd < best_dual_rd)
single_rd < best_comp_rd)
{
best_dual_rd = single_rd;
if (0) printf("dual rd [DMC: %d]: %d\n", dualmode_cost, single_rd);
best_comp_rd = single_rd;
}
if (hybrid_rd < best_hybrid_rd)
{
best_hybrid_rd = hybrid_rd;
if (0) printf("hybrid rd [DMC: %d]: %d\n", best_hybrid_rd, hybrid_rd);
}
}
@ -3424,7 +3421,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
(cpi->common.mb_no_coeff_skip) ? 1 : 0;
x->e_mbd.mode_info_context->mbmi.partitioning = 0;
*best_single_rd_diff = *best_dual_rd_diff = *best_hybrid_rd_diff = 0;
*best_single_rd_diff = *best_comp_rd_diff = *best_hybrid_rd_diff = 0;
return;
}
@ -3465,10 +3462,10 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
*best_single_rd_diff = INT_MIN;
else
*best_single_rd_diff = best_rd - best_single_rd;
if (best_dual_rd == INT_MAX)
*best_dual_rd_diff = INT_MIN;
if (best_comp_rd == INT_MAX)
*best_comp_rd_diff = INT_MIN;
else
*best_dual_rd_diff = best_rd - best_dual_rd;
*best_comp_rd_diff = best_rd - best_comp_rd;
if (best_hybrid_rd == INT_MAX)
*best_hybrid_rd_diff = INT_MIN;
else

View File

@ -18,7 +18,7 @@
extern void vp8_initialize_rd_consts(VP8_COMP *cpi, int Qvalue);
extern void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset,
int *returnrate, int *returndistortion, int *returnintra,
int *best_single_rd_diff, int *best_dual_rd_diff, int *best_hybrid_rd_diff);
int *best_single_rd_diff, int *best_comp_rd_diff, int *best_hybrid_rd_diff);
extern void vp8_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate);
extern void vp8_mv_pred