Showing the changes to codec/encoder (3 of 3 files). Show all
Unified · Split
| @@ -387,6 +387,13 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum · 386 unmodified lines | |||
| 387 | //pEncCtx->bEncCurFrmAsIdrFlag: 1. first frame should be IDR; 2. idr pause; 3. idr request | 387 | //pEncCtx->bEncCurFrmAsIdrFlag: 1. first frame should be IDR; 2. idr pause; 3. idr request |
| 388 | iFrameType = (pEncCtx->pVaa->bIdrPeriodFlag || bSceneChangeFlag | 388 | iFrameType = (pEncCtx->pVaa->bIdrPeriodFlag || bSceneChangeFlag |
| 389 | || pParamInternal->bEncCurFrmAsIdrFlag) ? videoFrameTypeIDR : videoFrameTypeP; | 389 | || pParamInternal->bEncCurFrmAsIdrFlag) ? videoFrameTypeIDR : videoFrameTypeP; |
| 390 | if ( videoFrameTypeIDR == iFrameType ) { | ||
| 391 | WelsLog (& (pEncCtx->sLogCtx), WELS_LOG_DEBUG, | ||
| 392 | "encoding videoFrameTypeIDR due to ( bIdrPeriodFlag %d, bSceneChangeFlag %d, bEncCurFrmAsIdrFlag %d )", | ||
| 393 | pEncCtx->pVaa->bIdrPeriodFlag, | ||
| 394 | bSceneChangeFlag, | ||
| 395 | pParamInternal->bEncCurFrmAsIdrFlag); | ||
| 396 | } | ||
| 390 | 397 | ||
| 391 | if (videoFrameTypeP == iFrameType && bSkipFrameFlag) { // for frame skip, 1/5/2010 | 398 | if (videoFrameTypeP == iFrameType && bSkipFrameFlag) { // for frame skip, 1/5/2010 |
| 392 | iFrameType = videoFrameTypeSkip; | 399 | iFrameType = videoFrameTypeSkip; |
| @@ -366,9 +366,17 @@ int32_t CWelsPreProcess::SingleLayerPreprocess (sWelsEncCtx* pCtx, const SSource · 365 unmodified lines | |||
| 366 | 366 | ||
| 367 | iSrcWidth = pSvcParam->SUsedPicRect.iWidth; | 367 | iSrcWidth = pSvcParam->SUsedPicRect.iWidth; |
| 368 | iSrcHeight = pSvcParam->SUsedPicRect.iHeight; | 368 | iSrcHeight = pSvcParam->SUsedPicRect.iHeight; |
| 369 | if (pSvcParam->uiIntraPeriod) | 369 | if (pSvcParam->uiIntraPeriod) { |
| 370 | pCtx->pVaa->bIdrPeriodFlag = (1 + pDlayerParamInternal->iFrameIndex >= (int32_t)pSvcParam->uiIntraPeriod) ? true : | 370 | pCtx->pVaa->bIdrPeriodFlag = (1 + pDlayerParamInternal->iFrameIndex >= (int32_t)pSvcParam->uiIntraPeriod) ? true : |
| 371 | false; | 371 | false; |
| 372 | if (pCtx->pVaa->bIdrPeriodFlag) { | ||
| 373 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, | ||
| 374 | "pSvcParam->uiIntraPeriod=%d, pCtx->pVaa->bIdrPeriodFlag=%d", | ||
| 375 | pSvcParam->uiIntraPeriod, | ||
| 376 | pCtx->pVaa->bIdrPeriodFlag); | ||
| 377 | } | ||
| 378 | } | ||
| 379 | |||
| 372 | pSrcPic = pScaledPicture->pScaledInputPicture ? pScaledPicture->pScaledInputPicture : GetCurrentOrigFrame ( | 380 | pSrcPic = pScaledPicture->pScaledInputPicture ? pScaledPicture->pScaledInputPicture : GetCurrentOrigFrame ( |
| 373 | iDependencyId); | 381 | iDependencyId); |
| 374 | 382 | ||
| @@ -715,19 +715,22 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 714 unmodified lines | |||
| 715 | 715 | ||
| 716 | m_iCspInternal = iColorspace; | 716 | m_iCspInternal = iColorspace; |
| 717 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 717 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 718 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_iCspInternal= 0x%x", m_iCspInternal); | 718 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_iCspInternal = 0x%x", m_iCspInternal); |
| 719 | } | 719 | } |
| 720 | break; | 720 | break; |
| 721 | case ENCODER_OPTION_IDR_INTERVAL: { // IDR Interval | 721 | case ENCODER_OPTION_IDR_INTERVAL: { // IDR Interval |
| 722 | int32_t iValue = * ((int32_t*)pOption); | 722 | int32_t iValue = * ((int32_t*)pOption); |
| 723 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 723 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 724 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_IDR_INTERVAL iValue= %d", iValue); | 724 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_IDR_INTERVAL iValue = %d", iValue); |
| 725 | if (iValue < -1 || iValue == 0) | 725 | if (iValue <= -1 || iValue == 0) { |
| 726 | iValue = 1; | 726 | iValue = 0; |
| 727 | } | ||
| 727 | if (iValue == (int32_t)m_pEncContext->pSvcParam->uiIntraPeriod) { | 728 | if (iValue == (int32_t)m_pEncContext->pSvcParam->uiIntraPeriod) { |
| 728 | return cmResultSuccess; | 729 | return cmResultSuccess; |
| 729 | } | 730 | } |
| 730 | m_pEncContext->pSvcParam->uiIntraPeriod = (uint32_t)iValue; | 731 | m_pEncContext->pSvcParam->uiIntraPeriod = (uint32_t)iValue; |
| 732 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | ||
| 733 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_IDR_INTERVAL uiIntraPeriod updated to %d", m_pEncContext->pSvcParam->uiIntraPeriod); | ||
| 731 | } | 734 | } |
| 732 | break; | 735 | break; |
| 733 | case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter | 736 | case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter |