//if ( 0 )
{
int flag[2] = {1, 1};
- vp8_initialize_rd_consts(cpi, vp8_dc_quant(cm->base_qindex, cm->y1dc_delta_q));
+ vp8_initialize_rd_consts(cpi, cm->base_qindex + cm->y1dc_delta_q);
vpx_memcpy(cm->fc.mvc, vp8_default_mv_context, sizeof(vp8_default_mv_context));
vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cm->fc.mvc, flag);
}
double error_term = err_per_mb / err_devisor;
double correction_factor;
- // Adjustment based on Q to power term.
- power_term = pt_low + (Q * 0.01);
+ // Adjustment based on actual quantizer to power term.
+ power_term = (vp8_convert_qindex_to_q(Q) * 0.01) + 0.36;
power_term = (power_term > pt_high) ? pt_high : power_term;
// Adjustments to error term
// Estimate of overhead bits per mb
// Correction to overhead bits for min allowed Q.
+ // PGW TODO.. This code is broken for the extended Q range
overhead_bits_per_mb = overhead_bits / num_mbs;
overhead_bits_per_mb *= pow( 0.98, (double)cpi->twopass.maxq_min_limit );
// Adjust maxq_min_limit and maxq_max_limit limits based on
// averaga q observed in clip for non kf/gf.arf frames
// Give average a chance to settle though.
- if ( (cpi->ni_frames >
+ // PGW TODO.. This code is broken for the extended Q range
+ /*if ( (cpi->ni_frames >
((unsigned int)cpi->twopass.total_stats->count >> 8)) &&
(cpi->ni_frames > 150) )
{
? (cpi->ni_av_qi + 32) : cpi->worst_quality;
cpi->twopass.maxq_min_limit = ((cpi->ni_av_qi - 32) > cpi->best_quality)
? (cpi->ni_av_qi - 32) : cpi->best_quality;
- }
+ }*/
return Q;
}
vp8_clear_system_state(); //__asm emms;
if (cpi->twopass.total_left_stats->coded_error != 0.0)
- fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %6d %6d"
- "%6d %6d %6d %5d %5d %5d %8d %8.2f %10d %10.3f"
+ fprintf(f, "%10d %10d %10d %10d %10d %10d %10d"
+ "%6.2f %6.2f %6.2f %6.2f %6.2f %6.2f"
+ "%6d %5d %5d %5d %8d %8.2f %10d %10.3f"
"%10.3f %8d\n",
cpi->common.current_video_frame, cpi->this_frame_target,
cpi->projected_frame_size,
(cpi->projected_frame_size - cpi->this_frame_target),
(int)cpi->total_target_vs_actual,
(cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
- (int)cpi->total_actual_bits, cm->base_qindex,
- cpi->active_best_quality, cpi->active_worst_quality,
- cpi->ni_av_qi, cpi->cq_target_quality,
+ (int)cpi->total_actual_bits,
+ vp8_convert_qindex_to_q(cm->base_qindex),
+#if CONFIG_EXTEND_QRANGE
+ (double)vp8_dc_quant(cm->base_qindex,0)/4.0,
+#else
+ (double)vp8_dc_quant(cm->base_qindex,0),
+#endif
+ vp8_convert_qindex_to_q(cpi->active_best_quality),
+ vp8_convert_qindex_to_q(cpi->active_worst_quality),
+ vp8_convert_qindex_to_q(cpi->ni_av_qi),
+ vp8_convert_qindex_to_q(cpi->cq_target_quality),
cpi->zbin_over_quant,
//cpi->avg_frame_qindex, cpi->zbin_over_quant,
cm->refresh_golden_frame, cm->refresh_alt_ref_frame,
cpi->twopass.total_left_stats->coded_error,
cpi->tot_recode_hits);
else
- fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %6d %6d"
- "%6d %6d %6d %5d %5d %5d %8d %8.2f %10d %10.3f"
+ fprintf(f, "%10d %10d %10d %10d %10d %10d %10d"
+ "%6.2f %6.2f %6.2f %6.2f %6.2f %6.2f"
+ "%6d %5d %5d %5d %8d %8.2f %10d %10.3f"
"%8d\n",
cpi->common.current_video_frame,
cpi->this_frame_target, cpi->projected_frame_size,
(cpi->projected_frame_size - cpi->this_frame_target),
(int)cpi->total_target_vs_actual,
(cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
- (int)cpi->total_actual_bits, cm->base_qindex,
- cpi->active_best_quality, cpi->active_worst_quality,
- cpi->ni_av_qi, cpi->cq_target_quality,
+ (int)cpi->total_actual_bits,
+ vp8_convert_qindex_to_q(cm->base_qindex),
+#if CONFIG_EXTEND_QRANGE
+ (double)vp8_dc_quant(cm->base_qindex,0)/4.0,
+#else
+ (double)vp8_dc_quant(cm->base_qindex,0),
+#endif
+ vp8_convert_qindex_to_q(cpi->active_best_quality),
+ vp8_convert_qindex_to_q(cpi->active_worst_quality),
+ vp8_convert_qindex_to_q(cpi->ni_av_qi),
+ vp8_convert_qindex_to_q(cpi->cq_target_quality),
cpi->zbin_over_quant,
//cpi->avg_frame_qindex, cpi->zbin_over_quant,
cm->refresh_golden_frame, cm->refresh_alt_ref_frame,