Showing the changes to codec/encoder/core/src/encoder.cpp (1 of 9 files). Show all
Unified · Split
| @@ -330,12 +330,11 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EVideoFrameType keFrameType, c · 329 unmodified lines | ||
| 330 | 330 | #endif//FRAME_INFO_OUTPUT |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | −EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum, const int32_t kiDidx) { | |
| 333 | +EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum, const int32_t kiDidx, bool bSkipFrameFlag) { | |
| 334 | 334 | SWelsSvcCodingParam* pSvcParam = pEncCtx->pSvcParam; |
| 335 | 335 | SSpatialLayerInternal* pParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[kiDidx]; |
| 336 | 336 | EVideoFrameType iFrameType = videoFrameTypeInvalid; |
| 337 | 337 | bool bSceneChangeFlag = false; |
| 338 | − int32_t iSkipFrameFlag = pSvcParam->bSimulcastAVC?pParamInternal->iSkipFrameFlag:pEncCtx->iSkipFrameFlag; | |
| 339 | 338 | if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) { |
| 340 | 339 | if ((!pSvcParam->bEnableSceneChangeDetect) || pEncCtx->pVaa->bIdrPeriodFlag || |
| 341 | 340 | (kiSpatialNum < pSvcParam->iSpatialLayerNum)) { |
| @@ -365,8 +364,7 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum · 23 unmodified lines | ||
| 365 | 364 | } else { |
| 366 | 365 | iFrameType = videoFrameTypeP; |
| 367 | 366 | } |
| 368 | − if (videoFrameTypeP == iFrameType && iSkipFrameFlag > 0) { | |
| 369 | − pParamInternal->iSkipFrameFlag = 0; | |
| 367 | + if (videoFrameTypeP == iFrameType && bSkipFrameFlag) { | |
| 370 | 368 | iFrameType = videoFrameTypeSkip; |
| 371 | 369 | } else if (videoFrameTypeIDR == iFrameType) { |
| 372 | 370 | pParamInternal->iCodingIndex = 0; |
| @@ -389,8 +387,7 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum · 16 unmodified lines | ||
| 389 | 387 | iFrameType = (pEncCtx->pVaa->bIdrPeriodFlag || bSceneChangeFlag |
| 390 | 388 | || pParamInternal->bEncCurFrmAsIdrFlag) ? videoFrameTypeIDR : videoFrameTypeP; |
| 391 | 389 | |
| 392 | − if (videoFrameTypeP == iFrameType && iSkipFrameFlag > 0) { // for frame skip, 1/5/2010 | |
| 393 | − pParamInternal->iSkipFrameFlag = 0; | |
| 390 | + if (videoFrameTypeP == iFrameType && bSkipFrameFlag) { // for frame skip, 1/5/2010 | |
| 394 | 391 | iFrameType = videoFrameTypeSkip; |
| 395 | 392 | } else if (videoFrameTypeIDR == iFrameType) { |
| 396 | 393 | pParamInternal->iCodingIndex = 0; |