Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 4 files). Show all
Unified · Split
| @@ -690,6 +690,7 @@ DECODING_STATE CWelsDecoder::FlushFrame (unsigned char** ppDst, · 689 unmodified lines | ||
| 690 | 690 | ppDst[1] = m_sPictInfoList[m_iPictInfoIndex].pData[1]; |
| 691 | 691 | ppDst[2] = m_sPictInfoList[m_iPictInfoIndex].pData[2]; |
| 692 | 692 | m_sPictInfoList[m_iPictInfoIndex].iPOC = sIMinInt32; |
| 693 | + m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx]->bAvailableFlag = true; | |
| 693 | 694 | m_sPictInfoList[m_iPictInfoIndex].bLastGOP = false; |
| 694 | 695 | m_iMinPOC = sIMinInt32; |
| 695 | 696 | --m_iNumOfPicts; |
| @@ -743,14 +744,8 @@ void CWelsDecoder::OutputStatisticsLog (SDecoderStatistics& sDecoderStatistics) · 47 unmodified lines | ||
| 743 | 744 | } |
| 744 | 745 | |
| 745 | 746 | DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay (unsigned char** ppDst, SBufferInfo* pDstInfo) { |
| 747 | + DECODING_STATE iRet = dsErrorFree; | |
| 746 | 748 | if (pDstInfo->iBufferStatus == 1 && m_pDecContext->pSps->uiProfileIdc != 66) { |
| 747 | − //Non-reference B_FRAME (disposable) must be released and must not be buffered because its buffer could be overwritten by next reference picture. | |
| 748 | − if (m_pDecContext->pSliceHeader->eSliceType == B_SLICE && !m_pDecContext->pSliceHeader->bIsRefPic) { | |
| 749 | − if (m_pDecContext->pSliceHeader->iPicOrderCntLsb - m_LastWrittenPOC <= 2) { | |
| 750 | − m_LastWrittenPOC = m_pDecContext->pSliceHeader->iPicOrderCntLsb; | |
| 751 | − return dsErrorFree; | |
| 752 | − } | |
| 753 | − } | |
| 754 | 749 | if (m_pDecContext->pSliceHeader->iPicOrderCntLsb == 0) { |
| 755 | 750 | if (m_iNumOfPicts > 0) { |
| 756 | 751 | m_iLastGOPRemainPicts = m_iNumOfPicts; |
| @@ -768,7 +763,8 @@ DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay (unsigned char** ppDst, SB · 11 unmodified lines | ||
| 768 | 763 | m_sPictInfoList[i].pData[1] = ppDst[1]; |
| 769 | 764 | m_sPictInfoList[i].pData[2] = ppDst[2]; |
| 770 | 765 | m_sPictInfoList[i].iPOC = m_pDecContext->pSliceHeader->iPicOrderCntLsb; |
| 771 | − m_sPictInfoList[i].iFrameNum = m_pDecContext->pSliceHeader->iFrameNum; | |
| 766 | + m_sPictInfoList[i].iPicBuffIdx = m_pDecContext->pPicBuff->iCurrentIdx; | |
| 767 | + m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[i].iPicBuffIdx]->bAvailableFlag = false; | |
| 772 | 768 | m_sPictInfoList[i].bLastGOP = false; |
| 773 | 769 | pDstInfo->iBufferStatus = 0; |
| 774 | 770 | ++m_iNumOfPicts; |
| @@ -801,6 +797,7 @@ DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay (unsigned char** ppDst, SB · 26 unmodified lines | ||
| 801 | 797 | ppDst[1] = m_sPictInfoList[m_iPictInfoIndex].pData[1]; |
| 802 | 798 | ppDst[2] = m_sPictInfoList[m_iPictInfoIndex].pData[2]; |
| 803 | 799 | m_sPictInfoList[m_iPictInfoIndex].iPOC = sIMinInt32; |
| 800 | + m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx]->bAvailableFlag = true; | |
| 804 | 801 | m_sPictInfoList[m_iPictInfoIndex].bLastGOP = false; |
| 805 | 802 | m_iMinPOC = sIMinInt32; |
| 806 | 803 | --m_iNumOfPicts; |
| @@ -808,7 +805,7 @@ DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay (unsigned char** ppDst, SB · 1 unmodified line | ||
| 808 | 805 | if (m_iLastGOPRemainPicts == 0) { |
| 809 | 806 | m_LastWrittenPOC = sIMinInt32; |
| 810 | 807 | } |
| 811 | − return dsErrorFree; | |
| 808 | + return iRet; | |
| 812 | 809 | } |
| 813 | 810 | if (m_iNumOfPicts > 0) { |
| 814 | 811 | m_iMinPOC = sIMinInt32; |
| @@ -837,15 +834,16 @@ DECODING_STATE CWelsDecoder::ReorderPicturesInDisplay (unsigned char** ppDst, SB · 22 unmodified lines | ||
| 837 | 834 | ppDst[1] = m_sPictInfoList[m_iPictInfoIndex].pData[1]; |
| 838 | 835 | ppDst[2] = m_sPictInfoList[m_iPictInfoIndex].pData[2]; |
| 839 | 836 | m_sPictInfoList[m_iPictInfoIndex].iPOC = sIMinInt32; |
| 837 | + m_pDecContext->pPicBuff->ppPic[m_sPictInfoList[m_iPictInfoIndex].iPicBuffIdx]->bAvailableFlag = true; | |
| 840 | 838 | m_sPictInfoList[m_iPictInfoIndex].bLastGOP = false; |
| 841 | 839 | m_iMinPOC = sIMinInt32; |
| 842 | 840 | --m_iNumOfPicts; |
| 843 | − return dsErrorFree; | |
| 841 | + return iRet; | |
| 844 | 842 | } |
| 845 | 843 | } |
| 846 | 844 | } |
| 847 | 845 | |
| 848 | − return dsErrorFree; | |
| 846 | + return iRet; | |
| 849 | 847 | } |
| 850 | 848 | |
| 851 | 849 | DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, |