From 390884a0965048a265c0d2071a8667529c77acd7 Mon Sep 17 00:00:00 2001 From: DaShi Date: Wed, 6 Sep 2023 16:10:07 +0800 Subject: [PATCH] [Encode] fixing vp8 cqp issue fixing vp8 cqp issue. --- .../common/codec/hal/codechal_encode_vp8.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/media_driver/agnostic/common/codec/hal/codechal_encode_vp8.cpp b/media_driver/agnostic/common/codec/hal/codechal_encode_vp8.cpp index 3d06af3af5a..e9adb6c5ed4 100644 --- a/media_driver/agnostic/common/codec/hal/codechal_encode_vp8.cpp +++ b/media_driver/agnostic/common/codec/hal/codechal_encode_vp8.cpp @@ -1287,11 +1287,18 @@ MOS_STATUS CodechalEncodeVp8::SetPictureStructs() else { m_averagePFrameQp = averageQp; - if (m_vp8SeqParams->GopPicSize == 0) + if (m_vp8SeqParams->RateControlMethod == RATECONTROL_CQP) { - return MOS_STATUS_INVALID_PARAMETER; + m_pFramePositionInGop = 0; + } + else + { + if (m_vp8SeqParams->GopPicSize == 0) + { + return MOS_STATUS_INVALID_PARAMETER; + } + m_pFramePositionInGop = (m_storeData - 1) % m_vp8SeqParams->GopPicSize; } - m_pFramePositionInGop = m_vp8SeqParams->RateControlMethod == RATECONTROL_CQP ? 0 : (m_storeData - 1) % m_vp8SeqParams->GopPicSize; } numRef = 0;