Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 8 files). Show all
Unified · Split
| @@ -373,8 +373,9 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) { · 372 unmodified lines | ||
| 373 | 373 | |
| 374 | 374 | pDecoderStatistics->fAverageFrameSpeedInMs = (float) (m_pDecContext->dDecTime) / |
| 375 | 375 | (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount); |
| 376 | − memset (&m_pDecContext->sDecoderStatistics, 0, sizeof (SDecoderStatistics)); | |
| 376 | + ResetDecStatNums (&m_pDecContext->sDecoderStatistics); | |
| 377 | 377 | m_pDecContext->dDecTime = 0; |
| 378 | + | |
| 378 | 379 | return cmResultSuccess; |
| 379 | 380 | } |
| 380 | 381 | |
| @@ -478,6 +479,10 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 97 unmodified lines | ||
| 478 | 479 | |
| 479 | 480 | } |
| 480 | 481 | m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++; |
| 482 | + if (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount == 0) { //exceed max value of uint32_t | |
| 483 | + ResetDecStatNums (&m_pDecContext->sDecoderStatistics); | |
| 484 | + m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++; | |
| 485 | + } | |
| 481 | 486 | m_pDecContext->sDecoderStatistics.uiEcFrameNum++; |
| 482 | 487 | m_pDecContext->sDecoderStatistics.uiAvgEcRatio = m_pDecContext->sDecoderStatistics.uiAvgEcRatio / |
| 483 | 488 | m_pDecContext->sDecoderStatistics.uiEcFrameNum; |
| @@ -490,14 +495,18 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 6 unmodified lines | ||
| 490 | 495 | |
| 491 | 496 | if (pDstInfo->iBufferStatus == 1) { |
| 492 | 497 | |
| 498 | + m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++; | |
| 499 | + if (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount == 0) { //exceed max value of uint32_t | |
| 500 | + ResetDecStatNums (&m_pDecContext->sDecoderStatistics); | |
| 501 | + m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++; | |
| 502 | + } | |
| 503 | + | |
| 493 | 504 | if ((m_pDecContext->sDecoderStatistics.uiWidth != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iWidth) |
| 494 | 505 | || (m_pDecContext->sDecoderStatistics.uiHeight != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iHeight)) { |
| 495 | 506 | m_pDecContext->sDecoderStatistics.uiResolutionChangeTimes++; |
| 496 | 507 | m_pDecContext->sDecoderStatistics.uiWidth = pDstInfo->UsrData.sSystemBuffer.iWidth; |
| 497 | 508 | m_pDecContext->sDecoderStatistics.uiHeight = pDstInfo->UsrData.sSystemBuffer.iHeight; |
| 498 | − | |
| 499 | 509 | } |
| 500 | − m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++; | |
| 501 | 510 | } |
| 502 | 511 | iEnd = WelsTime(); |
| 503 | 512 | m_pDecContext->dDecTime += (iEnd - iStart) / 1e3; |
| @@ -529,7 +538,7 @@ DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, · 25 unmodified lines | ||
| 529 | 538 | m_pDecContext->pParserBsInfo = pDstInfo; |
| 530 | 539 | pDstInfo->iNalNum = 0; |
| 531 | 540 | pDstInfo->iSpsWidthInPixel = pDstInfo->iSpsHeightInPixel = 0; |
| 532 | − if(pDstInfo) { | |
| 541 | + if (pDstInfo) { | |
| 533 | 542 | m_pDecContext->uiTimeStamp = pDstInfo->uiInBsTimeStamp; |
| 534 | 543 | pDstInfo->uiOutBsTimeStamp = 0; |
| 535 | 544 | } else { |