History

add logs and init memory

Karina committed 9 years ago

Commit c5631f61 parent b26bcda6 files · +54 −18Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+44−8
@@ -384,8 +384,8 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 383 unmodified lines
384384 }
385385
386386 }
387− pCfg->iMinQp = WELS_CLIP3 (pCfg->iMinQp , GOM_MIN_QP_MODE, 51);
388− pCfg->iMaxQp = WELS_CLIP3 (pCfg->iMaxQp , pCfg->iMinQp, 51);
387+ pCfg->iMinQp = WELS_CLIP3 (pCfg->iMinQp, GOM_MIN_QP_MODE, 51);
388+ pCfg->iMaxQp = WELS_CLIP3 (pCfg->iMaxQp, pCfg->iMinQp, 51);
389389 }
390390 // ref-frames validation
391391 if (((pCfg->iUsageType == CAMERA_VIDEO_REAL_TIME) || (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME))
@@ -1439,7 +1439,7 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 1047 unmodified lines
14391439 break;
14401440
14411441 t32 = i | (i << 16);
1442− ST32 (t , t32);
1442+ ST32 (t, t32);
14431443 ST32 (t + 2, t32);
14441444
14451445 p = pRowY;
@@ -2357,7 +2357,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 911 unmodified lines
23572357 pCtx->bDeliveryFlag = true;
23582358 *ppCtx = pCtx;
23592359
2360− WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsInitEncoderExt(), pCtx= 0x%p.", (void*)pCtx);
2360+ WelsLog (pLogCtx, WELS_LOG_INFO, "WelsInitEncoderExt(), pCtx= 0x%p.", (void*)pCtx);
23612361
23622362 return 0;
23632363 }
@@ -3360,7 +3360,7 @@ void ClearFrameBsInfo (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi) { · 996 unmodified lines
33603360 pFbi->iLayerNum = 0;
33613361 pFbi->iFrameSizeInBytes = 0;
33623362 }
3363−EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsInfo, int32_t iSpatialNum ,
3363+EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsInfo, int32_t iSpatialNum,
33643364 int8_t& iCurDid, int32_t& iCurTid,
33653365 int32_t& iLayerNum, int32_t& iFrameSize, long long uiTimeStamp) {
33663366 SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam;
@@ -3500,7 +3500,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 133 unmodified lines
35003500 pCtx->pCurDqLayer = pCtx->ppDqLayerList[iCurDid];
35013501 pCtx->pCurDqLayer->pRefLayer = NULL;
35023502 if (!pSvcParam->bSimulcastAVC) {
3503− eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum , iCurDid, iCurTid, iLayerNum, iFrameSize,
3503+ eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum, iCurDid, iCurTid, iLayerNum, iFrameSize,
35043504 pFbi->uiTimeStamp);
35053505 if (eFrameType == videoFrameTypeSkip) {
35063506 pFbi->eFrameType = videoFrameTypeSkip;
@@ -3526,7 +3526,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 19 unmodified lines
35263526 pCtx->uiDependencyId = iCurDid;
35273527
35283528 if (pSvcParam->bSimulcastAVC) {
3529− eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum , iCurDid, iCurTid, iLayerNum, iFrameSize,
3529+ eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum, iCurDid, iCurTid, iLayerNum, iFrameSize,
35303530 pFbi->uiTimeStamp);
35313531 if (eFrameType == videoFrameTypeSkip) {
35323532 pLayerBsInfo->eFrameType = videoFrameTypeSkip;
@@ -4184,7 +4184,21 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 651 unmodified lines
41844184 if (pNewParam->iMaxNumRefFrame > pOldParam->iMaxNumRefFrame) {
41854185 bNeedReset = true;
41864186 }
4187−
4187+ if (bNeedReset) {
4188+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4189+ "WelsEncoderParamAdjust(),bSimulcastAVC(%d,%d),iSpatialLayerNum(%d,%d),iPicWidth(%d,%d),iPicHeight(%d,%d),Rect.iWidth(%d,%d),Rect.iHeight(%d,%d)",
4190+ pOldParam->bSimulcastAVC, pNewParam->bSimulcastAVC, pOldParam->iSpatialLayerNum, pNewParam->iSpatialLayerNum,
4191+ pOldParam->iPicWidth, pNewParam->iPicWidth, pOldParam->iPicHeight, pNewParam->iPicHeight,
4192+ pOldParam->SUsedPicRect.iWidth, pNewParam->SUsedPicRect.iWidth, pOldParam->SUsedPicRect.iHeight,
4193+ pNewParam->SUsedPicRect.iHeight);
4194+
4195+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4196+ "WelsEncoderParamAdjust(),bEnableLongTermReference(%d,%d),iLTRRefNum(%d,%d),iMultipleThreadIdc(%d,%d),bEnableBackgroundDetection(%d,%d),bEnableAdaptiveQuant(%d,%d),eSpsPpsIdStrategy(%d,%d),iMaxNumRefFrame(%d,%d)",
4197+ pOldParam->bEnableLongTermReference, pNewParam->bEnableLongTermReference, pOldParam->iLTRRefNum, pNewParam->iLTRRefNum,
4198+ pOldParam->iMultipleThreadIdc, pNewParam->iMultipleThreadIdc, pOldParam->bEnableBackgroundDetection,
4199+ pNewParam->bEnableBackgroundDetection, pOldParam->bEnableAdaptiveQuant, pNewParam->bEnableAdaptiveQuant,
4200+ pOldParam->eSpsPpsIdStrategy, pNewParam->eSpsPpsIdStrategy, pNewParam->iMaxNumRefFrame, pOldParam->iMaxNumRefFrame);
4201+ }
41884202 if (!bNeedReset) { // Check its picture resolutions/quality settings respectively in each dependency layer
41894203 iIndexD = 0;
41904204 assert (pOldParam->iSpatialLayerNum == pNewParam->iSpatialLayerNum);
@@ -4200,6 +4214,11 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 9 unmodified lines
42004214 kpOldDlp->iActualWidth != kpNewDlp->iActualWidth ||
42014215 kpOldDlp->iActualHeight != kpNewDlp->iActualHeight) {
42024216 bNeedReset = true;
4217+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4218+ "WelsEncoderParamAdjust(),iIndexD = %d,sSpatialLayers.wxh_old(%d,%d),sSpatialLayers.wxh_new(%d,%d),iActualwxh_old(%d,%d),iActualwxh_new(%d,%d)",
4219+ iIndexD, pOldParam->sSpatialLayers[iIndexD].iVideoWidth, pOldParam->sSpatialLayers[iIndexD].iVideoHeight,
4220+ pNewParam->sSpatialLayers[iIndexD].iVideoWidth, pNewParam->sSpatialLayers[iIndexD].iVideoHeight, kpOldDlp->iActualWidth,
4221+ kpOldDlp->iActualHeight, kpNewDlp->iActualWidth, kpNewDlp->iActualHeight);
42034222 break;
42044223 }
42054224
@@ -4208,7 +4227,15 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 2 unmodified lines
42084227 ||
42094228 pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum !=
42104229 pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum) {
4230+
42114231 bNeedReset = true;
4232+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4233+ "WelsEncoderParamAdjust(),iIndexD = %d,uiSliceMode (%d,%d),uiSliceNum(%d,%d)", iIndexD,
4234+ pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode,
4235+ pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode,
4236+ pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum,
4237+ pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum);
4238+
42124239 break;
42134240 }
42144241 if (pOldParam->sSpatialLayers[iIndexD].uiProfileIdc !=
@@ -4217,6 +4244,11 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 2 unmodified lines
42174244 pOldParam->sSpatialLayers[iIndexD].uiLevelIdc !=
42184245 pNewParam->sSpatialLayers[iIndexD].uiLevelIdc) {
42194246 bNeedReset = true;
4247+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4248+ "WelsEncoderParamAdjust(),iIndexD = %d,uiProfileIdc(%d,%d),uiLevelIdc(%d,%d)", iIndexD,
4249+ pOldParam->sSpatialLayers[iIndexD].uiProfileIdc, pNewParam->sSpatialLayers[iIndexD].uiProfileIdc,
4250+ pOldParam->sSpatialLayers[iIndexD].uiLevelIdc, pNewParam->sSpatialLayers[iIndexD].uiLevelIdc);
4251+
42204252 break;
42214253 }
42224254
@@ -4229,6 +4261,10 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 6 unmodified lines
42294261 fT2 = pNewParam->fMaxFrameRate / kpNewDlp->fOutputFrameRate - pOldParam->fMaxFrameRate / kpOldDlp->fOutputFrameRate;
42304262 if (fT1 > EPSN || fT1 < -EPSN || fT2 > EPSN || fT2 < -EPSN) {
42314263 bNeedReset = true;
4264+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4265+ "WelsEncoderParamAdjust() iIndexD = %d,fInputFrameRate(%f,%f),fOutputFrameRate(%f,%f),fMaxFrameRate(%f,%f)", iIndexD,
4266+ kpOldDlp->fInputFrameRate, kpNewDlp->fInputFrameRate, kpOldDlp->fOutputFrameRate, kpNewDlp->fOutputFrameRate,
4267+ pOldParam->fMaxFrameRate, pNewParam->fMaxFrameRate);
42324268 break;
42334269 }
42344270 ++ iIndexD;

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