From 25f0d3d9f1289a04171d47bba48e6e2a72fc4183 Mon Sep 17 00:00:00 2001
From: Marco Paniconi <[EMAIL REDACTED]>
Date: Thu, 11 Jul 2024 14:18:22 -0700
Subject: [PATCH] rtc: Avoid the qp adjustment on TL0 for key frames
The adjustment was meant for delta frames.
Change-Id: I3be09592535943e93cbb36db17d92fe94299ee7d
---
av1/encoder/ratectrl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index c5b67ba3b..4d9af471d 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -660,7 +660,7 @@ static int adjust_q_cbr(const AV1_COMP *cpi, int q, int active_worst_quality,
if (rc->avg_frame_bandwidth < lc->rc.avg_frame_bandwidth &&
q < last_qindex_tl0 - 4)
q = last_qindex_tl0 - 4;
- } else if (cpi->svc.temporal_layer_id == 0 &&
+ } else if (cpi->svc.temporal_layer_id == 0 && !frame_is_intra_only(cm) &&
p_rc->buffer_level > (p_rc->optimal_buffer_level >> 2) &&
rc->frame_source_sad < 100000) {
// Push base TL0 Q down if buffer is stable and frame_source_sad