History

output error when frame incomplete for parse only usage

huili2 committed 11 years ago

Commit b719c3b1 parent d2d4ab82 files · +23 −13Browse files

Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 2 files). Show all

Unified · Split

codec/decoder/core/src/decoder_core.cpp+13−8
@@ -45,6 +45,8 @@ · 44 unmodified lines
45 45
46namespace WelsDec {46namespace WelsDec {
47static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) {47static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) {
48 if (pDstInfo == NULL) //parse only usage
49 return -1;
48 PDqLayer pCurDq = pCtx->pCurDqLayer;50 PDqLayer pCurDq = pCtx->pCurDqLayer;
49 PPicture pPic = pCtx->pDec;51 PPicture pPic = pCtx->pDec;
50 52
@@ -1760,7 +1762,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 1709 unmodified lines
1760 iErr = DecodeCurrentAccessUnit (pCtx, ppDst, pDstInfo);1762 iErr = DecodeCurrentAccessUnit (pCtx, ppDst, pDstInfo);
1761 1763
1762 if (pCtx->bParseOnly) {1764 if (pCtx->bParseOnly) {
1763 if (dsErrorFree == pCtx->iErrorCode) {1765 if ((dsErrorFree == pCtx->iErrorCode) && (pCtx->iTotalNumMbRec == pCtx->pSps->iMbHeight * pCtx->pSps->iMbWidth)) {
1764 SParserBsInfo* pParser = pCtx->pParserBsInfo;1766 SParserBsInfo* pParser = pCtx->pParserBsInfo;
1765 uint8_t* pDstBuf = pParser->pDstBuff;1767 uint8_t* pDstBuf = pParser->pDstBuff;
1766 SNalUnit* pCurNal = NULL;1768 SNalUnit* pCurNal = NULL;
@@ -1804,6 +1806,10 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 37 unmodified lines
1804 pCtx->pParserBsInfo->iNalNum = 0;1806 pCtx->pParserBsInfo->iNalNum = 0;
1805 pCtx->pParserBsInfo->iSpsWidthInPixel = 0;1807 pCtx->pParserBsInfo->iSpsWidthInPixel = 0;
1806 pCtx->pParserBsInfo->iSpsHeightInPixel = 0;1808 pCtx->pParserBsInfo->iSpsHeightInPixel = 0;
1809 if (dsErrorFree == pCtx->iErrorCode) { //frame not complete
1810 pCtx->iTotalNumMbRec = 0;
1811 pCtx->iErrorCode |= dsFramePending;
1812 }
1807 }1813 }
1808 }1814 }
1809 1815
@@ -2082,12 +2088,10 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 272 unmodified lines
2082 }2088 }
2083 }2089 }
2084 2090
2085 if (!pCtx->bParseOnly) {2091 if (bReconstructSlice) {
2086 if (bReconstructSlice) {2092 if (WelsDecodeConstructSlice (pCtx, pNalCur)) {
2087 if (WelsDecodeConstructSlice (pCtx, pNalCur)) {2093 pCtx->pDec->bIsComplete = false; // reconstruction error, directly set the flag false
2088 pCtx->pDec->bIsComplete = false; // reconstruction error, directly set the flag false2094 return -1;
2089 return -1;
2090 }
2091 }2095 }
2092 }2096 }
2093 if (bAllRefComplete && pCtx->eSliceType != I_SLICE) {2097 if (bAllRefComplete && pCtx->eSliceType != I_SLICE) {
@@ -2158,7 +2162,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 64 unmodified lines
2158 return iRet;2162 return iRet;
2159 }2163 }
2160 }2164 }
2161 ExpandReferencingPicture (pCtx->pDec->pData, pCtx->pDec->iWidthInPixel, pCtx->pDec->iHeightInPixel,2165 if (!pCtx->bParseOnly)
2166 ExpandReferencingPicture (pCtx->pDec->pData, pCtx->pDec->iWidthInPixel, pCtx->pDec->iHeightInPixel,
2162 pCtx->pDec->iLinesize,2167 pCtx->pDec->iLinesize,
2163 pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture);2168 pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture);
2164 }2169 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t