Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -63,14 +63,14 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 62 unmodified lines | ||
| 63 | 63 | #else |
| 64 | 64 | pCtx->bReferenceLostAtT0Flag = false; // need initialize it due new seq, 6/4/2010 |
| 65 | 65 | #endif //LONG_TERM_REF |
| 66 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_INFO, | |
| 66 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, | |
| 67 | 67 | "DecodeFrameConstruction()::::output first frame of new sequence, %d x %d, crop_left:%d, crop_right:%d, crop_top:%d, crop_bottom:%d.\n", |
| 68 | 68 | kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset, |
| 69 | 69 | pCtx->sFrameCrop.iBottomOffset); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if (pCtx->iTotalNumMbRec != kiTotalNumMbInCurLayer) { |
| 73 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 73 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 74 | 74 | "DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d \n", |
| 75 | 75 | pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight); |
| 76 | 76 | bFrameCompleteFlag = false; //return later after output buffer is done |
| @@ -318,6 +318,14 @@ int32_t ExpandBsBuffer (PWelsDecoderContext pCtx, const int kiSrcLen) { · 241 unmodified lines | ||
| 318 | 318 | if (pNewBsBuff == NULL) |
| 319 | 319 | return ERR_INFO_OUT_OF_MEMORY; |
| 320 | 320 | |
| 321 | + //Calculate and set the bs start and end position | |
| 322 | + for (int32_t i = 0; i <= pCtx->pAccessUnitList->uiActualUnitsNum; i++) { | |
| 323 | + PBitStringAux pSliceBitsRead = &pCtx->pAccessUnitList->pNalUnitsList[i]->sNalData.sVclNal.sSliceBitsRead; | |
| 324 | + pSliceBitsRead->pStartBuf = pSliceBitsRead->pStartBuf - pCtx->sRawData.pHead + pNewBsBuff; | |
| 325 | + pSliceBitsRead->pEndBuf = pSliceBitsRead->pEndBuf - pCtx->sRawData.pHead + pNewBsBuff; | |
| 326 | + pSliceBitsRead->pCurBuf = pSliceBitsRead->pCurBuf - pCtx->sRawData.pHead + pNewBsBuff; | |
| 327 | + } | |
| 328 | + | |
| 321 | 329 | //Copy current buffer status to new buffer |
| 322 | 330 | memcpy (pNewBsBuff, pCtx->sRawData.pHead, pCtx->iMaxBsBufferSizeInByte); |
| 323 | 331 | pCtx->iMaxBsBufferSizeInByte = iNewBuffLen; |
| @@ -331,7 +339,8 @@ int32_t ExpandBsBuffer (PWelsDecoderContext pCtx, const int kiSrcLen) { · 7 unmodified lines | ||
| 331 | 339 | |
| 332 | 340 | int32_t CheckBsBuffer (PWelsDecoderContext pCtx, const int32_t kiSrcLen) { |
| 333 | 341 | if (kiSrcLen > MAX_ACCESS_UNIT_CAPACITY) { //exceeds max allowed data |
| 334 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "Max AU size exceeded. Allowed size = %d, current size = %d", MAX_ACCESS_UNIT_CAPACITY, | |
| 342 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "Max AU size exceeded. Allowed size = %d, current size = %d", | |
| 343 | + MAX_ACCESS_UNIT_CAPACITY, | |
| 335 | 344 | kiSrcLen); |
| 336 | 345 | pCtx->iErrorCode |= dsBitstreamError; |
| 337 | 346 | return ERR_INFO_INVALID_ACCESS; |
| @@ -455,7 +464,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 117 unmodified lines | ||
| 455 | 464 | bool bSgChangeCycleInvolved = false; // involved slice group change cycle ? |
| 456 | 465 | uint32_t uiCode; |
| 457 | 466 | int32_t iCode; |
| 458 | − SLogContext* pLogCtx = &(pCtx->sLogCtx); | |
| 467 | + SLogContext* pLogCtx = & (pCtx->sLogCtx); | |
| 459 | 468 | |
| 460 | 469 | if (kpCurNal == NULL) { |
| 461 | 470 | return ERR_INFO_OUT_OF_MEMORY; |
| @@ -576,7 +585,8 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 114 unmodified lines | ||
| 576 | 585 | |
| 577 | 586 | if (bIdrFlag) { |
| 578 | 587 | if (pSliceHead->iFrameNum != 0) { |
| 579 | − WelsLog (pLogCtx, WELS_LOG_WARNING, "ParseSliceHeaderSyntaxs(), invaild frame number: %d due to IDR frame introduced!\n", | |
| 588 | + WelsLog (pLogCtx, WELS_LOG_WARNING, | |
| 589 | + "ParseSliceHeaderSyntaxs(), invaild frame number: %d due to IDR frame introduced!\n", | |
| 580 | 590 | pSliceHead->iFrameNum); |
| 581 | 591 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_FRAME_NUM); |
| 582 | 592 | } |
| @@ -750,7 +760,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 167 unmodified lines | ||
| 750 | 760 | pSliceHeadExt->uiDisableInterLayerDeblockingFilterIdc = uiCode; |
| 751 | 761 | //refer to JVT-X201wcm1.doc G.7.4.3.4--2010.4.20 |
| 752 | 762 | if (pSliceHeadExt->uiDisableInterLayerDeblockingFilterIdc > 6) { |
| 753 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "disable_inter_layer_deblock_filter_idc (%d) out of range [0, 6]\n", | |
| 763 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "disable_inter_layer_deblock_filter_idc (%d) out of range [0, 6]\n", | |
| 754 | 764 | pSliceHeadExt->uiDisableInterLayerDeblockingFilterIdc); |
| 755 | 765 | return ERR_INFO_INVALID_DBLOCKING_IDC; |
| 756 | 766 | } |
| @@ -939,7 +949,8 @@ int32_t UpdateAccessUnit (PWelsDecoderContext pCtx) { · 182 unmodified lines | ||
| 939 | 949 | } |
| 940 | 950 | if (uiActualIdx == |
| 941 | 951 | pCurAu->uiActualUnitsNum) { // no found IDR nal within incoming AU, need exit to avoid mosaic issue, 11/19/2009 |
| 942 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "UpdateAccessUnit():::::Key frame lost.....CAN NOT find IDR from current AU.\n"); | |
| 952 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 953 | + "UpdateAccessUnit():::::Key frame lost.....CAN NOT find IDR from current AU.\n"); | |
| 943 | 954 | if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) { |
| 944 | 955 | #ifdef LONG_TERM_REF |
| 945 | 956 | pCtx->iErrorCode |= dsNoParamSets; |
| @@ -1631,7 +1642,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 685 unmodified lines | ||
| 1631 | 1642 | iErr = SyncPictureResolutionExt (pCtx, pCtx->pSps->iMbWidth, pCtx->pSps->iMbHeight); |
| 1632 | 1643 | |
| 1633 | 1644 | if (ERR_NONE != iErr) { |
| 1634 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "sync picture resolution ext failed, the error is %d", iErr); | |
| 1645 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "sync picture resolution ext failed, the error is %d", iErr); | |
| 1635 | 1646 | return iErr; |
| 1636 | 1647 | } |
| 1637 | 1648 | InitErrorCon (pCtx); //Do EC initialization here, for sequence start |
| @@ -1649,7 +1660,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 11 unmodified lines | ||
| 1649 | 1660 | if (pCtx->bNewSeqBegin) |
| 1650 | 1661 | ResetActiveSPSForEachLayer (pCtx); |
| 1651 | 1662 | if (ERR_NONE != iErr) { |
| 1652 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); | |
| 1663 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); | |
| 1653 | 1664 | return iErr; |
| 1654 | 1665 | } |
| 1655 | 1666 | |
| @@ -1785,7 +1796,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 129 unmodified lines | ||
| 1785 | 1796 | pCtx->pDec = PrefetchPic (pCtx->pPicBuff[0]); |
| 1786 | 1797 | |
| 1787 | 1798 | if (NULL == pCtx->pDec) { |
| 1788 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR, "DecodeCurrentAccessUnit()::::::PrefetchPic ERROR, pSps->iNumRefFrames:%d.\n", | |
| 1799 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, | |
| 1800 | + "DecodeCurrentAccessUnit()::::::PrefetchPic ERROR, pSps->iNumRefFrames:%d.\n", | |
| 1789 | 1801 | pCtx->pSps->iNumRefFrames); |
| 1790 | 1802 | pCtx->iErrorCode |= dsOutOfMemory; |
| 1791 | 1803 | return ERR_INFO_REF_COUNT_OVERFLOW; |
| @@ -1838,7 +1850,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 46 unmodified lines | ||
| 1838 | 1850 | pCtx->pFmo = &pCtx->sFmoList[iPpsId]; |
| 1839 | 1851 | if (!FmoParamUpdate (pCtx->pFmo, pLayerInfo.pSps, pLayerInfo.pPps, &pCtx->iActiveFmoNum)) { |
| 1840 | 1852 | pCtx->iErrorCode |= dsBitstreamError; |
| 1841 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "DecodeCurrentAccessUnit(), FmoParamUpdate failed, eSliceType: %d.\n", | |
| 1853 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "DecodeCurrentAccessUnit(), FmoParamUpdate failed, eSliceType: %d.\n", | |
| 1842 | 1854 | pSh->eSliceType); |
| 1843 | 1855 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_FMO_INIT_FAIL); |
| 1844 | 1856 | } |
| @@ -1863,7 +1875,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 18 unmodified lines | ||
| 1863 | 1875 | if (!kbIdrFlag && |
| 1864 | 1876 | pSh->iFrameNum != pCtx->iPrevFrameNum && |
| 1865 | 1877 | pSh->iFrameNum != ((pCtx->iPrevFrameNum + 1) & ((1 << dq_cur->sLayerInfo.pSps->uiLog2MaxFrameNum) - 1))) { |
| 1866 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 1878 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 1867 | 1879 | "referencing pictures lost due frame gaps exist, prev_frame_num: %d, curr_frame_num: %d\n", pCtx->iPrevFrameNum, |
| 1868 | 1880 | pSh->iFrameNum); |
| 1869 | 1881 | |
| @@ -1884,7 +1896,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 14 unmodified lines | ||
| 1884 | 1896 | iRet = InitRefPicList (pCtx, uiNalRefIdc, bFreshSliceAvailable, pSh->iPicOrderCntLsb); |
| 1885 | 1897 | if (iRet) { |
| 1886 | 1898 | HandleReferenceLost (pCtx, pNalCur); |
| 1887 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "reference picture introduced by this frame is lost during transmission! uiTId: %d\n", | |
| 1899 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 1900 | + "reference picture introduced by this frame is lost during transmission! uiTId: %d\n", | |
| 1888 | 1901 | pNalCur->sNalHeaderExt.uiTemporalId); |
| 1889 | 1902 | if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) { |
| 1890 | 1903 | return iRet; |
| @@ -1896,7 +1909,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 5 unmodified lines | ||
| 1896 | 1909 | |
| 1897 | 1910 | //Output good store_base reconstruction when enhancement quality layer occurred error for MGS key picture case |
| 1898 | 1911 | if (iRet != ERR_NONE) { |
| 1899 | − WelsLog (&(pCtx->sLogCtx), WELS_LOG_WARNING, "DecodeCurrentAccessUnit() failed (%d) in frame: %d uiDId: %d uiQId: %d\n", | |
| 1912 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 1913 | + "DecodeCurrentAccessUnit() failed (%d) in frame: %d uiDId: %d uiQId: %d\n", | |
| 1900 | 1914 | iRet, pSh->iFrameNum, iCurrIdD, iCurrIdQ); |
| 1901 | 1915 | HandleReferenceLostL0 (pCtx, pNalCur); |
| 1902 | 1916 | if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) { |