Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 3 files). Show all
Unified · Split
| @@ -346,6 +346,10 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 345 unmodified lines | ||
| 346 | 346 | TraceParamInfo (pCfg); |
| 347 | 347 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx)) { |
| 348 | 348 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed."); |
| 349 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_DEBUG, | |
| 350 | + "Problematic Input Base Param: iUsageType=%d, Resolution=%dx%d, FR=%f, TLayerNum=%d, DLayerNum=%d", | |
| 351 | + pCfg->iUsageType, pCfg->iPicWidth, pCfg->iPicHeight, pCfg->fMaxFrameRate, pCfg->iTemporalLayerNum, | |
| 352 | + pCfg->iSpatialLayerNum); | |
| 349 | 353 | Uninitialize(); |
| 350 | 354 | return cmInitParaError; |
| 351 | 355 | } |
| @@ -519,7 +523,8 @@ void CWelsH264SVCEncoder::CheckLevelSetting (int32_t iLayer, ELevelIdc uiLevelId · 167 unmodified lines | ||
| 519 | 523 | } |
| 520 | 524 | } |
| 521 | 525 | void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) { |
| 522 | − int32_t iRefUpperBound = (m_pEncContext->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME)?MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA:MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN; | |
| 526 | + int32_t iRefUpperBound = (m_pEncContext->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME) ? | |
| 527 | + MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA : MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN; | |
| 523 | 528 | m_pEncContext->pSvcParam->iNumRefFrame = iNumRef; |
| 524 | 529 | if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > iRefUpperBound)) { |
| 525 | 530 | m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT; |
| @@ -663,6 +668,11 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 137 unmodified lines | ||
| 663 | 668 | if (sConfig.iSpatialLayerNum < 1) { |
| 664 | 669 | return cmInitParaError; |
| 665 | 670 | } |
| 671 | + if (sConfig.DetermineTemporalSettings()) { | |
| 672 | + return cmInitParaError; | |
| 673 | + } | |
| 674 | + | |
| 675 | + /* New configuration available here */ | |
| 666 | 676 | iTargetWidth = sConfig.iPicWidth; |
| 667 | 677 | iTargetHeight = sConfig.iPicHeight; |
| 668 | 678 | if (m_iMaxPicWidth != iTargetWidth |
| @@ -676,9 +686,6 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 7 unmodified lines | ||
| 676 | 686 | m_uiCountFrameNum, m_iCspInternal); |
| 677 | 687 | #endif//REC_FRAME_COUNT |
| 678 | 688 | |
| 679 | − /* New configuration available here */ | |
| 680 | − sConfig.DetermineTemporalSettings(); | |
| 681 | − | |
| 682 | 689 | /* Check every field whether there is new request for memory block changed or else, Oct. 24, 2008 */ |
| 683 | 690 | WelsEncoderParamAdjust (&m_pEncContext, &sConfig); |
| 684 | 691 | } |
| @@ -906,12 +913,12 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 221 unmodified lines | ||
| 906 | 913 | } |
| 907 | 914 | break; |
| 908 | 915 | case ENCODER_OPTION_COMPLEXITY: { |
| 909 | − int32_t iValue = * (static_cast<int32_t*>(pOption)); | |
| 916 | + int32_t iValue = * (static_cast<int32_t*> (pOption)); | |
| 910 | 917 | m_pEncContext->pSvcParam->iComplexityMode = (ECOMPLEXITY_MODE)iValue; |
| 911 | 918 | } |
| 912 | 919 | break; |
| 913 | 920 | case ENCODER_OPTION_IS_LOSSLESS_LINK: { |
| 914 | − bool bValue = * (static_cast<bool*>(pOption)); | |
| 921 | + bool bValue = * (static_cast<bool*> (pOption)); | |
| 915 | 922 | m_pEncContext->pSvcParam->bIsLosslessLink = bValue; |
| 916 | 923 | } |
| 917 | 924 | break; |