Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 6 files). Show all
Unified · Split
| @@ -384,8 +384,8 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 383 unmodified lines | ||
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | } |
| 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); | |
| 389 | 389 | } |
| 390 | 390 | // ref-frames validation |
| 391 | 391 | 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 | ||
| 1439 | 1439 | break; |
| 1440 | 1440 | |
| 1441 | 1441 | t32 = i | (i << 16); |
| 1442 | − ST32 (t , t32); | |
| 1442 | + ST32 (t, t32); | |
| 1443 | 1443 | ST32 (t + 2, t32); |
| 1444 | 1444 | |
| 1445 | 1445 | p = pRowY; |
| @@ -2357,7 +2357,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 911 unmodified lines | ||
| 2357 | 2357 | pCtx->bDeliveryFlag = true; |
| 2358 | 2358 | *ppCtx = pCtx; |
| 2359 | 2359 | |
| 2360 | − WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsInitEncoderExt(), pCtx= 0x%p.", (void*)pCtx); | |
| 2360 | + WelsLog (pLogCtx, WELS_LOG_INFO, "WelsInitEncoderExt(), pCtx= 0x%p.", (void*)pCtx); | |
| 2361 | 2361 | |
| 2362 | 2362 | return 0; |
| 2363 | 2363 | } |
| @@ -3360,7 +3360,7 @@ void ClearFrameBsInfo (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi) { · 996 unmodified lines | ||
| 3360 | 3360 | pFbi->iLayerNum = 0; |
| 3361 | 3361 | pFbi->iFrameSizeInBytes = 0; |
| 3362 | 3362 | } |
| 3363 | −EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsInfo, int32_t iSpatialNum , | |
| 3363 | +EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsInfo, int32_t iSpatialNum, | |
| 3364 | 3364 | int8_t& iCurDid, int32_t& iCurTid, |
| 3365 | 3365 | int32_t& iLayerNum, int32_t& iFrameSize, long long uiTimeStamp) { |
| 3366 | 3366 | SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam; |
| @@ -3500,7 +3500,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 133 unmodified lines | ||
| 3500 | 3500 | pCtx->pCurDqLayer = pCtx->ppDqLayerList[iCurDid]; |
| 3501 | 3501 | pCtx->pCurDqLayer->pRefLayer = NULL; |
| 3502 | 3502 | if (!pSvcParam->bSimulcastAVC) { |
| 3503 | − eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum , iCurDid, iCurTid, iLayerNum, iFrameSize, | |
| 3503 | + eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum, iCurDid, iCurTid, iLayerNum, iFrameSize, | |
| 3504 | 3504 | pFbi->uiTimeStamp); |
| 3505 | 3505 | if (eFrameType == videoFrameTypeSkip) { |
| 3506 | 3506 | pFbi->eFrameType = videoFrameTypeSkip; |
| @@ -3526,7 +3526,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 19 unmodified lines | ||
| 3526 | 3526 | pCtx->uiDependencyId = iCurDid; |
| 3527 | 3527 | |
| 3528 | 3528 | if (pSvcParam->bSimulcastAVC) { |
| 3529 | − eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum , iCurDid, iCurTid, iLayerNum, iFrameSize, | |
| 3529 | + eFrameType = PrepareEncodeFrame (pCtx, pLayerBsInfo, iSpatialNum, iCurDid, iCurTid, iLayerNum, iFrameSize, | |
| 3530 | 3530 | pFbi->uiTimeStamp); |
| 3531 | 3531 | if (eFrameType == videoFrameTypeSkip) { |
| 3532 | 3532 | pLayerBsInfo->eFrameType = videoFrameTypeSkip; |
| @@ -4184,7 +4184,21 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 651 unmodified lines | ||
| 4184 | 4184 | if (pNewParam->iMaxNumRefFrame > pOldParam->iMaxNumRefFrame) { |
| 4185 | 4185 | bNeedReset = true; |
| 4186 | 4186 | } |
| 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 | + } | |
| 4188 | 4202 | if (!bNeedReset) { // Check its picture resolutions/quality settings respectively in each dependency layer |
| 4189 | 4203 | iIndexD = 0; |
| 4190 | 4204 | assert (pOldParam->iSpatialLayerNum == pNewParam->iSpatialLayerNum); |
| @@ -4200,6 +4214,11 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 9 unmodified lines | ||
| 4200 | 4214 | kpOldDlp->iActualWidth != kpNewDlp->iActualWidth || |
| 4201 | 4215 | kpOldDlp->iActualHeight != kpNewDlp->iActualHeight) { |
| 4202 | 4216 | 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); | |
| 4203 | 4222 | break; |
| 4204 | 4223 | } |
| 4205 | 4224 | |
| @@ -4208,7 +4227,15 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 2 unmodified lines | ||
| 4208 | 4227 | || |
| 4209 | 4228 | pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum != |
| 4210 | 4229 | pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum) { |
| 4230 | + | |
| 4211 | 4231 | 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 | + | |
| 4212 | 4239 | break; |
| 4213 | 4240 | } |
| 4214 | 4241 | if (pOldParam->sSpatialLayers[iIndexD].uiProfileIdc != |
| @@ -4217,6 +4244,11 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 2 unmodified lines | ||
| 4217 | 4244 | pOldParam->sSpatialLayers[iIndexD].uiLevelIdc != |
| 4218 | 4245 | pNewParam->sSpatialLayers[iIndexD].uiLevelIdc) { |
| 4219 | 4246 | 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 | + | |
| 4220 | 4252 | break; |
| 4221 | 4253 | } |
| 4222 | 4254 | |
| @@ -4229,6 +4261,10 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 6 unmodified lines | ||
| 4229 | 4261 | fT2 = pNewParam->fMaxFrameRate / kpNewDlp->fOutputFrameRate - pOldParam->fMaxFrameRate / kpOldDlp->fOutputFrameRate; |
| 4230 | 4262 | if (fT1 > EPSN || fT1 < -EPSN || fT2 > EPSN || fT2 < -EPSN) { |
| 4231 | 4263 | 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); | |
| 4232 | 4268 | break; |
| 4233 | 4269 | } |
| 4234 | 4270 | ++ iIndexD; |