aom: Fix keyframe logic for use_fast_part_feature for svc (aca92)

From aca92617cdb79a8ce5435c89edef221192abdc66 Mon Sep 17 00:00:00 2001
From: Marco Paniconi <[EMAIL REDACTED]>
Date: Thu, 4 Apr 2024 14:06:32 -0700
Subject: [PATCH] Fix keyframe logic for use_fast_part_feature for svc

This CL also fixes an issue with spatial layers
on key frames for the rtc_sf->use_fast_fixed_part feature:
avoid entering the fixed partition for layers whose base
is key frame.

Change-Id: I2adc953d8ac6467a7b5dd47b75f1a418b7f32006
(cherry picked from commit a30448b2b1f5faa58913033a4529b07666f0da34)
---
 av1/encoder/encodeframe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index a9214f77c..07382eb6c 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -537,7 +537,9 @@ static AOM_INLINE void encode_nonrd_sb(AV1_COMP *cpi, ThreadData *td,
   // Set the partition
   if (sf->part_sf.partition_search_type == FIXED_PARTITION || seg_skip ||
       (sf->rt_sf.use_fast_fixed_part && x->sb_force_fixed_part == 1 &&
-       !frame_is_intra_only(cm))) {
+       (!frame_is_intra_only(cm) &&
+        (!cpi->ppi->use_svc ||
+         !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame)))) {
     // set a fixed-size partition
     av1_set_offsets(cpi, tile_info, x, mi_row, mi_col, sb_size);
     BLOCK_SIZE bsize_select = sf->part_sf.fixed_partition_size;