Properly determine end of sequence
authorCheng Chen <chengchen@google.com>
Fri, 29 Sep 2023 00:47:54 +0000 (17:47 -0700)
committerCheng Chen <chengchen@google.com>
Fri, 29 Sep 2023 01:36:21 +0000 (18:36 -0700)
When the next frame is null and the current frame is an overlay
frame, which is equivalent to there is an active alt ref frame,
we call this an end of sequence.

Change-Id: I49c2cf7a001df98aff8b62ba034317e408274bd4

test/vp9_ext_ratectrl_test.cc
vp9/encoder/vp9_firstpass.c

index b434305..33fa05c 100644 (file)
@@ -338,7 +338,7 @@ vpx_rc_status_t rc_get_encodeframe_decision_gop_short(
     EXPECT_EQ(encode_frame_info->show_index, 3);
     EXPECT_EQ(encode_frame_info->gop_index, 0);
     EXPECT_EQ(encode_frame_info->frame_type, vp9::kFrameTypeGolden);
-    EXPECT_EQ(toy_rate_ctrl->gop_global_index, 1);
+    EXPECT_EQ(toy_rate_ctrl->gop_global_index, 2);
   }
 
   // When the model recommends an invalid q, valid range [0, 255],
index 3ec7ba5..a9cdf53 100644 (file)
@@ -2530,7 +2530,7 @@ static int get_gop_coding_frame_num(
     next_frame = fps_get_frame_stats(first_pass_info,
                                      gf_start_show_idx + gop_coding_frames);
     if (next_frame == NULL) {
-      *end_of_sequence = (gop_coding_frames == 1);
+      *end_of_sequence = gop_coding_frames == 1 && rc->source_alt_ref_active;
       break;
     }