History

rename the strategy to enum

Sijia Chen committed 11 years ago

Commit d9502aa1 parent 7d1d2d69 files · +166 −74Browse files

Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 9 files). Show all

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+34−10
@@ -487,7 +487,7 @@ int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR) { · 486 unmodified lines
487void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) {487void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) {
488 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,488 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
489 "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;\
490 iSpsPpsIdStrategy = %d;bPrefixNalAddingCtrl = %d;bEnableDenoise= %d;bEnableBackgroundDetection= %d;bEnableAdaptiveQuant= %d;bEnableFrameSkip= %d;bEnableLongTermReference= %d;iLtrMarkPeriod= %d;\490 eSpsPpsIdStrategy = %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 iComplexityMode = %d;iNumRefFrame = %d;iEntropyCodingModeFlag = %d;uiMaxNalSize = %d;iLTRRefNum = %d;iMultipleThreadIdc = %d;iLoopFilterDisableIdc = %d (offset(alpha/beta): %d,%d)",
492 pParam->iUsageType,492 pParam->iUsageType,
493 pParam->iPicWidth,493 pParam->iPicWidth,
@@ -500,7 +500,7 @@ void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { · 6 unmodified lines
500 pParam->iSpatialLayerNum,500 pParam->iSpatialLayerNum,
501 pParam->fMaxFrameRate,501 pParam->fMaxFrameRate,
502 pParam->uiIntraPeriod,502 pParam->uiIntraPeriod,
503 pParam->iSpsPpsIdStrategy,503 pParam->eSpsPpsIdStrategy,
504 pParam->bPrefixNalAddingCtrl,504 pParam->bPrefixNalAddingCtrl,
505 pParam->bEnableDenoise,505 pParam->bEnableDenoise,
506 pParam->bEnableBackgroundDetection,506 pParam->bEnableBackgroundDetection,
@@ -911,17 +911,41 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 404 unmodified lines
911 }911 }
912 break;912 break;
913 case ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION: {913 case ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION: {
914 int32_t iValue = * ((int32_t*)pOption);914 int32_t iValue = * (static_cast<int32_t*>(pOption));
915 if (((iValue > INCREASING_ID) || (m_pEncContext->pSvcParam->iSpsPpsIdStrategy > INCREASING_ID))915 EParameterSetStrategy eNewStrategy = CONSTANT_ID;
916 && m_pEncContext->pSvcParam->iSpsPpsIdStrategy != iValue) {916 switch (iValue) {
917 case 0:
918 eNewStrategy = CONSTANT_ID;
919 break;
920 case 0x01:
921 eNewStrategy = INCREASING_ID;
922 break;
923 case 0x02:
924 eNewStrategy = SPS_LISTING;
925 break;
926 case 0x03:
927 eNewStrategy = SPS_LISTING_AND_PPS_INCREASING;
928 break;
929 case 0x06:
930 eNewStrategy = SPS_PPS_LISTING;
931 break;
932 default:
933 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
934 " CWelsH264SVCEncoder::SetOption eSpsPpsIdStrategy(%d) not in valid range, unchanged! existing=%d",
935 iValue, m_pEncContext->pSvcParam->eSpsPpsIdStrategy);
936 break;
937 }
938
939 if (((eNewStrategy & SPS_LISTING) || (m_pEncContext->pSvcParam->eSpsPpsIdStrategy & SPS_LISTING))
940 && m_pEncContext->pSvcParam->eSpsPpsIdStrategy != eNewStrategy) {
917 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,941 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",942 " CWelsH264SVCEncoder::SetOption eSpsPpsIdStrategy changing in the middle of call is NOT allowed for eSpsPpsIdStrategy>INCREASING_ID: existing setting is %d and the new one is %d",
919 m_pEncContext->pSvcParam->iSpsPpsIdStrategy, iValue);943 m_pEncContext->pSvcParam->eSpsPpsIdStrategy, iValue);
920 return cmInitParaError;944 return cmInitParaError;
921 }945 }
922 m_pEncContext->pSvcParam->iSpsPpsIdStrategy = iValue;946 m_pEncContext->pSvcParam->eSpsPpsIdStrategy = eNewStrategy;
923 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption iSpsPpsIdStrategy = %d ",947 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption eSpsPpsIdStrategy = %d ",
924 m_pEncContext->pSvcParam->iSpsPpsIdStrategy);948 m_pEncContext->pSvcParam->eSpsPpsIdStrategy);
925 }949 }
926 break;950 break;
927 case ENCODER_OPTION_CURRENT_PATH: {951 case ENCODER_OPTION_CURRENT_PATH: {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t