Commit 6269d4011a for aom
commit 6269d4011a47e6821b4a6d815d83461e1234d351
Author: Wan-Teh Chang <wtc@google.com>
Date: Mon Jan 5 13:59:37 2026 -0800
Remove the if and else in update_gf_group_index()
The if and else branches are identical, so we can remove the if and
else.
Fixes Coverity defect CID 556348 (Identical code for different
branches).
Change-Id: Ie22eab968e2b834458e4fed2751f449a6649a469
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 08433d1bad..56591c3c0b 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -5039,20 +5039,10 @@ static inline void update_frames_till_gf_update(AV1_COMP *cpi) {
static inline void update_gf_group_index(AV1_COMP *cpi) {
// Increment the gf group index ready for the next frame.
- if (is_one_pass_rt_params(cpi) &&
- cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) {
- ++cpi->gf_frame_index;
- // Reset gf_frame_index in case it reaches MAX_STATIC_GF_GROUP_LENGTH
- // for real time encoding.
- if (cpi->gf_frame_index == MAX_STATIC_GF_GROUP_LENGTH)
- cpi->gf_frame_index = 0;
- } else {
- ++cpi->gf_frame_index;
- // In rare cases, the gop size can be MAX_STATIC_GF_GROUP_LENGTH for VOD
- // encoding. Need to reset this to 0 for the following gop.
- if (cpi->gf_frame_index == MAX_STATIC_GF_GROUP_LENGTH)
- cpi->gf_frame_index = 0;
- }
+ ++cpi->gf_frame_index;
+ // Reset gf_frame_index in case it reaches MAX_STATIC_GF_GROUP_LENGTH.
+ if (cpi->gf_frame_index == MAX_STATIC_GF_GROUP_LENGTH)
+ cpi->gf_frame_index = 0;
}
static void update_fb_of_context_type(const AV1_COMP *const cpi,