]> granicus.if.org Git - libvpx/commitdiff
Remove bits_left update in encoder_encode()
authorangiebird <angiebird@google.com>
Wed, 30 Oct 2019 01:52:40 +0000 (18:52 -0700)
committerangiebird <angiebird@google.com>
Wed, 30 Oct 2019 01:52:40 +0000 (18:52 -0700)
It's already updated properly in vp9_init_second_pass()

Change-Id: I94ee2e8536387c94a2abf9a7686011c76489c2f9

vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/vp9_cx_iface.c

index d091a79b816f0b358ef67966a01cb7c05ba60a95..a511eca4ab297cc06ad0eea355e27df8cd591797 100644 (file)
@@ -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;
 }
 
index b0ea921ba61345b9dfa39bc71f829feb36ed8b4e..0de47e6e670bbf56064a298578053d0d9ab68054 100644 (file)
@@ -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
index d1cf5e7a316fb0f6e88bfa03a71fcd79207decf2..ccdf9f75f2011b26dd155b0aeadee7d8253c2200 100644 (file)
@@ -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) {