Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 4 files). Show all
Unified · Split
| @@ -484,40 +484,6 @@ int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR) { · 483 unmodified lines | |||
| 484 | 484 | ||
| 485 | return 0; | 485 | return 0; |
| 486 | } | 486 | } |
| 487 | void CWelsH264SVCEncoder::CheckProfileSetting (int32_t iLayer, EProfileIdc uiProfileIdc) { | ||
| 488 | SSpatialLayerConfig* pLayerInfo = &m_pEncContext->pSvcParam->sSpatialLayers[iLayer]; | ||
| 489 | pLayerInfo->uiProfileIdc = uiProfileIdc; | ||
| 490 | if ((iLayer == SPATIAL_LAYER_0) && (uiProfileIdc != PRO_BASELINE)) { | ||
| 491 | pLayerInfo->uiProfileIdc = PRO_BASELINE; | ||
| 492 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support profile(%d),change to baseline profile", | ||
| 493 | uiProfileIdc); | ||
| 494 | } | ||
| 495 | if (iLayer > SPATIAL_LAYER_0) { | ||
| 496 | if ((uiProfileIdc != PRO_BASELINE) || (uiProfileIdc != PRO_SCALABLE_BASELINE)) { | ||
| 497 | pLayerInfo->uiProfileIdc = PRO_BASELINE; | ||
| 498 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support profile(%d),change to baseline profile", | ||
| 499 | uiProfileIdc); | ||
| 500 | } | ||
| 501 | } | ||
| 502 | } | ||
| 503 | void CWelsH264SVCEncoder::CheckLevelSetting (int32_t iLayer, ELevelIdc uiLevelIdc) { | ||
| 504 | SSpatialLayerConfig* pLayerInfo = &m_pEncContext->pSvcParam->sSpatialLayers[iLayer]; | ||
| 505 | pLayerInfo->uiLevelIdc = uiLevelIdc; | ||
| 506 | if ((uiLevelIdc < LEVEL_1_0) || (uiLevelIdc > LEVEL_5_2)) { | ||
| 507 | pLayerInfo->uiLevelIdc = LEVEL_5_2; | ||
| 508 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support level(%d) change to LEVEL_5_2", uiLevelIdc); | ||
| 509 | } | ||
| 510 | } | ||
| 511 | void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) { | ||
| 512 | int32_t iRefUpperBound = (m_pEncContext->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME) ? | ||
| 513 | MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA : MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN; | ||
| 514 | m_pEncContext->pSvcParam->iNumRefFrame = iNumRef; | ||
| 515 | if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > iRefUpperBound)) { | ||
| 516 | m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT; | ||
| 517 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | ||
| 518 | "doesn't support the number of reference frame(%d) change to auto select mode", iNumRef); | ||
| 519 | } | ||
| 520 | } | ||
| 521 | void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { | 487 | void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { |
| 522 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 488 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 523 | "iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;iMaxBitrate= %d;iRCMode= %d;iPaddingFlag= %d;iTemporalLayerNum= %d;iSpatialLayerNum= %d;fFrameRate= %.6ff;uiIntraPeriod= %d;\ | 489 | "iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;iMaxBitrate= %d;iRCMode= %d;iPaddingFlag= %d;iTemporalLayerNum= %d;iSpatialLayerNum= %d;fFrameRate= %.6ff;uiIntraPeriod= %d;\ |
| @@ -986,7 +952,8 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 462 unmodified lines | |||
| 986 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)", pProfileInfo->iLayer); | 952 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)", pProfileInfo->iLayer); |
| 987 | return cmInitParaError; | 953 | return cmInitParaError; |
| 988 | } | 954 | } |
| 989 | CheckProfileSetting (pProfileInfo->iLayer, pProfileInfo->uiProfileIdc); | 955 | CheckProfileSetting (&m_pWelsTrace->m_sLogCtx, m_pEncContext->pSvcParam, pProfileInfo->iLayer, |
| 956 | pProfileInfo->uiProfileIdc); | ||
| 990 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 957 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 991 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,layerId = %d,expected profile = %d,actual profile = %d", | 958 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,layerId = %d,expected profile = %d,actual profile = %d", |
| 992 | pProfileInfo->iLayer, pProfileInfo->uiProfileIdc, | 959 | pProfileInfo->iLayer, pProfileInfo->uiProfileIdc, |
| @@ -1000,7 +967,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 7 unmodified lines | |||
| 1000 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)", pLevelInfo->iLayer); | 967 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)", pLevelInfo->iLayer); |
| 1001 | return cmInitParaError; | 968 | return cmInitParaError; |
| 1002 | } | 969 | } |
| 1003 | CheckLevelSetting (pLevelInfo->iLayer, pLevelInfo->uiLevelIdc); | 970 | CheckLevelSetting (&m_pWelsTrace->m_sLogCtx, m_pEncContext->pSvcParam, pLevelInfo->iLayer, pLevelInfo->uiLevelIdc); |
| 1004 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 971 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 1005 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_LEVEL,layerId = %d,expected level = %d,actual level = %d", | 972 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_LEVEL,layerId = %d,expected level = %d,actual level = %d", |
| 1006 | pLevelInfo->iLayer, pLevelInfo->uiLevelIdc, m_pEncContext->pSvcParam->sSpatialLayers[pLevelInfo->iLayer].uiLevelIdc); | 973 | pLevelInfo->iLayer, pLevelInfo->uiLevelIdc, m_pEncContext->pSvcParam->sSpatialLayers[pLevelInfo->iLayer].uiLevelIdc); |
| @@ -1008,7 +975,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 1 unmodified line | |||
| 1008 | break; | 975 | break; |
| 1009 | case ENCODER_OPTION_NUMBER_REF: { | 976 | case ENCODER_OPTION_NUMBER_REF: { |
| 1010 | int32_t iValue = * ((int32_t*)pOption); | 977 | int32_t iValue = * ((int32_t*)pOption); |
| 1011 | CheckReferenceNumSetting (iValue); | 978 | CheckReferenceNumSetting (&m_pWelsTrace->m_sLogCtx, m_pEncContext->pSvcParam, iValue); |
| 1012 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 979 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 1013 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_NUMBER_REF,expected refNum = %d,actual refnum = %d", iValue, | 980 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_NUMBER_REF,expected refNum = %d,actual refnum = %d", iValue, |
| 1014 | m_pEncContext->pSvcParam->iNumRefFrame); | 981 | m_pEncContext->pSvcParam->iNumRefFrame); |
| @@ -1260,7 +1227,7 @@ void WelsDestroySVCEncoder (ISVCEncoder* pEncoder) { · 245 unmodified lines | |||
| 1260 | } | 1227 | } |
| 1261 | } | 1228 | } |
| 1262 | 1229 | ||
| 1263 | OpenH264Version WelsGetCodecVersion () { | 1230 | OpenH264Version WelsGetCodecVersion() { |
| 1264 | (void) g_strCodecVer; // Avoid warnings about unused static variables | 1231 | (void) g_strCodecVer; // Avoid warnings about unused static variables |
| 1265 | return g_stCodecVersion; | 1232 | return g_stCodecVersion; |
| 1266 | } | 1233 | } |