overwriteactivesps

This commit is contained in:
Licai Guo
2014-04-16 18:27:08 -07:00
parent f141bd6170
commit 79ed744923
4 changed files with 114 additions and 51 deletions

View File

@@ -61,7 +61,7 @@ extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth
extern void FreePicture (PPicture pPic);
inline void GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
ST32(pDstNal, iDdstIdx);
ST32 (pDstNal, iDdstIdx);
}
static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize,
@@ -421,7 +421,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
int32_t iSrcConsumed = 0; // consumed bit count of source bs
int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal
int32_t iSrcLength = 0; //the total size of current AU or NAL
int32_t iRet = 0;
int32_t iConsumedBytes = 0;
int32_t iOffset = 0;
@@ -461,7 +461,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
iConsumedBytes = 0;
pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes);
}
if (pCtx->bAuReadyFlag) {
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
@@ -480,20 +482,17 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
//Do error concealment here
ImplementErrorCon (pCtx);
}
if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) &&
pNalPayload) {
if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) {
if (dsNoParamSets & pCtx->iErrorCode) {
if (iRet) {
iRet = 0;
if (dsNoParamSets & pCtx->iErrorCode) {
#ifdef LONG_TERM_REF
pCtx->bParamSetsLostFlag = true;
pCtx->bParamSetsLostFlag = true;
#else
pCtx->bReferenceLostAtT0Flag = true;
pCtx->bReferenceLostAtT0Flag = true;
#endif
ResetParameterSetsState (pCtx);
}
return pCtx->iErrorCode;
ResetParameterSetsState (pCtx);
}
return pCtx->iErrorCode;
}
pDstNal += iDstIdx; //update current position
@@ -520,7 +519,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
iConsumedBytes = 0;
pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes);
}
if (pCtx->bAuReadyFlag) {
ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
@@ -536,22 +537,18 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
//Do error concealment here
ImplementErrorCon (pCtx);
}
if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType))
&& pNalPayload) {
if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) {
if (dsNoParamSets & pCtx->iErrorCode) {
if (iRet) {
iRet = 0;
if (dsNoParamSets & pCtx->iErrorCode) {
#ifdef LONG_TERM_REF
pCtx->bParamSetsLostFlag = true;
pCtx->bParamSetsLostFlag = true;
#else
pCtx->bReferenceLostAtT0Flag = true;
pCtx->bReferenceLostAtT0Flag = true;
#endif
ResetParameterSetsState (pCtx);
}
return pCtx->iErrorCode;
ResetParameterSetsState (pCtx);
}
return pCtx->iErrorCode;
}
pDstNal += iDstIdx;
pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage
} else { /* no supplementary picture payload input, but stored a picture */
@@ -574,7 +571,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
ResetParameterSetsState (pCtx);
return pCtx->iErrorCode;
}
//Do error concealment here
ImplementErrorCon (pCtx);
}
}
@@ -662,7 +658,7 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) {
pCtx->pIdctResAddPredFunc = IdctResAddPred_c;
#if defined(HAVE_NEON)
if ( pCtx->uiCpuFlag & WELS_CPU_NEON ) {
if (pCtx->uiCpuFlag & WELS_CPU_NEON) {
pCtx->pIdctResAddPredFunc = IdctResAddPred_neon;
pCtx->pGetI16x16LumaPredFunc[I16_PRED_DC] = WelsDecoderI16x16LumaPredDc_neon;