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
487487 void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) {
488488 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
489489 "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;\
491491 iComplexityMode = %d;iNumRefFrame = %d;iEntropyCodingModeFlag = %d;uiMaxNalSize = %d;iLTRRefNum = %d;iMultipleThreadIdc = %d;iLoopFilterDisableIdc = %d (offset(alpha/beta): %d,%d)",
492492 pParam->iUsageType,
493493 pParam->iPicWidth,
@@ -500,7 +500,7 @@ void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { · 6 unmodified lines
500500 pParam->iSpatialLayerNum,
501501 pParam->fMaxFrameRate,
502502 pParam->uiIntraPeriod,
503− pParam->iSpsPpsIdStrategy,
503+ pParam->eSpsPpsIdStrategy,
504504 pParam->bPrefixNalAddingCtrl,
505505 pParam->bEnableDenoise,
506506 pParam->bEnableBackgroundDetection,
@@ -911,17 +911,41 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 404 unmodified lines
911911 }
912912 break;
913913 case ENCODER_OPTION_ENABLE_SPS_PPS_ID_ADDITION: {
914− int32_t iValue = * ((int32_t*)pOption);
915− if (((iValue > INCREASING_ID) || (m_pEncContext->pSvcParam->iSpsPpsIdStrategy > INCREASING_ID))
916− && m_pEncContext->pSvcParam->iSpsPpsIdStrategy != iValue) {
914+ int32_t iValue = * (static_cast<int32_t*>(pOption));
915+ EParameterSetStrategy eNewStrategy = CONSTANT_ID;
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) {
917941 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);
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",
943+ m_pEncContext->pSvcParam->eSpsPpsIdStrategy, iValue);
920944 return cmInitParaError;
921945 }
922− m_pEncContext->pSvcParam->iSpsPpsIdStrategy = iValue;
923− WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption iSpsPpsIdStrategy = %d ",
924− m_pEncContext->pSvcParam->iSpsPpsIdStrategy);
946+ m_pEncContext->pSvcParam->eSpsPpsIdStrategy = eNewStrategy;
947+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption eSpsPpsIdStrategy = %d ",
948+ m_pEncContext->pSvcParam->eSpsPpsIdStrategy);
925949 }
926950 break;
927951 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