Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -57,14 +57,6 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 56 unmodified lines | ||
| 57 | 57 | bool bFrameCompleteFlag = true; |
| 58 | 58 | |
| 59 | 59 | if (pCtx->iTotalNumMbRec != kiTotalNumMbInCurLayer) { |
| 60 | − if ((pCtx->iTotalNumMbRec != 0) && (I_SLICE == pCurDq->sLayerInfo.sSliceInLayer.eSliceType)) { //TODO should be IDR instead of I_SLICE! | |
| 61 | − memcpy (& (pCtx->sFrameCrop), & (pCurDq->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->sFrameCrop), sizeof (SPosOffset)); | |
| 62 | −#ifdef LONG_TERM_REF | |
| 63 | − pCtx->bParamSetsLostFlag = false; | |
| 64 | −#else | |
| 65 | − pCtx->bReferenceLostAtT0Flag = false; | |
| 66 | −#endif //LONG_TERM_REF | |
| 67 | − } | |
| 68 | 60 | WelsLog (pCtx, WELS_LOG_WARNING, |
| 69 | 61 | "DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d \n", |
| 70 | 62 | pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight); |
| @@ -74,16 +66,16 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 3 unmodified lines | ||
| 74 | 66 | pCtx->iTotalNumMbRec = 0; |
| 75 | 67 | #endif |
| 76 | 68 | |
| 77 | − if (I_SLICE == pCurDq->sLayerInfo.sSliceInLayer.eSliceType) { | |
| 69 | + if (pCtx->bNewSeqBegin) { | |
| 78 | 70 | memcpy (& (pCtx->sFrameCrop), & (pCurDq->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->sFrameCrop), |
| 79 | 71 | sizeof (SPosOffset)); //confirmed_safe_unsafe_usage |
| 80 | 72 | #ifdef LONG_TERM_REF |
| 81 | 73 | pCtx->bParamSetsLostFlag = false; |
| 82 | 74 | #else |
| 83 | − pCtx->bReferenceLostAtT0Flag = false; // need initialize it due I_SLICE, 6/4/2010 | |
| 75 | + pCtx->bReferenceLostAtT0Flag = false; // need initialize it due new seq, 6/4/2010 | |
| 84 | 76 | #endif //LONG_TERM_REF |
| 85 | 77 | WelsLog (pCtx, WELS_LOG_INFO, |
| 86 | − "DecodeFrameConstruction()::::output good I frame, %d x %d, crop_left:%d, crop_right:%d, crop_top:%d, crop_bottom:%d.\n", | |
| 78 | + "DecodeFrameConstruction()::::output first frame of new sequence, %d x %d, crop_left:%d, crop_right:%d, crop_top:%d, crop_bottom:%d.\n", | |
| 87 | 79 | kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset, |
| 88 | 80 | pCtx->sFrameCrop.iBottomOffset); |
| 89 | 81 | } |
| @@ -1313,16 +1305,11 @@ bool CheckIntegrityNalUnitsList (PWelsDecoderContext pCtx) { · 1223 unmodified lines | ||
| 1313 | 1305 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 1314 | 1306 | const int32_t kiEndPos = pCurAu->uiEndPos; |
| 1315 | 1307 | int32_t iIdxNoInterLayerPred = 0; |
| 1316 | − int32_t iCurNalUnitIdx = kiEndPos; | |
| 1317 | − | |
| 1318 | − ESliceType eSliceType = static_cast<ESliceType> (0);//EC 2009.11.12 | |
| 1319 | 1308 | |
| 1320 | 1309 | if (!pCurAu->bCompletedAuFlag) |
| 1321 | 1310 | return false; |
| 1322 | 1311 | |
| 1323 | − eSliceType = pCurAu->pNalUnitsList[iCurNalUnitIdx]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.eSliceType; | |
| 1324 | − | |
| 1325 | − if (I_SLICE == eSliceType) { | |
| 1312 | + if (pCtx->bNewSeqBegin) { | |
| 1326 | 1313 | pCurAu->uiStartPos = 0; |
| 1327 | 1314 | //step1: search the pNalUnit whose iNoInterLayerPredFlag equal to 1 backwards (from uiEndPos to 0) |
| 1328 | 1315 | iIdxNoInterLayerPred = kiEndPos; |