History

decrease log output for decoder momery info

huili2 committed 11 years ago

Commit 042ac9a1 parent b37cda22 files · +12 −5Browse files

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

Unified · Split

codec/decoder/core/src/decoder.cpp+11−4
@@ -358,13 +358,15 @@ static inline int32_t GetTargetRefListSize (PWelsDecoderContext pCtx) { · 357 unmodified lines
358358 /*
359359 * request memory blocks for decoder avc part
360360 */
361−int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight) {
361+int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const int32_t kiMbHeight,
362+ bool& bReallocFlag) {
362363 const int32_t kiPicWidth = kiMbWidth << 4;
363364 const int32_t kiPicHeight = kiMbHeight << 4;
364365 int32_t iErr = ERR_NONE;
365366
366367 int32_t iListIdx = 0; //, mb_blocks = 0;
367368 int32_t iPicQueueSize = 0; // adaptive size of picture queue, = (pSps->iNumRefFrames x 2)
369+ bReallocFlag = false;
368370 bool bNeedChangePicQueue = true;
369371 CMemoryAlign* pMa = pCtx->pMemAlign;
370372
@@ -434,6 +436,8 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const · 63 unmodified lines
434436 if (pCtx->pCabacDecEngine == NULL)
435437 pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) pMa->WelsMallocz (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine");
436438 WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, (NULL == pCtx->pCabacDecEngine))
439+
440+ bReallocFlag = true; // memory re-allocation successfully finished
437441 return ERR_NONE;
438442 }
439443
@@ -836,7 +840,8 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi · 396 unmodified lines
836840 const int32_t kiPicWidth = kiMbWidth << 4;
837841 const int32_t kiPicHeight = kiMbHeight << 4;
838842
839− iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight); // common memory used
843+ bool bReallocFlag = false;
844+ iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight, bReallocFlag); // common memory used
840845 if (ERR_NONE != iErr) {
841846 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
842847 "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure.");
@@ -851,8 +856,10 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi · 8 unmodified lines
851856 pCtx->iErrorCode = dsOutOfMemory;
852857 }
853858 #if defined(MEMORY_MONITOR)
854− WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "SyncPictureResolutionExt(), overall memory usage: %llu bytes",
855− static_cast<unsigned long long> (sizeof (SWelsDecoderContext) + pCtx->pMemAlign->WelsGetMemoryUsage()));
859+ if (bReallocFlag) {
860+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, "SyncPictureResolutionExt(), overall memory usage: %llu bytes",
861+ static_cast<unsigned long long> (sizeof (SWelsDecoderContext) + pCtx->pMemAlign->WelsGetMemoryUsage()));
862+ }
856863 #endif//MEMORY_MONITOR
857864 return iErr;
858865 }

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