From fd2052d4c91ca9451563482817bbeab1da3f76e7 Mon Sep 17 00:00:00 2001 From: Cheng Chen Date: Thu, 28 Sep 2023 17:47:54 -0700 Subject: [PATCH] Properly determine end of sequence 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 | 2 +- vp9/encoder/vp9_firstpass.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/vp9_ext_ratectrl_test.cc b/test/vp9_ext_ratectrl_test.cc index b434305..33fa05c 100644 --- a/test/vp9_ext_ratectrl_test.cc +++ b/test/vp9_ext_ratectrl_test.cc @@ -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], diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 3ec7ba5..a9cdf53 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -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; } -- 2.7.4