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 | #endif//FRAME_INFO_OUTPUT | 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 | SWelsSvcCodingParam* pSvcParam = pEncCtx->pSvcParam; | 334 | SWelsSvcCodingParam* pSvcParam = pEncCtx->pSvcParam; |
| 335 | SSpatialLayerInternal* pParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[kiDidx]; | 335 | SSpatialLayerInternal* pParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[kiDidx]; |
| 336 | EVideoFrameType iFrameType = videoFrameTypeInvalid; | 336 | EVideoFrameType iFrameType = videoFrameTypeInvalid; |
| 337 | bool bSceneChangeFlag = false; | 337 | bool bSceneChangeFlag = false; |
| 338 | int32_t iSkipFrameFlag = pSvcParam->bSimulcastAVC?pParamInternal->iSkipFrameFlag:pEncCtx->iSkipFrameFlag; | ||
| 339 | if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) { | 338 | if (pSvcParam->iUsageType == SCREEN_CONTENT_REAL_TIME) { |
| 340 | if ((!pSvcParam->bEnableSceneChangeDetect) || pEncCtx->pVaa->bIdrPeriodFlag || | 339 | if ((!pSvcParam->bEnableSceneChangeDetect) || pEncCtx->pVaa->bIdrPeriodFlag || |
| 341 | (kiSpatialNum < pSvcParam->iSpatialLayerNum)) { | 340 | (kiSpatialNum < pSvcParam->iSpatialLayerNum)) { |
| @@ -365,8 +364,7 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum · 23 unmodified lines | |||
| 365 | } else { | 364 | } else { |
| 366 | iFrameType = videoFrameTypeP; | 365 | iFrameType = videoFrameTypeP; |
| 367 | } | 366 | } |
| 368 | if (videoFrameTypeP == iFrameType && iSkipFrameFlag > 0) { | 367 | if (videoFrameTypeP == iFrameType && bSkipFrameFlag) { |
| 369 | pParamInternal->iSkipFrameFlag = 0; | ||
| 370 | iFrameType = videoFrameTypeSkip; | 368 | iFrameType = videoFrameTypeSkip; |
| 371 | } else if (videoFrameTypeIDR == iFrameType) { | 369 | } else if (videoFrameTypeIDR == iFrameType) { |
| 372 | pParamInternal->iCodingIndex = 0; | 370 | pParamInternal->iCodingIndex = 0; |
| @@ -389,8 +387,7 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum · 16 unmodified lines | |||
| 389 | iFrameType = (pEncCtx->pVaa->bIdrPeriodFlag || bSceneChangeFlag | 387 | iFrameType = (pEncCtx->pVaa->bIdrPeriodFlag || bSceneChangeFlag |
| 390 | || pParamInternal->bEncCurFrmAsIdrFlag) ? videoFrameTypeIDR : videoFrameTypeP; | 388 | || pParamInternal->bEncCurFrmAsIdrFlag) ? videoFrameTypeIDR : videoFrameTypeP; |
| 391 | 389 | ||
| 392 | if (videoFrameTypeP == iFrameType && iSkipFrameFlag > 0) { // for frame skip, 1/5/2010 | 390 | if (videoFrameTypeP == iFrameType && bSkipFrameFlag) { // for frame skip, 1/5/2010 |
| 393 | pParamInternal->iSkipFrameFlag = 0; | ||
| 394 | iFrameType = videoFrameTypeSkip; | 391 | iFrameType = videoFrameTypeSkip; |
| 395 | } else if (videoFrameTypeIDR == iFrameType) { | 392 | } else if (videoFrameTypeIDR == iFrameType) { |
| 396 | pParamInternal->iCodingIndex = 0; | 393 | pParamInternal->iCodingIndex = 0; |