Commit 721711fb authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Remove dual prediction frame re-encoding loop.

I'm basically not convinced that the concept works at all, let alone
that this is the right place to do it. I think if we want something
like this at all, I should integrate it with the main encoding loop
and re-encode checks in onyx_if.c, and show that it has a significant
benefit (which right now, it doesn't; removing this re-encode check
actually increases all metrics by ~0.15%).

Change-Id: I1b597385dc17f468384a994484fb24813389411f
parent 0930dde2
......@@ -1395,23 +1395,7 @@ void vp8_encode_frame(VP8_COMP *cpi)
cpi->rd_prediction_type_threshes[frame_type][2] += hybrid_diff;
cpi->rd_prediction_type_threshes[frame_type][2] >>= 1;
/* FIXME make "100" (the threshold at which to re-encode the
* current frame) a commandline option. */
if (cpi->common.dual_pred_mode == SINGLE_PREDICTION_ONLY &&
(dual_diff >= 100 || hybrid_diff >= 100))
{
redo = 1;
cpi->common.dual_pred_mode = cpi->rd_dual_diff > cpi->rd_hybrid_diff ?
DUAL_PREDICTION_ONLY : HYBRID_PREDICTION;
}
else if (cpi->common.dual_pred_mode == DUAL_PREDICTION_ONLY &&
(single_diff >= 100 || hybrid_diff >= 100))
{
redo = 1;
cpi->common.dual_pred_mode = cpi->rd_single_diff > cpi->rd_hybrid_diff ?
SINGLE_PREDICTION_ONLY : HYBRID_PREDICTION;
}
else if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
{
int single_count_zero = 0;
int dual_count_zero = 0;
......@@ -1431,39 +1415,6 @@ void vp8_encode_frame(VP8_COMP *cpi)
{
cpi->common.dual_pred_mode = DUAL_PREDICTION_ONLY;
}
else if (single_diff >= 100 || dual_diff >= 100)
{
redo = 1;
cpi->common.dual_pred_mode = cpi->rd_single_diff > cpi->rd_dual_diff ?
SINGLE_PREDICTION_ONLY : DUAL_PREDICTION_ONLY;
}
}
if (redo)
{
encode_frame_internal(cpi);
if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
{
int single_count_zero = 0;
int dual_count_zero = 0;
int i;
for ( i = 0; i < DUAL_PRED_CONTEXTS; i++ )
{
single_count_zero += cpi->single_pred_count[i];
dual_count_zero += cpi->dual_pred_count[i];
}
if (dual_count_zero == 0)
{
cpi->common.dual_pred_mode = SINGLE_PREDICTION_ONLY;
}
else if (single_count_zero == 0)
{
cpi->common.dual_pred_mode = DUAL_PREDICTION_ONLY;
}
}
}
}
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment