ref: 37deb06700b5e68d8c79d74e50426d5b55fff590
parent: 844f88bbbea4d8cedfa268bfcc5d9bc8248cfc05
parent: 5e6ef1741270e6fb93a0f482bb443ff2810e696e
author: HaiboZhu <[email protected]>
date: Wed Apr 30 13:31:04 EDT 2014
Merge pull request #771 from huili2/newseqorder_prefixerror_bugfix fix new sequence&EC order, and prefix parse bug
--- a/codec/decoder/core/inc/nal_prefix.h
+++ b/codec/decoder/core/inc/nal_prefix.h
@@ -78,6 +78,7 @@
bool bStoreRefBasePicFlag;
bool bPrefixNalUnitAdditionalExtFlag;
bool bPrefixNalUnitExtFlag;
+ bool bPrefixNalCorrectFlag;
} SPrefixNalUnit, *PPrefixNalUnit;
} // namespace WelsDec
--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -188,12 +188,14 @@
PAccessUnit pCurAu = pCtx->pAccessUnitList;
uint32_t uiAvailNalNum = pCurAu->uiAvailUnitsNum;
- ForceClearCurrentNal (pCurAu);
- if (uiAvailNalNum > 1) {
- pCurAu->uiEndPos = uiAvailNalNum - 2;
- pCtx->bAuReadyFlag = true;
+ if (uiAvailNalNum > 0) {
+ pCurAu->uiEndPos = uiAvailNalNum - 1;
+ if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) {
+ pCtx->bAuReadyFlag = true;
+ }
}
+ pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = false;
return NULL;
}
@@ -204,12 +206,14 @@
pCurNal->sNalHeaderExt.uiQualityId, pCurNal->sNalHeaderExt.bUseRefBasePicFlag);
PAccessUnit pCurAu = pCtx->pAccessUnitList;
uint32_t uiAvailNalNum = pCurAu->uiAvailUnitsNum;
- ForceClearCurrentNal (pCurAu);
- if (uiAvailNalNum > 1) {
- pCurAu->uiEndPos = uiAvailNalNum - 2;
- pCtx->bAuReadyFlag = true;
+ if (uiAvailNalNum > 0) {
+ pCurAu->uiEndPos = uiAvailNalNum - 1;
+ if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) {
+ pCtx->bAuReadyFlag = true;
+ }
}
+ pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = false;
pCtx->iErrorCode |= dsInvalidArgument;
return NULL;
}
@@ -229,6 +233,7 @@
InitBits (pBs, pNal, iBitSize);
ParsePrefixNalUnit (pCtx, pBs);
+ pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = true;
break;
case NAL_UNIT_CODED_SLICE_EXT:
@@ -291,7 +296,9 @@
if (NAL_UNIT_PREFIX == pCtx->sPrefixNal.sNalHeaderExt.sNalUnitHeader.eNalUnitType) {
- PrefetchNalHeaderExtSyntax (pCtx, pCurNal, &pCtx->sPrefixNal);
+ if (pCtx->sPrefixNal.sNalData.sPrefixNal.bPrefixNalCorrectFlag) {
+ PrefetchNalHeaderExtSyntax (pCtx, pCurNal, &pCtx->sPrefixNal);
+ }
}
pCurNal->sNalHeaderExt.bIdrFlag = (NAL_UNIT_CODED_SLICE_IDR == pNalUnitHeader->eNalUnitType) ? true :
--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -481,8 +481,6 @@
return pCtx->iErrorCode;
}
}
- //Do error concealment here
- ImplementErrorCon (pCtx);
}
if (iRet) {
iRet = 0;
@@ -536,8 +534,6 @@
ResetParameterSetsState (pCtx);
return pCtx->iErrorCode;
}
- //Do error concealment here
- ImplementErrorCon (pCtx);
}
if (iRet) {
iRet = 0;
@@ -573,7 +569,6 @@
ResetParameterSetsState (pCtx);
return pCtx->iErrorCode;
}
- ImplementErrorCon (pCtx);
}
}
--- a/codec/decoder/core/src/decoder_core.cpp
+++ b/codec/decoder/core/src/decoder_core.cpp
@@ -1591,6 +1591,9 @@
iErr = DecodeCurrentAccessUnit (pCtx, ppDst, iStride, &iWidth, &iHeight, pDstInfo);
WelsDecodeAccessUnitEnd (pCtx);
+ //Do error concealment here
+ ImplementErrorCon (pCtx);
+
pCtx->bNewSeqBegin = false;
WriteBackActiveParameters(pCtx);
pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || pCtx->bNextNewSeqBegin;