Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 54 files). Show all
Unified · Split
| @@ -67,7 +67,7 @@ static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, cons · 66 unmodified lines | ||
| 67 | 67 | return 1; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | − pPicBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); | |
| 70 | + pPicBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); | |
| 71 | 71 | |
| 72 | 72 | if (NULL == pPicBuf) { |
| 73 | 73 | return 1; |
| @@ -109,7 +109,7 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 35 unmodified lines | ||
| 109 | 109 | return 1; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | − pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); | |
| 112 | + pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); | |
| 113 | 113 | |
| 114 | 114 | if (NULL == pPicNewBuf) { |
| 115 | 115 | return 1; |
| @@ -153,9 +153,9 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 37 unmodified lines | ||
| 153 | 153 | // remove old PicBuf |
| 154 | 154 | if (pPicOldBuf->ppPic != NULL) { |
| 155 | 155 | WelsFree (pPicOldBuf->ppPic, "pPicOldBuf->queue"); |
| 156 | − pPicOldBuf->ppPic = NULL; | |
| 156 | + pPicOldBuf->ppPic = NULL; | |
| 157 | 157 | } |
| 158 | − pPicOldBuf->iCapacity = 0; | |
| 158 | + pPicOldBuf->iCapacity = 0; | |
| 159 | 159 | pPicOldBuf->iCurrentIdx = 0; |
| 160 | 160 | WelsFree (pPicOldBuf, "pPicOldBuf"); |
| 161 | 161 | pPicOldBuf = NULL; |
| @@ -171,7 +171,7 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 9 unmodified lines | ||
| 171 | 171 | return 1; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | − pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); | |
| 174 | + pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); | |
| 175 | 175 | |
| 176 | 176 | if (NULL == pPicNewBuf) { |
| 177 | 177 | return 1; |
| @@ -180,7 +180,7 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 2 unmodified lines | ||
| 180 | 180 | pPicNewBuf->ppPic = (PPicture*)WelsMallocz (kiNewSize * sizeof (PPicture), "PPicture*"); |
| 181 | 181 | |
| 182 | 182 | if (NULL == pPicNewBuf->ppPic) { |
| 183 | − pPicNewBuf->iCapacity = 0; | |
| 183 | + pPicNewBuf->iCapacity = 0; | |
| 184 | 184 | DestroyPicBuff (&pPicNewBuf); |
| 185 | 185 | return 1; |
| 186 | 186 | } |
| @@ -227,9 +227,9 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 40 unmodified lines | ||
| 227 | 227 | // remove old PicBuf |
| 228 | 228 | if (pPicOldBuf->ppPic != NULL) { |
| 229 | 229 | WelsFree (pPicOldBuf->ppPic, "pPicOldBuf->queue"); |
| 230 | − pPicOldBuf->ppPic = NULL; | |
| 230 | + pPicOldBuf->ppPic = NULL; | |
| 231 | 231 | } |
| 232 | − pPicOldBuf->iCapacity = 0; | |
| 232 | + pPicOldBuf->iCapacity = 0; | |
| 233 | 233 | pPicOldBuf->iCurrentIdx = 0; |
| 234 | 234 | WelsFree (pPicOldBuf, "pPicOldBuf"); |
| 235 | 235 | pPicOldBuf = NULL; |
| @@ -257,9 +257,9 @@ void DestroyPicBuff (PPicBuff* ppPicBuf) { · 21 unmodified lines | ||
| 257 | 257 | |
| 258 | 258 | WelsFree (pPicBuf->ppPic, "pPicBuf->queue"); |
| 259 | 259 | |
| 260 | − pPicBuf->ppPic = NULL; | |
| 260 | + pPicBuf->ppPic = NULL; | |
| 261 | 261 | } |
| 262 | − pPicBuf->iCapacity = 0; | |
| 262 | + pPicBuf->iCapacity = 0; | |
| 263 | 263 | pPicBuf->iCurrentIdx = 0; |
| 264 | 264 | |
| 265 | 265 | WelsFree (pPicBuf, "pPicBuf"); |
| @@ -331,7 +331,7 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { · 65 unmodified lines | ||
| 331 | 331 | * get size of reference picture list in target layer incoming, = (iNumRefFrames |
| 332 | 332 | */ |
| 333 | 333 | static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) { |
| 334 | − int32_t iNumRefFrames = 0; | |
| 334 | + int32_t iNumRefFrames = 0; | |
| 335 | 335 | // +2 for EC MV Copy buffer exchange |
| 336 | 336 | if ((pCtx == NULL) || (pCtx->pSps == NULL)) { |
| 337 | 337 | iNumRefFrames = MAX_REF_PIC_COUNT + 2; |
| @@ -365,7 +365,7 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const · 27 unmodified lines | ||
| 365 | 365 | |
| 366 | 366 | // Fixed the issue about different gop size over last, 5/17/2010 |
| 367 | 367 | // get picture queue size currently |
| 368 | − iPicQueueSize = GetTargetRefListSize (pCtx); // adaptive size of picture queue, = (pSps->iNumRefFrames x 2) | |
| 368 | + iPicQueueSize = GetTargetRefListSize (pCtx); // adaptive size of picture queue, = (pSps->iNumRefFrames x 2) | |
| 369 | 369 | pCtx->iPicQueueNumber = iPicQueueSize; |
| 370 | 370 | if (pCtx->pPicBuff[LIST_0] != NULL |
| 371 | 371 | && pCtx->pPicBuff[LIST_0]->iCapacity == |
| @@ -482,7 +482,7 @@ int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) { · 110 unmodified lines | ||
| 482 | 482 | #ifdef LONG_TERM_REF |
| 483 | 483 | pCtx->bParamSetsLostFlag = true; |
| 484 | 484 | #else |
| 485 | − pCtx->bReferenceLostAtT0Flag = true; // should be true to waiting IDR at incoming AU bits following, 6/4/2010 | |
| 485 | + pCtx->bReferenceLostAtT0Flag = true; // should be true to waiting IDR at incoming AU bits following, 6/4/2010 | |
| 486 | 486 | #endif //LONG_TERM_REF |
| 487 | 487 | pCtx->bNewSeqBegin = true; |
| 488 | 488 | pCtx->bPrintFrameErrorTraceFlag = true; |
| @@ -517,13 +517,13 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa · 28 unmodified lines | ||
| 517 | 517 | if (NULL == pCtx || NULL == kpParam) |
| 518 | 518 | return 1; |
| 519 | 519 | |
| 520 | − pCtx->pParam = (SDecodingParam*)WelsMallocz (sizeof (SDecodingParam), "SDecodingParam"); | |
| 520 | + pCtx->pParam = (SDecodingParam*)WelsMallocz (sizeof (SDecodingParam), "SDecodingParam"); | |
| 521 | 521 | |
| 522 | 522 | if (NULL == pCtx->pParam) |
| 523 | 523 | return 1; |
| 524 | 524 | |
| 525 | 525 | memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam)); |
| 526 | − pCtx->eOutputColorFormat = pCtx->pParam->eOutputColorFormat; | |
| 526 | + pCtx->eOutputColorFormat = pCtx->pParam->eOutputColorFormat; | |
| 527 | 527 | if (!pCtx->bParseOnly) { |
| 528 | 528 | int32_t iRet = DecoderSetCsp (pCtx, pCtx->pParam->eOutputColorFormat); |
| 529 | 529 | if (iRet) |
| @@ -668,7 +668,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 138 unmodified lines | ||
| 668 | 668 | iConsumedBytes = 0; |
| 669 | 669 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = |
| 670 | 670 | 0; // set 4 reserved bytes to zero |
| 671 | − pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | |
| 671 | + pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | |
| 672 | 672 | if (pNalPayload) { //parse correct |
| 673 | 673 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { |
| 674 | 674 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); |
| @@ -758,8 +758,8 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 83 unmodified lines | ||
| 758 | 758 | return pCtx->iErrorCode; |
| 759 | 759 | } |
| 760 | 760 | } else { /* no supplementary picture payload input, but stored a picture */ |
| 761 | − PAccessUnit pCurAu = | |
| 762 | − pCtx->pAccessUnitList; // current access unit, it will never point to NULL after decode's successful initialization | |
| 761 | + PAccessUnit pCurAu = | |
| 762 | + pCtx->pAccessUnitList; // current access unit, it will never point to NULL after decode's successful initialization | |
| 763 | 763 | |
| 764 | 764 | if (pCurAu->uiAvailUnitsNum == 0) { |
| 765 | 765 | return pCtx->iErrorCode; |
| @@ -789,9 +789,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 23 unmodified lines | ||
| 789 | 789 | int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat) { |
| 790 | 790 | WELS_VERIFY_RETURN_IF (1, (NULL == pCtx)); |
| 791 | 791 | |
| 792 | − pCtx->eOutputColorFormat = (EVideoFormatType) kiColorFormat; | |
| 792 | + pCtx->eOutputColorFormat = (EVideoFormatType) kiColorFormat; | |
| 793 | 793 | if (pCtx->pParam != NULL) { |
| 794 | − pCtx->pParam->eOutputColorFormat = (EVideoFormatType) kiColorFormat; | |
| 794 | + pCtx->pParam->eOutputColorFormat = (EVideoFormatType) kiColorFormat; | |
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | //For now, support only videoFormatI420! |