mirror of
git://git.yoctoproject.org/meta-intel.git
synced 2025-07-19 12:59:03 +02:00
intel-mediasdk: Enable the SPS/PPS error reporting on hevcd
These patches are merged into upstream. Will need to remove once update to version later than 21.1.2. Signed-off-by: Ung, Teng En <teng.en.ung@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
parent
e4ccee0047
commit
850940e3e5
|
@ -0,0 +1,139 @@
|
|||
From ee1b87d107833e8803567cac438f55bde72d8e02 Mon Sep 17 00:00:00 2001
|
||||
From: "Ung, Teng En" <teng.en.ung@intel.com>
|
||||
Date: Mon, 30 Mar 2020 13:40:39 +0000
|
||||
Subject: [PATCH 1/2] [hevcd] Enable the SPS/PPS error reporting
|
||||
|
||||
Issue:N/A
|
||||
Test:sample_decode with mfxExtDecodeErrorReport
|
||||
|
||||
Upstream-Status: Accepted [https://github.com/Intel-Media-SDK/MediaSDK/pull/2383]
|
||||
|
||||
Signed-off-by: Ung, Teng En <teng.en.ung@intel.com>
|
||||
---
|
||||
.../decode/h265/src/mfx_h265_dec_decode.cpp | 10 ++++++
|
||||
.../umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp | 7 ++++
|
||||
.../codec/h265_dec/src/umc_h265_task_supplier.cpp | 41 +++++++++++++++++++++-
|
||||
3 files changed, 57 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp b/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
|
||||
index 4ae164f..f346e8c 100644
|
||||
--- a/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
|
||||
+++ b/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
|
||||
@@ -1105,6 +1105,16 @@ mfxStatus VideoDECODEH265::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1 *
|
||||
|
||||
MFXMediaDataAdapter src(bs);
|
||||
|
||||
+#if (MFX_VERSION >= 1025)
|
||||
+ mfxExtBuffer* extbuf = (bs) ? GetExtendedBuffer(bs->ExtParam, bs->NumExtParam, MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
|
||||
+
|
||||
+ if (extbuf)
|
||||
+ {
|
||||
+ ((mfxExtDecodeErrorReport *)extbuf)->ErrorTypes = 0;
|
||||
+ src.SetExtBuffer(extbuf);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
for (;;)
|
||||
{
|
||||
if (m_FrameAllocator->FindFreeSurface() == -1)
|
||||
diff --git a/_studio/shared/umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp b/_studio/shared/umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp
|
||||
index 4cc5dd5..db876f4 100644
|
||||
--- a/_studio/shared/umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp
|
||||
+++ b/_studio/shared/umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp
|
||||
@@ -488,6 +488,13 @@ UMC::Status HeadersAnalyzer::DecodeHeader(UMC::MediaData * data, mfxBitstream *b
|
||||
H265SeqParamSet* first_sps = 0;
|
||||
notifier0<H265SeqParamSet> sps_guard(&H265Slice::DecrementReference);
|
||||
|
||||
+#if (MFX_VERSION >= 1025)
|
||||
+ mfxExtBuffer* extbuf = (bs) ? GetExtendedBuffer(bs->ExtParam, bs->NumExtParam, MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
|
||||
+
|
||||
+ if (extbuf)
|
||||
+ data->SetAuxInfo(extbuf, extbuf->BufferSz, extbuf->BufferId);
|
||||
+#endif
|
||||
+
|
||||
UMC::Status umcRes = UMC::UMC_ERR_NOT_ENOUGH_DATA;
|
||||
for ( ; data->GetDataSize() > 3; )
|
||||
{
|
||||
diff --git a/_studio/shared/umc/codec/h265_dec/src/umc_h265_task_supplier.cpp b/_studio/shared/umc/codec/h265_dec/src/umc_h265_task_supplier.cpp
|
||||
index 9062568..e220095 100755
|
||||
--- a/_studio/shared/umc/codec/h265_dec/src/umc_h265_task_supplier.cpp
|
||||
+++ b/_studio/shared/umc/codec/h265_dec/src/umc_h265_task_supplier.cpp
|
||||
@@ -47,6 +47,21 @@
|
||||
namespace UMC_HEVC_DECODER
|
||||
{
|
||||
|
||||
+#if (MFX_VERSION >= 1025)
|
||||
+inline void SetDecodeErrorTypes(NalUnitType nalUnit, mfxExtDecodeErrorReport *pDecodeErrorReport)
|
||||
+{
|
||||
+ if (!pDecodeErrorReport)
|
||||
+ return;
|
||||
+
|
||||
+ switch (nalUnit)
|
||||
+ {
|
||||
+ case NAL_UT_SPS: pDecodeErrorReport->ErrorTypes |= MFX_ERROR_SPS; break;
|
||||
+ case NAL_UT_PPS: pDecodeErrorReport->ErrorTypes |= MFX_ERROR_PPS; break;
|
||||
+ default: break;
|
||||
+ };
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
const uint32_t levelIndexArray[] = {
|
||||
H265_LEVEL_1,
|
||||
H265_LEVEL_2,
|
||||
@@ -1662,6 +1677,15 @@ UMC::Status TaskSupplier_H265::ProcessNalUnit(UMC::MediaDataEx *nalUnit)
|
||||
case NAL_UT_SPS:
|
||||
case NAL_UT_PPS:
|
||||
umcRes = DecodeHeaders(nalUnit);
|
||||
+ {
|
||||
+#if (MFX_VERSION >= 1025)
|
||||
+ UMC::MediaData::AuxInfo* aux = (nalUnit) ? nalUnit->GetAuxInfo(MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
|
||||
+ mfxExtDecodeErrorReport* pDecodeErrorReport = (aux) ? reinterpret_cast<mfxExtDecodeErrorReport*>(aux->ptr) : NULL;
|
||||
+ if (pDecodeErrorReport && umcRes == UMC::UMC_ERR_INVALID_STREAM)
|
||||
+ SetDecodeErrorTypes(unitType, pDecodeErrorReport);
|
||||
+#endif
|
||||
+ }
|
||||
+
|
||||
break;
|
||||
|
||||
case NAL_UT_SEI:
|
||||
@@ -1703,6 +1727,11 @@ UMC::Status TaskSupplier_H265::AddOneFrame(UMC::MediaData * pSource)
|
||||
|
||||
UMC::MediaDataEx::_MediaDataEx* pMediaDataEx = nalUnit->GetExData();
|
||||
|
||||
+#if (MFX_VERSION >= 1025)
|
||||
+ UMC::MediaData::AuxInfo* aux = (pSource) ? pSource->GetAuxInfo(MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
|
||||
+ mfxExtDecodeErrorReport* pDecodeErrorReport = (aux) ? reinterpret_cast<mfxExtDecodeErrorReport*>(aux->ptr) : NULL;
|
||||
+#endif
|
||||
+
|
||||
for (int32_t i = 0; i < (int32_t)pMediaDataEx->count; i++, pMediaDataEx->index ++)
|
||||
{
|
||||
if (m_checkCRAInsideResetProcess)
|
||||
@@ -1755,7 +1784,13 @@ UMC::Status TaskSupplier_H265::AddOneFrame(UMC::MediaData * pSource)
|
||||
case NAL_UT_VPS:
|
||||
case NAL_UT_SPS:
|
||||
case NAL_UT_PPS:
|
||||
- DecodeHeaders(nalUnit);
|
||||
+ {
|
||||
+ UMC::Status sts = DecodeHeaders(nalUnit);
|
||||
+#if (MFX_VERSION >= 1025)
|
||||
+ if (pDecodeErrorReport && sts == UMC::UMC_ERR_INVALID_STREAM)
|
||||
+ SetDecodeErrorTypes((NalUnitType)pMediaDataEx->values[i], pDecodeErrorReport);
|
||||
+#endif
|
||||
+ }
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1822,6 +1857,10 @@ UMC::Status TaskSupplier_H265::AddOneFrame(UMC::MediaData * pSource)
|
||||
moveToSpsOffset = pSource->GetDataSize() + size + 3;
|
||||
continue;
|
||||
}
|
||||
+#if (MFX_VERSION >= 1025)
|
||||
+ if (pDecodeErrorReport && umsRes == UMC::UMC_ERR_INVALID_STREAM)
|
||||
+ SetDecodeErrorTypes(nut, pDecodeErrorReport);
|
||||
+#endif
|
||||
|
||||
return umsRes;
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
From d1938a90c7e09f6c901b7ef556bd3e8c33a257aa Mon Sep 17 00:00:00 2001
|
||||
From: "Ung, Teng En" <teng.en.ung@intel.com>
|
||||
Date: Tue, 19 Jan 2021 15:31:24 +0800
|
||||
Subject: [PATCH 2/2] [hevcd] Use reinterpret_cast for style alignment.
|
||||
|
||||
Upstream-Status: Accepted [https://github.com/Intel-Media-SDK/MediaSDK/pull/2383]
|
||||
Signed-off-by: Ung, Teng En <teng.en.ung@intel.com>
|
||||
---
|
||||
_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp b/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
|
||||
index f346e8c..3069f04 100644
|
||||
--- a/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
|
||||
+++ b/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
|
||||
@@ -1110,7 +1110,7 @@ mfxStatus VideoDECODEH265::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1 *
|
||||
|
||||
if (extbuf)
|
||||
{
|
||||
- ((mfxExtDecodeErrorReport *)extbuf)->ErrorTypes = 0;
|
||||
+ reinterpret_cast<mfxExtDecodeErrorReport *>(extbuf)->ErrorTypes = 0;
|
||||
src.SetExtBuffer(extbuf);
|
||||
}
|
||||
#endif
|
||||
--
|
||||
2.7.4
|
||||
|
|
@ -33,6 +33,8 @@ PACKAGECONFIG[wayland] = "-DENABLE_WAYLAND=ON, -DENABLE_WAYLAND=OFF, wayland way
|
|||
|
||||
SRC_URI = "git://github.com/Intel-Media-SDK/MediaSDK.git;protocol=https;nobranch=1;lfs=0 \
|
||||
file://0001-FindITT.cmake-fix-detection-of-header-library.patch \
|
||||
file://0001-hevcd-Enable-the-SPS-PPS-error-reporting.patch \
|
||||
file://0002-hevcd-Use-reinterpret_cast-for-style-alignment.patch \
|
||||
"
|
||||
|
||||
SRCREV = "c982e8cccc98c2ad0b3c6043cdbd6aaf7447cf54"
|
||||
|
|
Loading…
Reference in New Issue
Block a user