Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 16 files). Show all
Unified · Split
| @@ -332,7 +332,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 331 unmodified lines | ||
| 332 | 332 | m_iMaxPicHeight = pCfg->iPicHeight; |
| 333 | 333 | |
| 334 | 334 | TraceParamInfo (pCfg); |
| 335 | − if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx)) { | |
| 335 | + if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx, NULL)) { | |
| 336 | 336 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed."); |
| 337 | 337 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_DEBUG, |
| 338 | 338 | "Problematic Input Base Param: iUsageType=%d, Resolution=%dx%d, FR=%f, TLayerNum=%d, DLayerNum=%d", |
| @@ -477,6 +477,7 @@ int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR) { · 138 unmodified lines | ||
| 477 | 477 | } |
| 478 | 478 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 479 | 479 | "CWelsH264SVCEncoder::ForceIntraFrame(), bIDR= %d", bIDR); |
| 480 | + | |
| 480 | 481 | ForceCodingIDR (m_pEncContext); |
| 481 | 482 | |
| 482 | 483 | m_pEncContext->sEncoderStatistics.uiIDRReqNum++; |
| @@ -486,8 +487,8 @@ int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR) { · 3 unmodified lines | ||
| 486 | 487 | void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { |
| 487 | 488 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 488 | 489 | "iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;iMaxBitrate= %d;iRCMode= %d;iPaddingFlag= %d;iTemporalLayerNum= %d;iSpatialLayerNum= %d;fFrameRate= %.6ff;uiIntraPeriod= %d;\ |
| 489 | − bEnableSpsPpsIdAddition = %d;bPrefixNalAddingCtrl = %d;bEnableDenoise= %d;bEnableBackgroundDetection= %d;bEnableAdaptiveQuant= %d;bEnableFrameSkip= %d;bEnableLongTermReference= %d;iLtrMarkPeriod= %d;\ | |
| 490 | − iComplexityMode = %d;iNumRefFrame = %d;iEntropyCodingModeFlag = %d;uiMaxNalSize = %d;iLTRRefNum = %d;iMultipleThreadIdc = %d;iLoopFilterDisableIdc = %d", | |
| 490 | + iSpsPpsIdStrategy = %d;bPrefixNalAddingCtrl = %d;bEnableDenoise= %d;bEnableBackgroundDetection= %d;bEnableAdaptiveQuant= %d;bEnableFrameSkip= %d;bEnableLongTermReference= %d;iLtrMarkPeriod= %d;\ | |
| 491 | + iComplexityMode = %d;iNumRefFrame = %d;iEntropyCodingModeFlag = %d;uiMaxNalSize = %d;iLTRRefNum = %d;iMultipleThreadIdc = %d;iLoopFilterDisableIdc = %d (offset(alpha/beta): %d,%d)", | |
| 491 | 492 | pParam->iUsageType, |
| 492 | 493 | pParam->iPicWidth, |
| 493 | 494 | pParam->iPicHeight, |
| @@ -499,7 +500,7 @@ void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { · 5 unmodified lines | ||
| 499 | 500 | pParam->iSpatialLayerNum, |
| 500 | 501 | pParam->fMaxFrameRate, |
| 501 | 502 | pParam->uiIntraPeriod, |
| 502 | − pParam->bEnableSpsPpsIdAddition, | |
| 503 | + pParam->iSpsPpsIdStrategy, | |
| 503 | 504 | pParam->bPrefixNalAddingCtrl, |
| 504 | 505 | pParam->bEnableDenoise, |
| 505 | 506 | pParam->bEnableBackgroundDetection, |
| @@ -513,7 +514,9 @@ void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { · 7 unmodified lines | ||
| 513 | 514 | pParam->uiMaxNalSize, |
| 514 | 515 | pParam->iLTRRefNum, |
| 515 | 516 | pParam->iMultipleThreadIdc, |
| 516 | − pParam->iLoopFilterDisableIdc | |
| 517 | + pParam->iLoopFilterDisableIdc, | |
| 518 | + pParam->iLoopFilterAlphaC0Offset, | |
| 519 | + pParam->iLoopFilterBetaOffset | |
| 517 | 520 | ); |
| 518 | 521 | int32_t i = 0; |
| 519 | 522 | int32_t iSpatialLayers = (pParam->iSpatialLayerNum < MAX_SPATIAL_LAYER_NUM) ? (pParam->iSpatialLayerNum) : |
| @@ -706,16 +709,26 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 186 unmodified lines | ||
| 706 | 709 | #endif//OUTPUT_BIT_STREAM |
| 707 | 710 | if (sEncodingParam.iSpatialLayerNum < 1 |
| 708 | 711 | || sEncodingParam.iSpatialLayerNum > MAX_SPATIAL_LAYER_NUM) { // verify number of spatial layer |
| 712 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 713 | + "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, iSpatialLayerNum(%d) failed!", | |
| 714 | + sEncodingParam.iSpatialLayerNum); | |
| 709 | 715 | return cmInitParaError; |
| 710 | 716 | } |
| 711 | 717 | |
| 712 | 718 | if (sConfig.ParamTranscode (sEncodingParam)) { |
| 719 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 720 | + "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, ParamTranscode failed!"); | |
| 713 | 721 | return cmInitParaError; |
| 714 | 722 | } |
| 715 | 723 | if (sConfig.iSpatialLayerNum < 1) { |
| 724 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 725 | + "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, iSpatialLayerNum(%d) failed!", | |
| 726 | + sConfig.iSpatialLayerNum); | |
| 716 | 727 | return cmInitParaError; |
| 717 | 728 | } |
| 718 | 729 | if (sConfig.DetermineTemporalSettings()) { |
| 730 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 731 | + "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, DetermineTemporalSettings failed!"); | |
| 719 | 732 | return cmInitParaError; |
| 720 | 733 | } |
| 721 | 734 | |
| @@ -898,11 +911,17 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 176 unmodified lines | ||
| 898 | 911 | } |
| 899 | 912 | break; |
| 900 | 913 | case ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION: { |
| 901 | − bool iValue = * ((bool*)pOption); | |
| 902 | − | |
| 903 | − m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition = iValue; | |
| 904 | − WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable SPS/PPS ID = %d ", | |
| 905 | − m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition); | |
| 914 | + int32_t iValue = * ((int32_t*)pOption); | |
| 915 | + if (((iValue > INCREASING_ID) || (m_pEncContext->pSvcParam->iSpsPpsIdStrategy > INCREASING_ID)) | |
| 916 | + && m_pEncContext->pSvcParam->iSpsPpsIdStrategy != iValue) { | |
| 917 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | |
| 918 | + " CWelsH264SVCEncoder::SetOption iSpsPpsIdStrategy changing in the middle of call is NOT allowed for iSpsPpsIdStrategy>INCREASING_ID: existing setting is %d and the new one is %d", | |
| 919 | + m_pEncContext->pSvcParam->iSpsPpsIdStrategy, iValue); | |
| 920 | + return cmInitParaError; | |
| 921 | + } | |
| 922 | + m_pEncContext->pSvcParam->iSpsPpsIdStrategy = iValue; | |
| 923 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption iSpsPpsIdStrategy = %d ", | |
| 924 | + m_pEncContext->pSvcParam->iSpsPpsIdStrategy); | |
| 906 | 925 | } |
| 907 | 926 | break; |
| 908 | 927 | case ENCODER_OPTION_CURRENT_PATH: { |