History

add dec status for freezing

huili2 committed 11 years ago

Commit 504cabf1 parent 82b70b38 files · +116 −43Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+15−24
@@ -44,7 +44,6 @@ · 43 unmodified lines
4444 #include "error_concealment.h"
4545
4646 namespace WelsDec {
47−
4847 static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstInfo) {
4948 PDqLayer pCurDq = pCtx->pCurDqLayer;
5049 PPicture pPic = pCtx->pDec;
@@ -88,24 +87,22 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 37 unmodified lines
8887
8988 pCtx->iTotalNumMbRec = 0;
9089
91− if (!pCtx->bParseOnly) {
92− //////output:::normal path
93− pDstInfo->uiOutYuvTimeStamp = pPic->uiTimeStamp;
94− ppDst[0] = pPic->pData[0];
95− ppDst[1] = pPic->pData[1];
96− ppDst[2] = pPic->pData[2];
90+ //////output:::normal path
91+ pDstInfo->uiOutYuvTimeStamp = pPic->uiTimeStamp;
92+ ppDst[0] = pPic->pData[0];
93+ ppDst[1] = pPic->pData[1];
94+ ppDst[2] = pPic->pData[2];
9795
98− pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420;
96+ pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420;
9997
100− pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2;
101− pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2;
102− pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0];
103− pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1];
104− ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2;
105− ppDst[1] = ppDst[1] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset;
106− ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset;
107− pDstInfo->iBufferStatus = 1;
108− }
98+ pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2;
99+ pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2;
100+ pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0];
101+ pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1];
102+ ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2;
103+ ppDst[1] = ppDst[1] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset;
104+ ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset;
105+ pDstInfo->iBufferStatus = 1;
109106
110107 bool bOutResChange = (pCtx->iLastImgWidthInPixel != pDstInfo->UsrData.sSystemBuffer.iWidth)
111108 || (pCtx->iLastImgHeightInPixel != pDstInfo->UsrData.sSystemBuffer.iHeight);
@@ -119,13 +116,6 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 7 unmodified lines
119116 && pCtx->iErrorCode && bOutResChange)
120117 pCtx->bFreezeOutput = true;
121118
122− if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) {
123− if (pPic->bIsComplete)
124− pCtx->sDecoderStatistics.uiIDRRecvNum++;
125− else
126− pCtx->sDecoderStatistics.uiEcIDRNum++;
127− }
128−
129119 if (pDstInfo->iBufferStatus == 0) {
130120 if (!bFrameCompleteFlag)
131121 pCtx->iErrorCode |= dsBitstreamError;
@@ -137,6 +127,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 5 unmodified lines
137127 WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "DecodeFrameConstruction():New sequence detected, but freezed.");
138128 }
139129 }
130+ UpdateDecStat (pCtx, pDstInfo->iBufferStatus);
140131
141132 return 0;
142133 }

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