Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 57 files). Show all
Unified · Split
| @@ -272,7 +272,7 @@ void DestroyPicBuff (PPicBuff* ppPicBuf) { · 271 unmodified lines | |||
| 272 | */ | 272 | */ |
| 273 | void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { | 273 | void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { |
| 274 | int32_t iCpuCores = 1; | 274 | int32_t iCpuCores = 1; |
| 275 | memset (pCtx, 0, sizeof (SWelsDecoderContext)); // fill zero first | 275 | memset (pCtx, 0, sizeof (SWelsDecoderContext)); // fill zero first |
| 276 | pCtx->sLogCtx = *pLogCtx; | 276 | pCtx->sLogCtx = *pLogCtx; |
| 277 | 277 | ||
| 278 | pCtx->pArgDec = NULL; | 278 | pCtx->pArgDec = NULL; |
| @@ -369,14 +369,14 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const · 90 unmodified lines | |||
| 369 | pCtx->iPicQueueNumber = iPicQueueSize; | 369 | pCtx->iPicQueueNumber = iPicQueueSize; |
| 370 | if (pCtx->pPicBuff[LIST_0] != NULL | 370 | if (pCtx->pPicBuff[LIST_0] != NULL |
| 371 | && pCtx->pPicBuff[LIST_0]->iCapacity == | 371 | && pCtx->pPicBuff[LIST_0]->iCapacity == |
| 372 | iPicQueueSize) // comparing current picture queue size requested and previous allocation picture queue | 372 | iPicQueueSize) // comparing current picture queue size requested and previous allocation picture queue |
| 373 | bNeedChangePicQueue = false; | 373 | bNeedChangePicQueue = false; |
| 374 | // HD based pic buffer need consider memory size consumed when switch from 720p to other lower size | 374 | // HD based pic buffer need consider memory size consumed when switch from 720p to other lower size |
| 375 | WELS_VERIFY_RETURN_IF (ERR_NONE, pCtx->bHaveGotMemory && (kiPicWidth == pCtx->iImgWidthInPixel | 375 | WELS_VERIFY_RETURN_IF (ERR_NONE, pCtx->bHaveGotMemory && (kiPicWidth == pCtx->iImgWidthInPixel |
| 376 | && kiPicHeight == pCtx->iImgHeightInPixel) && (!bNeedChangePicQueue)) // have same scaled buffer | 376 | && kiPicHeight == pCtx->iImgHeightInPixel) && (!bNeedChangePicQueue)) // have same scaled buffer |
| 377 | 377 | ||
| 378 | // sync update pRefList | 378 | // sync update pRefList |
| 379 | WelsResetRefPic (pCtx); // added to sync update ref list due to pictures are free | 379 | WelsResetRefPic (pCtx); // added to sync update ref list due to pictures are free |
| 380 | 380 | ||
| 381 | if (pCtx->bHaveGotMemory && (kiPicWidth == pCtx->iImgWidthInPixel && kiPicHeight == pCtx->iImgHeightInPixel) | 381 | if (pCtx->bHaveGotMemory && (kiPicWidth == pCtx->iImgWidthInPixel && kiPicHeight == pCtx->iImgHeightInPixel) |
| 382 | && pCtx->pPicBuff[LIST_0] != NULL && pCtx->pPicBuff[LIST_0]->iCapacity != iPicQueueSize) { | 382 | && pCtx->pPicBuff[LIST_0] != NULL && pCtx->pPicBuff[LIST_0]->iCapacity != iPicQueueSize) { |
| @@ -621,7 +621,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 238 unmodified lines | |||
| 621 | int32_t iSrcIdx = 0; //the index of source bit-stream till now after parsing one or more NALs | 621 | int32_t iSrcIdx = 0; //the index of source bit-stream till now after parsing one or more NALs |
| 622 | int32_t iSrcConsumed = 0; // consumed bit count of source bs | 622 | int32_t iSrcConsumed = 0; // consumed bit count of source bs |
| 623 | int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal | 623 | int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal |
| 624 | int32_t iSrcLength = 0; //the total size of current AU or NAL | 624 | int32_t iSrcLength = 0; //the total size of current AU or NAL |
| 625 | int32_t iRet = 0; | 625 | int32_t iRet = 0; |
| 626 | int32_t iConsumedBytes = 0; | 626 | int32_t iConsumedBytes = 0; |
| 627 | int32_t iOffset = 0; | 627 | int32_t iOffset = 0; |
| @@ -820,7 +820,7 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi · 192 unmodified lines | |||
| 820 | const int32_t kiPicWidth = kiMbWidth << 4; | 820 | const int32_t kiPicWidth = kiMbWidth << 4; |
| 821 | const int32_t kiPicHeight = kiMbHeight << 4; | 821 | const int32_t kiPicHeight = kiMbHeight << 4; |
| 822 | 822 | ||
| 823 | iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight); // common memory used | 823 | iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight); // common memory used |
| 824 | if (ERR_NONE != iErr) { | 824 | if (ERR_NONE != iErr) { |
| 825 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | 825 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, |
| 826 | "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure."); | 826 | "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure."); |