From 08a22a6323e08c25d4266f64733a75367eb85c30 Mon Sep 17 00:00:00 2001 From: Angie Chiang Date: Mon, 17 Jul 2017 17:29:17 -0700 Subject: [PATCH] Add flag inter_stats_only This flag will allow us to skip key frame's stats Therefore, we can test inter frame performance when frame number is small. The inter frame's stats won't get underwhelmed because of key frame's stats Change-Id: I9eaa8e5775fb2e740406cfa4b4f64f96f180d9db --- av1/encoder/encoder.c | 13 ++++++++----- configure | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index 1406d17e9..6003b580a 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c @@ -5296,12 +5296,17 @@ static void adjust_image_stat(double y, double u, double v, double all, s->worst = AOMMIN(s->worst, all); } -static void compute_internal_stats(AV1_COMP *cpi) { +static void compute_internal_stats(AV1_COMP *cpi, int frame_bytes) { AV1_COMMON *const cm = &cpi->common; double samples = 0.0; uint32_t in_bit_depth = 8; uint32_t bit_depth = 8; +#if CONFIG_INTER_STATS_ONLY + if (cm->current_video_frame <= 1) return; // skip key frame +#endif + cpi->bytes += frame_bytes; + #if CONFIG_HIGHBITDEPTH if (cm->use_highbitdepth) { in_bit_depth = cpi->oxcf.input_bit_depth; @@ -5489,8 +5494,7 @@ int av1_get_compressed_data(AV1_COMP *cpi, unsigned int *frame_flags, if (cpi->b_calculate_psnr) generate_psnr_packet(cpi); #if CONFIG_INTERNAL_STATS - compute_internal_stats(cpi); - cpi->bytes += (int)(*size); + compute_internal_stats(cpi, (int)(*size)); #endif // CONFIG_INTERNAL_STATS // Clear down mmx registers @@ -5723,8 +5727,7 @@ int av1_get_compressed_data(AV1_COMP *cpi, unsigned int *frame_flags, #if CONFIG_INTERNAL_STATS if (oxcf->pass != 1) { - compute_internal_stats(cpi); - cpi->bytes += (int)(*size); + compute_internal_stats(cpi, (int)(*size)); } #endif // CONFIG_INTERNAL_STATS diff --git a/configure b/configure index ad7011c04..73628a0da 100755 --- a/configure +++ b/configure @@ -282,6 +282,7 @@ EXPERIMENT_LIST=" warped_motion q_adapt_probs bitstream_debug + inter_stats_only alt_intra palette palette_delta_encoding -- GitLab