From c34e5cafcaf3c648e8dcdb380010cd93d8b2f3f3 Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Mon, 3 Dec 2018 10:32:06 -0800 Subject: [PATCH] vp9: Rename post_encode drop function. Feature works also for non-screen content mode, so rename it. Change-Id: I665362d50cf9a4017f114973586ad0eead066ddd --- vp9/encoder/vp9_encoder.c | 3 +-- vp9/encoder/vp9_ratectrl.c | 2 +- vp9/encoder/vp9_ratectrl.h | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 04d25247d..c391d8d98 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4847,8 +4847,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size, vp9_pack_bitstream(cpi, dest, size); if (cpi->rc.use_post_encode_drop && cm->base_qindex < cpi->rc.worst_quality && - cpi->svc.spatial_layer_id == 0 && - post_encode_drop_screen_content(cpi, size)) { + cpi->svc.spatial_layer_id == 0 && post_encode_drop_cbr(cpi, size)) { restore_coding_context(cpi); return; } diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 396ba0269..26dfb47d7 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -550,7 +550,7 @@ static int drop_frame(VP9_COMP *cpi) { } } -int post_encode_drop_screen_content(VP9_COMP *cpi, size_t *size) { +int post_encode_drop_cbr(VP9_COMP *cpi, size_t *size) { size_t frame_size = *size << 3; int64_t new_buffer_level = cpi->rc.buffer_level + cpi->rc.avg_frame_bandwidth - (int64_t)frame_size; diff --git a/vp9/encoder/vp9_ratectrl.h b/vp9/encoder/vp9_ratectrl.h index 16aa08137..a343bd34b 100644 --- a/vp9/encoder/vp9_ratectrl.h +++ b/vp9/encoder/vp9_ratectrl.h @@ -256,8 +256,8 @@ void vp9_rc_postencode_update_drop_frame(struct VP9_COMP *cpi); // Changes only the rate correction factors in the rate control structure. void vp9_rc_update_rate_correction_factors(struct VP9_COMP *cpi); -// Post encode drop for CBR screen-content mode. -int post_encode_drop_screen_content(struct VP9_COMP *cpi, size_t *size); +// Post encode drop for CBR mode. +int post_encode_drop_cbr(struct VP9_COMP *cpi, size_t *size); // Decide if we should drop this frame: For 1-pass CBR. // Changes only the decimation count in the rate control structure -- 2.40.0