History

trace fix

ruil2 committed 12 years ago

Commit fa138e81 parent 0f4499114 files · +202 −200Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 14 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+50−49
@@ -160,7 +160,7 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 159 unmodified lines
160160 }
161161
162162
163−int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam) {
163+int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingParam) {
164164 int8_t i = 0;
165165 int32_t iIdx = 0;
166166
@@ -169,37 +169,37 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 2 unmodified lines
169169 return ENC_RETURN_INVALIDINPUT;
170170
171171 if ((pCodingParam->iUsageType != CAMERA_VIDEO_REAL_TIME) && (pCodingParam->iUsageType != SCREEN_CONTENT_REAL_TIME)) {
172− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(),Invalid usage type = %d", pCodingParam->iUsageType);
172+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(),Invalid usage type = %d", pCodingParam->iUsageType);
173173 return ENC_RETURN_UNSUPPORTED_PARA;
174174 }
175175 if (pCodingParam->iSpatialLayerNum < 1 || pCodingParam->iSpatialLayerNum > MAX_DEPENDENCY_LAYER) {
176− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->iSpatialLayerNum: %d!\n",
176+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->iSpatialLayerNum: %d!\n",
177177 pCodingParam->iSpatialLayerNum);
178178 return ENC_RETURN_UNSUPPORTED_PARA;
179179 }
180180
181181 if (pCodingParam->iTemporalLayerNum < 1 || pCodingParam->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) {
182− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->iTemporalLayerNum: %d!\n",
182+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->iTemporalLayerNum: %d!\n",
183183 pCodingParam->iTemporalLayerNum);
184184 return ENC_RETURN_UNSUPPORTED_PARA;
185185 }
186186
187187 if (pCodingParam->uiGopSize < 1 || pCodingParam->uiGopSize > MAX_GOP_SIZE) {
188− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->uiGopSize: %d!\n",
188+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), monitor invalid pCodingParam->uiGopSize: %d!\n",
189189 pCodingParam->uiGopSize);
190190 return ENC_RETURN_UNSUPPORTED_PARA;
191191 }
192192
193193
194194 if (pCodingParam->uiIntraPeriod && pCodingParam->uiIntraPeriod < pCodingParam->uiGopSize) {
195− WelsLog (pCtx, WELS_LOG_ERROR,
195+ WelsLog (pLogCtx, WELS_LOG_ERROR,
196196 "ParamValidationExt(), uiIntraPeriod(%d) should be not less than that of uiGopSize(%d) or -1 specified!\n",
197197 pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize);
198198 return ENC_RETURN_UNSUPPORTED_PARA;
199199 }
200200
201201 if (pCodingParam->uiIntraPeriod && (pCodingParam->uiIntraPeriod & (pCodingParam->uiGopSize - 1)) != 0) {
202− WelsLog (pCtx, WELS_LOG_ERROR,
202+ WelsLog (pLogCtx, WELS_LOG_ERROR,
203203 "ParamValidationExt(), uiIntraPeriod(%d) should be multiple of uiGopSize(%d) or -1 specified!\n",
204204 pCodingParam->uiIntraPeriod, pCodingParam->uiGopSize);
205205 return ENC_RETURN_UNSUPPORTED_PARA;
@@ -227,24 +227,24 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 21 unmodified lines
227227 int32_t iMbNumInFrame = 0;
228228 uint32_t iMaxSliceNum = MAX_SLICES_NUM;
229229 if (kiPicWidth <= 0 || kiPicHeight <= 0) {
230− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid %d x %d in dependency layer settings!\n", kiPicWidth,
230+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid %d x %d in dependency layer settings!\n", kiPicWidth,
231231 kiPicHeight);
232232 return ENC_RETURN_UNSUPPORTED_PARA;
233233 }
234234 if ((kiPicWidth & 0x0F) != 0 || (kiPicHeight & 0x0F) != 0) {
235− WelsLog (pCtx, WELS_LOG_ERROR,
235+ WelsLog (pLogCtx, WELS_LOG_ERROR,
236236 "ParamValidationExt(), in layer #%d iWidth x iHeight(%d x %d) both should be multiple of 16, can not support with arbitrary size currently!\n",
237237 i, kiPicWidth, kiPicHeight);
238238 return ENC_RETURN_UNSUPPORTED_PARA;
239239 }
240240
241241 if (pSpatialLayer->sSliceCfg.uiSliceMode >= SM_RESERVED) {
242− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n",
242+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n",
243243 pSpatialLayer->sSliceCfg.uiSliceMode);
244244 return ENC_RETURN_UNSUPPORTED_PARA;
245245 }
246246 if ((pCodingParam->uiMaxNalSize != 0) && (pSpatialLayer->sSliceCfg.uiSliceMode != SM_DYN_SLICE)) {
247− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!,MaxNalSize = %d\n",
247+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!,MaxNalSize = %d\n",
248248 pSpatialLayer->sSliceCfg.uiSliceMode, pCodingParam->uiMaxNalSize);
249249 return ENC_RETURN_UNSUPPORTED_PARA;
250250 }
@@ -271,12 +271,12 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 20 unmodified lines
271271 iMaxSliceNum = MAX_SLICES_NUM;
272272 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0
273273 || pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) {
274− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n",
274+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n",
275275 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum);
276276 return ENC_RETURN_UNSUPPORTED_PARA;
277277 }
278278 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum == 1) {
279− WelsLog (pCtx, WELS_LOG_DEBUG,
279+ WelsLog (pLogCtx, WELS_LOG_DEBUG,
280280 "ParamValidationExt(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type!\n",
281281 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum);
282282 pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
@@ -291,7 +291,7 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 8 unmodified lines
291291 } else if (!CheckFixedSliceNumMultiSliceSetting (iMbNumInFrame,
292292 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
293293 //check uiSliceMbNum with current uiSliceNum
294− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
294+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
295295 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
296296 return ENC_RETURN_UNSUPPORTED_PARA;
297297 }
@@ -315,31 +315,31 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 17 unmodified lines
315315 iMbNumInFrame = iMbWidth * iMbHeight;
316316 iMaxSliceNum = MAX_SLICES_NUM;
317317 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0] <= 0) {
318− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
318+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
319319 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
320320 return ENC_RETURN_UNSUPPORTED_PARA;
321321 }
322322
323323 if (!CheckRasterMultiSliceSetting (iMbNumInFrame,
324324 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
325− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
325+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
326326 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
327327 return ENC_RETURN_UNSUPPORTED_PARA;
328328 }
329329 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0
330330 || pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) { // verify interleave mode settings
331− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!\n",
331+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!\n",
332332 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum);
333333 return ENC_RETURN_UNSUPPORTED_PARA;
334334 }
335335 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum == 1) {
336− WelsLog (pCtx, WELS_LOG_ERROR,
336+ WelsLog (pLogCtx, WELS_LOG_ERROR,
337337 "ParamValidationExt(), pSlice setting for SM_RASTER_SLICE now turn to SM_SINGLE_SLICE!\n");
338338 pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
339339 break;
340340 }
341341 if ((pCodingParam->iRCMode != RC_OFF_MODE) && pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > 1) {
342− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!\n");
342+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!\n");
343343 }
344344 // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting
345345 if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) {
@@ -356,19 +356,19 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 10 unmodified lines
356356 iMbHeight = (kiPicHeight + 15) >> 4;
357357 iMaxSliceNum = MAX_SLICES_NUM;
358358 if (iMbHeight > iMaxSliceNum) {
359− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX!\n", iMbHeight);
359+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings more than MAX!\n", iMbHeight);
360360 return ENC_RETURN_UNSUPPORTED_PARA;
361361 }
362362 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum = iMbHeight;
363363
364364 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0) {
365− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n",
365+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) settings!\n",
366366 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum);
367367 return ENC_RETURN_UNSUPPORTED_PARA;
368368 }
369369 if (!CheckRowMbMultiSliceSetting (iMbWidth,
370370 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
371− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
371+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!\n",
372372 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
373373 return ENC_RETURN_UNSUPPORTED_PARA;
374374 }
@@ -378,20 +378,20 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 3 unmodified lines
378378 iMbWidth = (kiPicWidth + 15) >> 4;
379379 iMbHeight = (kiPicHeight + 15) >> 4;
380380 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint <= 0) {
381− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid iSliceSize (%d) settings!\n",
381+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid iSliceSize (%d) settings!\n",
382382 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint);
383383 return ENC_RETURN_UNSUPPORTED_PARA;
384384 }
385385
386386 if (pCodingParam->uiMaxNalSize <= NAL_HEADER_ADD_0X30BYTES) {
387− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiMaxNalSize (%d) settings!\n",
387+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiMaxNalSize (%d) settings!\n",
388388 pCodingParam->uiMaxNalSize);
389389 return ENC_RETURN_UNSUPPORTED_PARA;
390390 }
391391
392392 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint > (pCodingParam->uiMaxNalSize -
393393 NAL_HEADER_ADD_0X30BYTES)) {
394− WelsLog (pCtx, WELS_LOG_WARNING,
394+ WelsLog (pLogCtx, WELS_LOG_WARNING,
395395 "ParamValidationExt(), slice mode = SM_DYN_SLICE, uiSliceSizeConstraint = %d ,uiMaxNalsize = %d!\n",
396396 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint, pCodingParam->uiMaxNalSize);
397397 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceSizeConstraint = pCodingParam->uiMaxNalSize - NAL_HEADER_ADD_0X30BYTES;
@@ -406,7 +406,7 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 8 unmodified lines
406406 }
407407 break;
408408 default: {
409− WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n",
409+ WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMode (%d) settings!\n",
410410 pCodingParam->sSpatialLayers[0].sSliceCfg.uiSliceMode);
411411 return ENC_RETURN_UNSUPPORTED_PARA;
412412
@@ -415,7 +415,7 @@ int32_t ParamValidationExt (SLogContext* pCtx, SWelsSvcCodingParam* pCodingParam · 2 unmodified lines
415415 }
416416 }
417417
418− return ParamValidation (pCtx, pCodingParam);
418+ return ParamValidation (pLogCtx, pCodingParam);
419419 }
420420
421421
@@ -2025,7 +2025,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 1603 unmodified lines
20252025 pCtx->iMaxSliceCount = iSliceNum;
20262026 iRet = RequestMemorySvc (&pCtx);
20272027 if (iRet != 0) {
2028− WelsLog (pCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), RequestMemorySvc failed return %d.\n", iRet);
2028+ WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), RequestMemorySvc failed return %d.\n", iRet);
20292029 FreeMemorySvc (&pCtx);
20302030 return iRet;
20312031 }
@@ -2038,18 +2038,18 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 6 unmodified lines
20382038 pCtx->pVpp = new CWelsPreProcess (pCtx);
20392039 if (pCtx->pVpp == NULL) {
20402040 iRet = 1;
2041− WelsLog (pCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), pOut of memory in case new CWelsPreProcess().\n");
2041+ WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), pOut of memory in case new CWelsPreProcess().\n");
20422042 FreeMemorySvc (&pCtx);
20432043 return iRet;
20442044 }
20452045 if ((iRet = pCtx->pVpp->AllocSpatialPictures (pCtx, pCtx->pSvcParam)) != 0) {
2046− WelsLog (pCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), pVPP alloc spatial pictures failed\n");
2046+ WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), pVPP alloc spatial pictures failed\n");
20472047 FreeMemorySvc (&pCtx);
20482048 return iRet;
20492049 }
20502050
20512051 #if defined(MEMORY_MONITOR)
2052− WelsLog (pCtx, WELS_LOG_INFO, "WelsInitEncoderExt() exit, overall memory usage: %llu bytes\n",
2052+ WelsLog (pLogCtx, WELS_LOG_INFO, "WelsInitEncoderExt() exit, overall memory usage: %llu bytes\n",
20532053 static_cast<unsigned long long> (sizeof (sWelsEncCtx) /* requested size from malloc() or new operator */
20542054 + pCtx->pMemAlign->WelsGetMemoryUsage()) /* requested size from CMemoryAlign::WelsMalloc() */
20552055 );
@@ -2057,7 +2057,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 1 unmodified line
20572057
20582058 *ppCtx = pCtx;
20592059
2060− WelsLog (pCtx, WELS_LOG_DEBUG, "WelsInitEncoderExt(), pCtx= 0x%p.\n", (void*)pCtx);
2060+ WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsInitEncoderExt(), pCtx= 0x%p.\n", (void*)pCtx);
20612061
20622062 return 0;
20632063 }
@@ -2150,7 +2150,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 86 unmodified lines
21502150 if (NULL == ppCtx || NULL == *ppCtx)
21512151 return;
21522152
2153− WelsLog (*ppCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pCtx= %p, iThreadCount= %d, iMultipleThreadIdc= %d.\n",
2153+ WelsLog (&(*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pCtx= %p, iThreadCount= %d, iMultipleThreadIdc= %d.\n",
21542154 (void*) (*ppCtx), (*ppCtx)->pSvcParam->iCountThreadsNum, (*ppCtx)->pSvcParam->iMultipleThreadIdc);
21552155
21562156 #if defined(STAT_OUTPUT)
@@ -2168,7 +2168,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 11 unmodified lines
21682168 WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]);
21692169 WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]);
21702170 res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit
2171− WelsLog (*ppCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..\n", iThreadIdx,
2171+ WelsLog (&(*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..\n", iThreadIdx,
21722172 res);
21732173 (*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx] = 0;
21742174 }
@@ -2333,7 +2333,7 @@ void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) { · 158 unmodified lines
23332333 / (pSliceCtx->iMaxSliceNumConstraint))
23342334 ) {
23352335
2336− WelsLog (pCtx,
2336+ WelsLog (&(pCtx->sLogCtx),
23372337 WELS_LOG_WARNING,
23382338 "Set-SliceConstraint(%d) too small for current resolution (MB# %d) under QP/BR!\n",
23392339 pSliceCtx->uiSliceSizeConstraint,
@@ -2492,7 +2492,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 152 unmodified lines
24922492 const bool kbHighestSpatialLayer =
24932493 (pCtx->pSvcParam->iSpatialLayerNum == (pCurLayer->sLayerInfo.sNalHeaderExt.uiDependencyId + 1));
24942494 SWelsFuncPtrList* pFuncList = pCtx->pFuncList;
2495−
2495+ SLogContext* pLogCtx = &(pCtx->sLogCtx);
24962496 /* function pointers conditional assignment under sWelsEncCtx, layer_mb_enc_rec (in stack) is exclusive */
24972497 if (kbHighestSpatialLayer && pCtx->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME) {
24982498 SetFastCodingFunc (pFuncList);
@@ -2528,7 +2528,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 29 unmodified lines
25282528 //ME related func pointers
25292529 //ME16x16
25302530 if (!SetMeMethod (ME_DIA_CROSS, pFuncList->pfSearchMethod[BLOCK_16x16])) {
2531− WelsLog (pCtx, WELS_LOG_WARNING, "SetMeMethod(BLOCK_16x16) ME_DIA_CROSS unsuccessful, switched to default search\n");
2531+ WelsLog (pLogCtx, WELS_LOG_WARNING, "SetMeMethod(BLOCK_16x16) ME_DIA_CROSS unsuccessful, switched to default search\n");
25322532 }
25332533 //ME8x8
25342534 SFeatureSearchPreparation* pFeatureSearchPreparation = pCurLayer->pFeatureSearchPreparation;
@@ -2556,7 +2556,7 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 21 unmodified lines
25562556 if (pFeatureSearchPreparation->bFMESwitchFlag && pScreenBlockFeatureStorage->bRefBlockFeatureCalculated
25572557 && (!pScreenBlockFeatureStorage->iIs16x16)) {
25582558 if (!SetMeMethod (ME_DIA_CROSS_FME, pFuncList->pfSearchMethod[BLOCK_8x8])) {
2559− WelsLog (pCtx, WELS_LOG_WARNING, "SetMeMethod(BLOCK_8x8) ME_DIA_CROSS_FME unsuccessful, switched to default search\n");
2559+ WelsLog (pLogCtx, WELS_LOG_WARNING, "SetMeMethod(BLOCK_8x8) ME_DIA_CROSS_FME unsuccessful, switched to default search\n");
25602560 }
25612561 }
25622562
@@ -2833,7 +2833,7 @@ int32_t WritePadding (sWelsEncCtx* pCtx, int32_t iLen, int32_t& iSize) { · 270 unmodified lines
28332833
28342834 if ((pBs->pBufEnd - pBs->pBufPtr) < iLen || iNal >= pCtx->pOut->iCountNals) {
28352835 #if GOM_TRACE_FLAG
2836− WelsLog (pCtx, WELS_LOG_ERROR,
2836+ WelsLog (&(pCtx->sLogCtx), WELS_LOG_ERROR,
28372837 "[RC] paddingcal pBuffer overflow, bufferlen=%lld, paddinglen=%d, iNalIdx= %d, iCountNals= %d\n",
28382838 static_cast<long long int> (pBs->pBufEnd - pBs->pBufPtr), iLen, iNal, pCtx->pOut->iCountNals);
28392839 #endif
@@ -2947,6 +2947,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 107 unmodified lines
29472947 int8_t iCurDid = 0;
29482948 int8_t iCurTid = 0;
29492949 bool bAvcBased = false;
2950+ SLogContext* pLogCtx = &(pCtx->sLogCtx);
29502951 #if defined(ENABLE_PSNR_CALC)
29512952 float fSnrY = .0f, fSnrU = .0f, fSnrV = .0f;
29522953 #endif//ENABLE_PSNR_CALC
@@ -3066,7 +3067,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 113 unmodified lines
30663067 /* coding each spatial layer, only one sQualityStat layer within spatial support */
30673068 int32_t iSliceCount = 1;
30683069 if (iLayerNum >= MAX_LAYER_NUM_OF_FRAME) { // check available layer_bs_info writing as follows
3069− WelsLog (pCtx, WELS_LOG_ERROR, "WelsEncoderEncodeExt(), iLayerNum(%d) overflow(max:%d)!", iLayerNum,
3070+ WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsEncoderEncodeExt(), iLayerNum(%d) overflow(max:%d)!", iLayerNum,
30703071 MAX_LAYER_NUM_OF_FRAME);
30713072 return ENC_RETURN_UNSUPPORTED_PARA;
30723073 }
@@ -3106,7 +3107,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 33 unmodified lines
31063107 if (!pCtx->pFuncList->pBuildRefList (pCtx, pCtx->iPOC, 0)) {
31073108 // Force coding IDR as followed
31083109 ForceCodingIDR (pCtx);
3109− WelsLog (pCtx, WELS_LOG_WARNING,
3110+ WelsLog (pLogCtx, WELS_LOG_WARNING,
31103111 "WelsEncoderEncodeExt(), WelsBuildRefList failed for P frames, pCtx->iNumRef0= %d. ForceCodingIDR!\n",
31113112 pCtx->iNumRef0);
31123113 pFbi->eFrameType = videoFrameTypeIDR;
@@ -3179,13 +3180,13 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 66 unmodified lines
31793180 if ((SM_DYN_SLICE != pParam->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
31803181 iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer->pSliceEncCtx);
31813182 if (iLayerNum + 1 >= MAX_LAYER_NUM_OF_FRAME) { // check available layer_bs_info for further writing as followed
3182− WelsLog (pCtx, WELS_LOG_ERROR,
3183+ WelsLog (pLogCtx, WELS_LOG_ERROR,
31833184 "WelsEncoderEncodeExt(), iLayerNum(%d) overflow(max:%d) at iDid= %d uiSliceMode= %d, iSliceCount= %d!",
31843185 iLayerNum, MAX_LAYER_NUM_OF_FRAME, iCurDid, pParam->sSliceCfg.uiSliceMode, iSliceCount);
31853186 return ENC_RETURN_UNSUPPORTED_PARA;
31863187 }
31873188 if (iSliceCount <= 1) {
3188− WelsLog (pCtx, WELS_LOG_ERROR,
3189+ WelsLog (pLogCtx, WELS_LOG_ERROR,
31893190 "WelsEncoderEncodeExt(), iSliceCount(%d) from GetCurrentSliceNum() is untrusted due stack/heap crupted!\n",
31903191 iSliceCount);
31913192 return ENC_RETURN_UNEXPECTED;
@@ -3203,7 +3204,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 11 unmodified lines
32033204 &pCtx->pSliceThreading->pThreadMasterEvent[0],
32043205 pLayerBsInfo, iSliceCount, pCtx->pCurDqLayer->pSliceEncCtx, false);
32053206 if (iRet) {
3206− WelsLog (pCtx, WELS_LOG_ERROR,
3207+ WelsLog (pLogCtx, WELS_LOG_ERROR,
32073208 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
32083209 iRet, pSvcParam->iCountThreadsNum, iSliceCount, pParam->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
32093210 return ENC_RETURN_UNEXPECTED;
@@ -3243,7 +3244,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 33 unmodified lines
32433244 &pCtx->pSliceThreading->pThreadMasterEvent[0],
32443245 pLayerBsInfo, iNumThreadsRunning, pCtx->pCurDqLayer->pSliceEncCtx, false);
32453246 if (iRet) {
3246− WelsLog (pCtx, WELS_LOG_ERROR,
3247+ WelsLog (pLogCtx, WELS_LOG_ERROR,
32473248 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
32483249 iRet, pSvcParam->iCountThreadsNum, iSliceCount, pParam->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
32493250 return ENC_RETURN_UNEXPECTED;
@@ -3290,7 +3291,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 40 unmodified lines
32903291 &pCtx->pSliceThreading->pThreadMasterEvent[0],
32913292 pLayerBsInfo, kiPartitionCnt, pCtx->pCurDqLayer->pSliceEncCtx, true);
32923293 if (iRet) {
3293− WelsLog (pCtx, WELS_LOG_ERROR,
3294+ WelsLog (pLogCtx, WELS_LOG_ERROR,
32943295 "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iCountThreadsNum= %d, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!\n",
32953296 iRet, pSvcParam->iCountThreadsNum, iSliceCount, pParam->sSliceCfg.uiSliceMode, pSvcParam->iMultipleThreadIdc);
32963297 return ENC_RETURN_UNEXPECTED;
@@ -3370,7 +3371,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 73 unmodified lines
33703371 if (!pCtx->pFuncList->pUpdateRefList (pCtx)) {
33713372 // Force coding IDR as followed
33723373 ForceCodingIDR (pCtx);
3373− WelsLog (pCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), WelsUpdateRefList failed. ForceCodingIDR!\n");
3374+ WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), WelsUpdateRefList failed. ForceCodingIDR!\n");
33743375 //the above is to set the next frame to be IDR
33753376 pFbi->eFrameType = eFrameType;
33763377 return ENC_RETURN_CORRECTED;
@@ -3476,7 +3477,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 99 unmodified lines
34763477 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
34773478
34783479 #if GOM_TRACE_FLAG
3479− WelsLog (pCtx, WELS_LOG_INFO, "[RC] encoding_qp%d Padding: %d\n", pCtx->uiDependencyId,
3480+ WelsLog (pLogCtx, WELS_LOG_INFO, "[RC] encoding_qp%d Padding: %d\n", pCtx->uiDependencyId,
34803481 pCtx->pWelsSvcRc[pCtx->uiDependencyId].iPaddingSize);
34813482 #endif
34823483 if (iPaddingNalSize <= 0)
@@ -3521,7 +3522,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 38 unmodified lines
35213522
35223523 if (pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx) != 0) {
35233524 ForceCodingIDR (pCtx);
3524− WelsLog (pCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!\n");
3525+ WelsLog (pLogCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!\n");
35253526 //the above is to set the next frame IDR
35263527 pFbi->eFrameType = eFrameType;
35273528 return ENC_RETURN_CORRECTED;

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