From c7780075ec0e87f74a1a5706dec914aad8dc9200 Mon Sep 17 00:00:00 2001 From: paulwilkins Date: Fri, 4 Mar 2016 12:55:04 +0000 Subject: Fix bug in stats output for HBD. Change-Id: Ic3b033e22cdcdc4a0f78cef433b2208fd254c27b --- vp9/encoder/vp9_encoder.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vp9/encoder/vp9_encoder.c') diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index f8f681aec..00beb3091 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -2719,6 +2719,13 @@ static int scale_down(VP9_COMP *cpi, int q) { return scale; } +static int big_rate_miss(VP9_COMP *cpi, int high_limit, int low_limit) { + const RATE_CONTROL *const rc = &cpi->rc; + + return (rc->projected_frame_size > ((high_limit * 3) / 2)) || + (rc->projected_frame_size < (low_limit / 2)); +} + // Function to test for conditions that indicate we should loop // back and recode a frame. static int recode_loop_test(VP9_COMP *cpi, @@ -2730,6 +2737,7 @@ static int recode_loop_test(VP9_COMP *cpi, int force_recode = 0; if ((rc->projected_frame_size >= rc->max_frame_bandwidth) || + big_rate_miss(cpi, high_limit, low_limit) || (cpi->sf.recode_loop == ALLOW_RECODE) || (frame_is_kfgfarf && (cpi->sf.recode_loop == ALLOW_RECODE_KFARFGF))) { @@ -3076,7 +3084,15 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) { vpx_clear_system_state(); +#if CONFIG_VP9_HIGHBITDEPTH + if (cm->use_highbitdepth) { + recon_err = vp9_highbd_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); + } else { + recon_err = vp9_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); + } +#else recon_err = vp9_get_y_sse(cpi->Source, get_frame_new_buffer(cm)); +#endif // CONFIG_VP9_HIGHBITDEPTH if (cpi->twopass.total_left_stats.coded_error != 0.0) fprintf(f, "%10u %dx%d %10d %10d %d %d %10d %10d %10d %10d" -- cgit v1.2.3