[x265] [PATCH] Fix decoder crash in scc
Anusuya Kumarasamy
anusuya.kumarasamy at multicorewareinc.com
Tue Oct 15 06:47:17 UTC 2024
>From 815a784c473b0d95498974228e60d1440316ea11 Mon Sep 17 00:00:00 2001
From: AnusuyaKumarasamy <anusuya.kumarasamy at multicorewareinc.com>
Date: Mon, 14 Oct 2024 13:11:47 +0530
Subject: [PATCH] Fix decoder crash in scc
---
source/common/slice.cpp | 2 +-
source/common/slice.h | 1 -
source/encoder/dpb.cpp | 41 --------------------------------------
source/encoder/entropy.cpp | 4 ----
4 files changed, 1 insertion(+), 47 deletions(-)
diff --git a/source/common/slice.cpp b/source/common/slice.cpp
index 5e5ad8a92..b5b5e815c 100644
--- a/source/common/slice.cpp
+++ b/source/common/slice.cpp
@@ -101,7 +101,7 @@ void Slice::setRefPicList(PicList& picList, int
sLayerId)
if (!checkNumPocTotalCurr && m_rps.numberOfPictures == 0)
{
Frame* prevPic = picList.getPOC(X265_MAX(0, m_poc - 1));
- if (prevPic->m_poc != X265_MAX(0, m_poc - 1))
+ if (prevPic && prevPic->m_poc != X265_MAX(0, m_poc - 1))
{
prevPic = picList.getPOC(m_poc);
diff --git a/source/common/slice.h b/source/common/slice.h
index 0d0b2efb4..08e2577c7 100644
--- a/source/common/slice.h
+++ b/source/common/slice.h
@@ -405,7 +405,6 @@ public:
#if ENABLE_SCC_EXT
Frame* m_lastEncPic;
- bool m_bLMvdL1Zero;
bool m_useIntegerMv;
#endif
bool m_bTemporalMvp;
diff --git a/source/encoder/dpb.cpp b/source/encoder/dpb.cpp
index ae26c5518..69f821aee 100644
--- a/source/encoder/dpb.cpp
+++ b/source/encoder/dpb.cpp
@@ -341,47 +341,6 @@ void DPB::prepareEncode(Frame *newFrame)
slice->m_bTemporalMvp = slice->m_sps->bTemporalMVPEnabled;
#if ENABLE_SCC_EXT
- bool bGPBcheck = false;
- if (slice->m_sliceType == B_SLICE)
- {
- if (slice->m_param->bEnableSCC)
- {
- if (slice->m_numRefIdx[0] - 1 == slice->m_numRefIdx[1])
- {
- bGPBcheck = true;
- for (int i = 0; i < slice->m_numRefIdx[1]; i++)
- {
- if (slice->m_refPOCList[1][i] !=
slice->m_refPOCList[0][i])
- {
- bGPBcheck = false;
- break;
- }
- }
- }
- }
- else if (slice->m_numRefIdx[0] == slice->m_numRefIdx[1])
- {
- bGPBcheck = true;
- int i;
- for (i = 0; i < slice->m_numRefIdx[1]; i++)
- {
- if (slice->m_refPOCList[1][i] != slice->m_refPOCList[0][i])
- {
- bGPBcheck = false;
- break;
- }
- }
- }
- }
- if (bGPBcheck)
- {
- slice->m_bLMvdL1Zero = true;
- }
- else
- {
- slice->m_bLMvdL1Zero = false;
- }
-
if (!slice->isIntra() && slice->m_param->bEnableTemporalMvp)
{
const Frame* colPic = slice->m_refFrameList[slice->isInterB() &&
!slice->m_colFromL0Flag][slice->m_colRefIdx];
diff --git a/source/encoder/entropy.cpp b/source/encoder/entropy.cpp
index 18978f26e..86a1d0c7d 100644
--- a/source/encoder/entropy.cpp
+++ b/source/encoder/entropy.cpp
@@ -1073,11 +1073,7 @@ void Entropy::codeSliceHeader(const Slice& slice,
FrameData& encData, uint32_t s
}
if (slice.isInterB())
-#if ENABLE_SCC_EXT
- WRITE_FLAG(slice.m_bLMvdL1Zero, "mvd_l1_zero_flag");
-#else
WRITE_FLAG(0, "mvd_l1_zero_flag");
-#endif
#if ENABLE_SCC_EXT
if (slice.m_bTemporalMvp)
--
2.36.0.windows.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241015/1a8a7d7e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-decoder-crash-in-scc.patch
Type: application/octet-stream
Size: 3493 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241015/1a8a7d7e/attachment.obj>
More information about the x265-devel
mailing list