History

add parseoly statistics

huili2 committed 9 years ago

Commit 5cd3c5d1 parent 7f172774 files · +164 −63Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+24−4
@@ -72,6 +72,19 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 71 unmodified lines
7272 }
7373 }
7474
75+ const int32_t kiActualWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2;
76+ const int32_t kiActualHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2;
77+
78+
79+ if (pCtx->pParam->eEcActiveIdc == ERROR_CON_DISABLE) {
80+ if ((pCtx->sDecoderStatistics.uiWidth != (unsigned int) kiActualWidth) || (pCtx->sDecoderStatistics.uiHeight != (unsigned int) kiActualHeight)) {
81+ pCtx->sDecoderStatistics.uiResolutionChangeTimes++;
82+ pCtx->sDecoderStatistics.uiWidth = kiActualWidth;
83+ pCtx->sDecoderStatistics.uiHeight = kiActualHeight;
84+ }
85+ UpdateDecStatNoFreezingInfo (pCtx);
86+ }
87+
7588 if (pCtx->pParam->bParseOnly) { //should exit for parse only to prevent access NULL pDstInfo
7689 PAccessUnit pCurAu = pCtx->pAccessUnitList;
7790 if (dsErrorFree == pCtx->iErrorCode) { //correct decoding, add to data buffer
@@ -198,8 +211,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 120 unmodified lines
198211
199212 pDstInfo->UsrData.sSystemBuffer.iFormat = videoFormatI420;
200213
201− pDstInfo->UsrData.sSystemBuffer.iWidth = kiWidth - (pCtx->sFrameCrop.iLeftOffset + pCtx->sFrameCrop.iRightOffset) * 2;
202− pDstInfo->UsrData.sSystemBuffer.iHeight = kiHeight - (pCtx->sFrameCrop.iTopOffset + pCtx->sFrameCrop.iBottomOffset) * 2;
214+ pDstInfo->UsrData.sSystemBuffer.iWidth = kiActualWidth;
215+ pDstInfo->UsrData.sSystemBuffer.iHeight = kiActualHeight;
203216 pDstInfo->UsrData.sSystemBuffer.iStride[0] = pPic->iLinesize[0];
204217 pDstInfo->UsrData.sSystemBuffer.iStride[1] = pPic->iLinesize[1];
205218 ppDst[0] = ppDst[0] + pCtx->sFrameCrop.iTopOffset * 2 * pPic->iLinesize[0] + pCtx->sFrameCrop.iLeftOffset * 2;
@@ -235,8 +248,15 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 29 unmodified lines
235248 pCtx->iMbEcedNum = pPic->iMbEcedNum;
236249 pCtx->iMbNum = pPic->iMbNum;
237250 pCtx->iMbEcedPropNum = pPic->iMbEcedPropNum;
238− UpdateDecStat (pCtx, pDstInfo->iBufferStatus != 0);
239−
251+ if (pCtx->pParam->eEcActiveIdc != ERROR_CON_DISABLE) {
252+ if (pDstInfo->iBufferStatus && ((pCtx->sDecoderStatistics.uiWidth != (unsigned int) kiActualWidth)
253+ || (pCtx->sDecoderStatistics.uiHeight != (unsigned int) kiActualHeight))) {
254+ pCtx->sDecoderStatistics.uiResolutionChangeTimes++;
255+ pCtx->sDecoderStatistics.uiWidth = kiActualWidth;
256+ pCtx->sDecoderStatistics.uiHeight = kiActualHeight;
257+ }
258+ UpdateDecStat (pCtx, pDstInfo->iBufferStatus != 0);
259+ }
240260 return ERR_NONE;
241261 }
242262

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