Merge pull request #1559 from HaiboZhu/EC_off_crash_no_output

Debug for (1) decoder crash when delay decoding (2) no output when EC off
This commit is contained in:
zhilwang 2014-11-27 14:21:48 +08:00
commit 3a73179cab
5 changed files with 8 additions and 36 deletions

View File

@ -132,8 +132,6 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi
void AssignFuncPointerForRec (PWelsDecoderContext pCtx);
void ResetParameterSetsState (PWelsDecoderContext pCtx);
void GetVclNalTemporalId (PWelsDecoderContext pCtx); //get the info that whether or not have VCL NAL in current AU,
//and if YES, get the temporal ID

View File

@ -791,6 +791,14 @@ bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps) {
if (pCtx->pActiveLayerSps[i] == pSps)
return true;
}
// Pre-active, will be used soon
if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSpsAvailFlags[pSps->iSpsId]
&& pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
PSps pNextUsedSps =
pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
if (pNextUsedSps->iSpsId == pSps->iSpsId)
return true;
}
return false;
}

View File

@ -502,9 +502,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
ResetParameterSetsState (pCtx);
if (dsOutOfMemory & pCtx->iErrorCode) {
return pCtx->iErrorCode;
}
@ -518,8 +515,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
ResetParameterSetsState (pCtx);
}
return pCtx->iErrorCode;
}
@ -563,8 +558,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
ResetParameterSetsState (pCtx);
return pCtx->iErrorCode;
}
}
@ -576,7 +569,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
ResetParameterSetsState (pCtx);
}
return pCtx->iErrorCode;
}
@ -598,8 +590,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if ((pCtx->eErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
ResetParameterSetsState (pCtx);
return pCtx->iErrorCode;
}
}

View File

@ -156,13 +156,6 @@ inline void HandleReferenceLostL0 (PWelsDecoderContext pCtx, PNalUnit pCurNal
if (0 == pCurNal->sNalHeaderExt.uiTemporalId) {
pCtx->bReferenceLostAtT0Flag = true;
}
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) {
#ifndef LONG_TERM_REF
if (pCtx->bReferenceLostAtT0Flag) {
ResetParameterSetsState (pCtx);
}
#endif
}
pCtx->iErrorCode |= dsBitstreamError;
}
@ -170,13 +163,6 @@ inline void HandleReferenceLost (PWelsDecoderContext pCtx, PNalUnit pCurNal)
if ((0 == pCurNal->sNalHeaderExt.uiTemporalId) || (1 == pCurNal->sNalHeaderExt.uiTemporalId)) {
pCtx->bReferenceLostAtT0Flag = true;
}
if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) {
#ifndef LONG_TERM_REF
if (pCtx->bReferenceLostAtT0Flag) {
ResetParameterSetsState (pCtx);
}
#endif
}
pCtx->iErrorCode |= dsRefLost;
}
@ -1883,14 +1869,6 @@ void InitCurDqLayerData (PWelsDecoderContext pCtx, PDqLayer pCurDq) {
}
}
// added to reset state of parameter sets to waiting successive incoming IDR, 6/4/2010
// It will be called in case packets lost/ broken and decoded failed at temporal level 0
void ResetParameterSetsState (PWelsDecoderContext pCtx) {
pCtx->bSpsExistAheadFlag = false;
pCtx->bSubspsExistAheadFlag = false;
pCtx->bPpsExistAheadFlag = false;
}
/*
* DecodeCurrentAccessUnit
* Decode current access unit when current AU is completed.
@ -2028,7 +2006,6 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
ResetParameterSetsState (pCtx);
return ERR_INFO_REFERENCE_PIC_LOST;
}
}

View File

@ -447,7 +447,6 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc,
#else
m_pDecContext->bReferenceLostAtT0Flag = true;
#endif
ResetParameterSetsState (m_pDecContext); //initial SPS&PPS ready flag
}
}