From: angiebird Date: Wed, 30 Oct 2019 01:52:40 +0000 (-0700) Subject: Remove bits_left update in encoder_encode() X-Git-Tag: v1.8.2~60^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bfcc7179b9a2d692290d3bd06e86e6726d9bdc1;p=libvpx Remove bits_left update in encoder_encode() It's already updated properly in vp9_init_second_pass() Change-Id: I94ee2e8536387c94a2abf9a7686011c76489c2f9 --- diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index d091a79b8..a511eca4a 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -1457,7 +1457,6 @@ static void init_level_constraint(LevelConstraint *lc) { lc->level_index = -1; lc->max_cpb_size = INT_MAX; lc->max_frame_size = INT_MAX; - lc->rc_config_updated = 0; lc->fail_flag = 0; } diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h index b0ea921ba..0de47e6e6 100644 --- a/vp9/encoder/vp9_encoder.h +++ b/vp9/encoder/vp9_encoder.h @@ -483,7 +483,6 @@ typedef enum { typedef struct { int8_t level_index; - uint8_t rc_config_updated; uint8_t fail_flag; int max_frame_size; // in bits double max_cpb_size; // in bits diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index d1cf5e7a3..ccdf9f75f 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -1116,16 +1116,6 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx, if (cpi == NULL) return VPX_CODEC_INVALID_PARAM; - if (cpi->oxcf.pass == 2 && cpi->level_constraint.level_index >= 0 && - !cpi->level_constraint.rc_config_updated) { - const VP9EncoderConfig *const oxcf = &cpi->oxcf; - TWO_PASS *const twopass = &cpi->twopass; - FIRSTPASS_STATS *stats = &twopass->total_stats; - twopass->bits_left = - (int64_t)(stats->duration * oxcf->target_bandwidth / 10000000.0); - cpi->level_constraint.rc_config_updated = 1; - } - if (img != NULL) { res = validate_img(ctx, img); if (res == VPX_CODEC_OK) {