ref: 721711fb5138312e533c08ea26ce0a86adc30f3f
parent: 0930dde2496e911d24c930751b08c71ae722bd89
author: Ronald S. Bultje <rbultje@google.com>
date: Wed Feb 15 11:38:04 EST 2012
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
--- a/vp8/encoder/encodeframe.c
+++ b/vp8/encoder/encodeframe.c
@@ -1395,24 +1395,8 @@
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))
+ if (cpi->common.dual_pred_mode == HYBRID_PREDICTION)
{
- 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)
- {
int single_count_zero = 0;
int dual_count_zero = 0;
int i;
@@ -1430,39 +1414,6 @@
else if (single_count_zero == 0)
{
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;
- }
}
}
}