summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/mediasdk/files/0001-hevcd-Enable-the-SPS-PPS-error-reporting.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-multimedia/mediasdk/files/0001-hevcd-Enable-the-SPS-PPS-error-reporting.patch')
-rw-r--r--recipes-multimedia/mediasdk/files/0001-hevcd-Enable-the-SPS-PPS-error-reporting.patch139
1 files changed, 0 insertions, 139 deletions
diff --git a/recipes-multimedia/mediasdk/files/0001-hevcd-Enable-the-SPS-PPS-error-reporting.patch b/recipes-multimedia/mediasdk/files/0001-hevcd-Enable-the-SPS-PPS-error-reporting.patch
deleted file mode 100644
index f980c4b..0000000
--- a/recipes-multimedia/mediasdk/files/0001-hevcd-Enable-the-SPS-PPS-error-reporting.patch
+++ /dev/null
@@ -1,139 +0,0 @@
1From ee1b87d107833e8803567cac438f55bde72d8e02 Mon Sep 17 00:00:00 2001
2From: "Ung, Teng En" <teng.en.ung@intel.com>
3Date: Mon, 30 Mar 2020 13:40:39 +0000
4Subject: [PATCH 1/2] [hevcd] Enable the SPS/PPS error reporting
5
6Issue:N/A
7Test:sample_decode with mfxExtDecodeErrorReport
8
9Upstream-Status: Accepted [https://github.com/Intel-Media-SDK/MediaSDK/pull/2383]
10
11Signed-off-by: Ung, Teng En <teng.en.ung@intel.com>
12---
13 .../decode/h265/src/mfx_h265_dec_decode.cpp | 10 ++++++
14 .../umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp | 7 ++++
15 .../codec/h265_dec/src/umc_h265_task_supplier.cpp | 41 +++++++++++++++++++++-
16 3 files changed, 57 insertions(+), 1 deletion(-)
17
18diff --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
19index 4ae164f..f346e8c 100644
20--- a/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
21+++ b/_studio/mfx_lib/decode/h265/src/mfx_h265_dec_decode.cpp
22@@ -1105,6 +1105,16 @@ mfxStatus VideoDECODEH265::DecodeFrameCheck(mfxBitstream *bs, mfxFrameSurface1 *
23
24 MFXMediaDataAdapter src(bs);
25
26+#if (MFX_VERSION >= 1025)
27+ mfxExtBuffer* extbuf = (bs) ? GetExtendedBuffer(bs->ExtParam, bs->NumExtParam, MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
28+
29+ if (extbuf)
30+ {
31+ ((mfxExtDecodeErrorReport *)extbuf)->ErrorTypes = 0;
32+ src.SetExtBuffer(extbuf);
33+ }
34+#endif
35+
36 for (;;)
37 {
38 if (m_FrameAllocator->FindFreeSurface() == -1)
39diff --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
40index 4cc5dd5..db876f4 100644
41--- a/_studio/shared/umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp
42+++ b/_studio/shared/umc/codec/h265_dec/src/umc_h265_mfx_utils.cpp
43@@ -488,6 +488,13 @@ UMC::Status HeadersAnalyzer::DecodeHeader(UMC::MediaData * data, mfxBitstream *b
44 H265SeqParamSet* first_sps = 0;
45 notifier0<H265SeqParamSet> sps_guard(&H265Slice::DecrementReference);
46
47+#if (MFX_VERSION >= 1025)
48+ mfxExtBuffer* extbuf = (bs) ? GetExtendedBuffer(bs->ExtParam, bs->NumExtParam, MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
49+
50+ if (extbuf)
51+ data->SetAuxInfo(extbuf, extbuf->BufferSz, extbuf->BufferId);
52+#endif
53+
54 UMC::Status umcRes = UMC::UMC_ERR_NOT_ENOUGH_DATA;
55 for ( ; data->GetDataSize() > 3; )
56 {
57diff --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
58index 9062568..e220095 100755
59--- a/_studio/shared/umc/codec/h265_dec/src/umc_h265_task_supplier.cpp
60+++ b/_studio/shared/umc/codec/h265_dec/src/umc_h265_task_supplier.cpp
61@@ -47,6 +47,21 @@
62 namespace UMC_HEVC_DECODER
63 {
64
65+#if (MFX_VERSION >= 1025)
66+inline void SetDecodeErrorTypes(NalUnitType nalUnit, mfxExtDecodeErrorReport *pDecodeErrorReport)
67+{
68+ if (!pDecodeErrorReport)
69+ return;
70+
71+ switch (nalUnit)
72+ {
73+ case NAL_UT_SPS: pDecodeErrorReport->ErrorTypes |= MFX_ERROR_SPS; break;
74+ case NAL_UT_PPS: pDecodeErrorReport->ErrorTypes |= MFX_ERROR_PPS; break;
75+ default: break;
76+ };
77+}
78+#endif
79+
80 const uint32_t levelIndexArray[] = {
81 H265_LEVEL_1,
82 H265_LEVEL_2,
83@@ -1662,6 +1677,15 @@ UMC::Status TaskSupplier_H265::ProcessNalUnit(UMC::MediaDataEx *nalUnit)
84 case NAL_UT_SPS:
85 case NAL_UT_PPS:
86 umcRes = DecodeHeaders(nalUnit);
87+ {
88+#if (MFX_VERSION >= 1025)
89+ UMC::MediaData::AuxInfo* aux = (nalUnit) ? nalUnit->GetAuxInfo(MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
90+ mfxExtDecodeErrorReport* pDecodeErrorReport = (aux) ? reinterpret_cast<mfxExtDecodeErrorReport*>(aux->ptr) : NULL;
91+ if (pDecodeErrorReport && umcRes == UMC::UMC_ERR_INVALID_STREAM)
92+ SetDecodeErrorTypes(unitType, pDecodeErrorReport);
93+#endif
94+ }
95+
96 break;
97
98 case NAL_UT_SEI:
99@@ -1703,6 +1727,11 @@ UMC::Status TaskSupplier_H265::AddOneFrame(UMC::MediaData * pSource)
100
101 UMC::MediaDataEx::_MediaDataEx* pMediaDataEx = nalUnit->GetExData();
102
103+#if (MFX_VERSION >= 1025)
104+ UMC::MediaData::AuxInfo* aux = (pSource) ? pSource->GetAuxInfo(MFX_EXTBUFF_DECODE_ERROR_REPORT) : NULL;
105+ mfxExtDecodeErrorReport* pDecodeErrorReport = (aux) ? reinterpret_cast<mfxExtDecodeErrorReport*>(aux->ptr) : NULL;
106+#endif
107+
108 for (int32_t i = 0; i < (int32_t)pMediaDataEx->count; i++, pMediaDataEx->index ++)
109 {
110 if (m_checkCRAInsideResetProcess)
111@@ -1755,7 +1784,13 @@ UMC::Status TaskSupplier_H265::AddOneFrame(UMC::MediaData * pSource)
112 case NAL_UT_VPS:
113 case NAL_UT_SPS:
114 case NAL_UT_PPS:
115- DecodeHeaders(nalUnit);
116+ {
117+ UMC::Status sts = DecodeHeaders(nalUnit);
118+#if (MFX_VERSION >= 1025)
119+ if (pDecodeErrorReport && sts == UMC::UMC_ERR_INVALID_STREAM)
120+ SetDecodeErrorTypes((NalUnitType)pMediaDataEx->values[i], pDecodeErrorReport);
121+#endif
122+ }
123 break;
124
125 default:
126@@ -1822,6 +1857,10 @@ UMC::Status TaskSupplier_H265::AddOneFrame(UMC::MediaData * pSource)
127 moveToSpsOffset = pSource->GetDataSize() + size + 3;
128 continue;
129 }
130+#if (MFX_VERSION >= 1025)
131+ if (pDecodeErrorReport && umsRes == UMC::UMC_ERR_INVALID_STREAM)
132+ SetDecodeErrorTypes(nut, pDecodeErrorReport);
133+#endif
134
135 return umsRes;
136 }
137--
1382.7.4
139