From a599dc7f5ec3ca9314d78896650b80519a9d6fea Mon Sep 17 00:00:00 2001 From: WangLuyue Date: Tue, 6 Aug 2024 16:06:40 +0800 Subject: [PATCH] [Encode] memset EncodedBitstreamWrittenBytesCount metadata for av1 To prevent the app from not updating the metadata buffer, add a handle to the media driver. --- .../codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp b/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp index 1363ce01a93..d41c8aaab94 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/av1/packet/encode_av1_vdenc_packet.cpp @@ -1887,8 +1887,13 @@ namespace encode{ m_basicFeature->m_numSlices = tileNum; auto &miCpyMemMemParams = m_miItf->MHW_GETPAR_F(MI_COPY_MEM_MEM)(); auto &storeDataParams = m_miItf->MHW_GETPAR_F(MI_STORE_DATA_IMM)(); + + //memeset EncodedBitstreamWrittenBytesCount storeDataParams = {}; storeDataParams.pOsResource = m_basicFeature->m_resMetadataBuffer; + storeDataParams.dwResourceOffset = resourceOffset.dwEncodedBitstreamWrittenBytesCount; + storeDataParams.dwValue = 0; + ENCODE_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_STORE_DATA_IMM)(cmdBuffer)); for (uint32_t tileIdx = 0; tileIdx < tileNum; tileIdx++) {