History

Merge pull request #751 from huili2/NewSeq_replace_I

use new seq instead of I slice

huili2 committed 12 years ago

Commit 9d1af8c2 parents c5f04cf 0c544961 file · +4 −17Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+4−17
@@ -57,14 +57,6 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 56 unmodified lines
57 bool bFrameCompleteFlag = true;57 bool bFrameCompleteFlag = true;
58 58
59 if (pCtx->iTotalNumMbRec != kiTotalNumMbInCurLayer) {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 WelsLog (pCtx, WELS_LOG_WARNING,60 WelsLog (pCtx, WELS_LOG_WARNING,
69 "DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d \n",61 "DecodeFrameConstruction():::iTotalNumMbRec:%d, total_num_mb_sps:%d, cur_layer_mb_width:%d, cur_layer_mb_height:%d \n",
70 pCtx->iTotalNumMbRec, kiTotalNumMbInCurLayer, pCurDq->iMbWidth, pCurDq->iMbHeight);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 pCtx->iTotalNumMbRec = 0;66 pCtx->iTotalNumMbRec = 0;
75#endif67#endif
76 68
77 if (I_SLICE == pCurDq->sLayerInfo.sSliceInLayer.eSliceType) {69 if (pCtx->bNewSeqBegin) {
78 memcpy (& (pCtx->sFrameCrop), & (pCurDq->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->sFrameCrop),70 memcpy (& (pCtx->sFrameCrop), & (pCurDq->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.pSps->sFrameCrop),
79 sizeof (SPosOffset)); //confirmed_safe_unsafe_usage71 sizeof (SPosOffset)); //confirmed_safe_unsafe_usage
80#ifdef LONG_TERM_REF72#ifdef LONG_TERM_REF
81 pCtx->bParamSetsLostFlag = false;73 pCtx->bParamSetsLostFlag = false;
82#else74#else
83 pCtx->bReferenceLostAtT0Flag = false; // need initialize it due I_SLICE, 6/4/201075 pCtx->bReferenceLostAtT0Flag = false; // need initialize it due new seq, 6/4/2010
84#endif //LONG_TERM_REF76#endif //LONG_TERM_REF
85 WelsLog (pCtx, WELS_LOG_INFO,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 kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset,79 kiWidth, kiHeight, pCtx->sFrameCrop.iLeftOffset, pCtx->sFrameCrop.iRightOffset, pCtx->sFrameCrop.iTopOffset,
88 pCtx->sFrameCrop.iBottomOffset);80 pCtx->sFrameCrop.iBottomOffset);
89 }81 }
@@ -1313,16 +1305,11 @@ bool CheckIntegrityNalUnitsList (PWelsDecoderContext pCtx) { · 1223 unmodified lines
1313 PAccessUnit pCurAu = pCtx->pAccessUnitList;1305 PAccessUnit pCurAu = pCtx->pAccessUnitList;
1314 const int32_t kiEndPos = pCurAu->uiEndPos;1306 const int32_t kiEndPos = pCurAu->uiEndPos;
1315 int32_t iIdxNoInterLayerPred = 0;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 if (!pCurAu->bCompletedAuFlag)1309 if (!pCurAu->bCompletedAuFlag)
1321 return false;1310 return false;
1322 1311
1323 eSliceType = pCurAu->pNalUnitsList[iCurNalUnitIdx]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.eSliceType;1312 if (pCtx->bNewSeqBegin) {
1324
1325 if (I_SLICE == eSliceType) {
1326 pCurAu->uiStartPos = 0;1313 pCurAu->uiStartPos = 0;
1327 //step1: search the pNalUnit whose iNoInterLayerPredFlag equal to 1 backwards (from uiEndPos to 0)1314 //step1: search the pNalUnit whose iNoInterLayerPredFlag equal to 1 backwards (from uiEndPos to 0)
1328 iIdxNoInterLayerPred = kiEndPos;1315 iIdxNoInterLayerPred = kiEndPos;

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