History

make BaseOption set align with extOption

huili2 committed 9 years ago

Commit 75f242d1 parent 05d13b41 file · +25 −7Browse files

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

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+25−7
@@ -730,7 +730,18 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 729 unmodified lines
730730 int32_t iTargetHeight = 0;
731731
732732 memcpy (&sEncodingParam, pOption, sizeof (SEncParamBase)); // confirmed_safe_unsafe_usage
733+#ifdef OUTPUT_BIT_STREAM
734+ if ((sEncodingParam.iPicWidth != m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum
735+ - 1].iActualWidth) ||
736+ (sEncodingParam.iPicHeight != m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum -
737+ 1].iActualHeight)) {
738+ ++m_iSwitchTimes;
739+ m_bSwitch = true;
740+ }
741+#endif//OUTPUT_BIT_STREAM
733742 if (sConfig.ParamBaseTranscode (sEncodingParam)) {
743+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
744+ "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, ParamTranscode failed!");
734745 return cmInitParaError;
735746 }
736747 /* New configuration available here */
@@ -742,7 +753,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 5 unmodified lines
742753 m_iMaxPicHeight = iTargetHeight;
743754 }
744755 if (sConfig.DetermineTemporalSettings()) {
745− WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
756+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
746757 "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, DetermineTemporalSettings failed!");
747758 return cmInitParaError;
748759 }
@@ -757,6 +768,11 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 8 unmodified lines
757768 if (WelsEncoderParamAdjust (&m_pEncContext, &sConfig)) {
758769 return cmInitParaError;
759770 }
771+
772+ //LogStatistics
773+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
774+ "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, LogStatisticsBeforeNewEncoding");
775+ LogStatistics (m_pEncContext->iLastStatisticsLogTs, 0);
760776 }
761777 break;
762778
@@ -769,33 +785,35 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 6 unmodified lines
769785 memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage
770786 TraceParamInfo (&sEncodingParam);
771787 #ifdef OUTPUT_BIT_STREAM
772− if (sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoWidth !=
773− m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - 1].iActualWidth) {
788+ if ((sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoWidth !=
789+ m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - 1].iActualWidth) ||
790+ (sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoHeight !=
791+ m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - 1].iActualHeight)) {
774792 ++ m_iSwitchTimes;
775793 m_bSwitch = true;
776794 }
777795 #endif//OUTPUT_BIT_STREAM
778796 if (sEncodingParam.iSpatialLayerNum < 1
779797 || sEncodingParam.iSpatialLayerNum > MAX_SPATIAL_LAYER_NUM) { // verify number of spatial layer
780− WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
798+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
781799 "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, iSpatialLayerNum(%d) failed!",
782800 sEncodingParam.iSpatialLayerNum);
783801 return cmInitParaError;
784802 }
785803
786804 if (sConfig.ParamTranscode (sEncodingParam)) {
787− WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
805+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
788806 "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, ParamTranscode failed!");
789807 return cmInitParaError;
790808 }
791809 if (sConfig.iSpatialLayerNum < 1) {
792− WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
810+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
793811 "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, iSpatialLayerNum(%d) failed!",
794812 sConfig.iSpatialLayerNum);
795813 return cmInitParaError;
796814 }
797815 if (sConfig.DetermineTemporalSettings()) {
798− WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
816+ WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR,
799817 "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, DetermineTemporalSettings failed!");
800818 return cmInitParaError;
801819 }

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