]> granicus.if.org Git - libvpx/commitdiff
Init static_scene_max_gf_interval in vp9_rc_init()
authorangiebird <angiebird@google.com>
Tue, 26 May 2020 21:44:10 +0000 (14:44 -0700)
committerangiebird <angiebird@google.com>
Wed, 27 May 2020 06:31:14 +0000 (23:31 -0700)
Change-Id: I2cad885fac2fd5f3e84d02b905a2ce59eb66760e

vp9/encoder/vp9_firstpass.c
vp9/encoder/vp9_ratectrl.c

index 88c3e84bff1271f06f8d5e1d2503a6c57cd8bcd6..4bb58ecf4cf9e20a60c06bdbe15cc2107c079bce 100644 (file)
@@ -3771,7 +3771,6 @@ int vp9_get_coding_frame_num(const VP9EncoderConfig *oxcf,
   int show_idx = 0;
   int last_gop_use_alt_ref = 0;
   vp9_rc_init(oxcf, 1, &rc);
-  rc.static_scene_max_gf_interval = 250;
 
   while (show_idx < first_pass_info->num_frames) {
     int use_alt_ref;
index 4da50379b428c75f00e997dcdd7cfcdf7b08f971..2d03bad4d5095700e9197de1b501279e9e7b3892 100644 (file)
@@ -431,6 +431,11 @@ void vp9_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
     rc->max_gf_interval = vp9_rc_get_default_max_gf_interval(
         oxcf->init_framerate, rc->min_gf_interval);
   rc->baseline_gf_interval = (rc->min_gf_interval + rc->max_gf_interval) / 2;
+  if ((oxcf->pass == 0) && (oxcf->rc_mode == VPX_Q)) {
+    rc->static_scene_max_gf_interval = FIXED_GF_INTERVAL;
+  } else {
+    rc->static_scene_max_gf_interval = MAX_STATIC_GF_GROUP_LENGTH;
+  }
 
   rc->force_max_q = 0;
   rc->last_post_encode_dropped_scene_change = 0;