From 020ae63f2b13bed43ab4184d5b589459ee5cf8ef Mon Sep 17 00:00:00 2001 From: Chen_Hao5 Date: Tue, 19 Nov 2024 14:40:32 +0800 Subject: [PATCH] [Encode] Fix AV1 Encode SW BRC and Real BRC Output Mismatch Issue Driver mistokenly submits wrong BRC frame type to HuC and causing HuC outputs mismatch bitstreams. This patch is to fix this issue by checking unsupported frame type before submitting to HuC. --- .../common/codec/hal/enc/av1/features/encode_av1_brc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_brc.cpp b/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_brc.cpp index 5f31f0346fe..2af16e75d72 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_brc.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/av1/features/encode_av1_brc.cpp @@ -252,9 +252,10 @@ namespace encode dmem->UPD_CurrFrameType = hierchLevelPlus1_to_brclevel.count(picParams->HierarchLevelPlus1) ? hierchLevelPlus1_to_brclevel[picParams->HierarchLevelPlus1] : AV1_BRC_FRAME_TYPE_INVALID; //Invalid HierarchLevelPlus1 or LBD frames at level 3 eror check. if ((dmem->UPD_CurrFrameType == AV1_BRC_FRAME_TYPE_INVALID) || - (m_basicFeature->m_ref.IsLowDelay() && dmem->UPD_CurrFrameType == AV1_BRC_FRAME_TYPE_B2)) + (m_basicFeature->m_ref.IsLowDelay() && dmem->UPD_CurrFrameType == AV1_BRC_FRAME_TYPE_B2) || + (m_rcMode != RATECONTROL_CQL && dmem->UPD_CurrFrameType == AV1_BRC_FRAME_TYPE_B3)) { - ENCODE_VERBOSEMESSAGE("AV1_BRC_FRAME_TYPE_INVALID or LBD picture doesn't support Level 4\n"); + ENCODE_VERBOSEMESSAGE("AV1_BRC_FRAME_TYPE_INVALID or LBD picture doesn't support Level 4, or AV1_BRC_FRAME_TYPE_B3 only supported in RATECONTROL_CQL mode\n"); dmem->UPD_CurrFrameType = AV1_BRC_FRAME_TYPE_B2; } }