Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -730,7 +730,18 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 729 unmodified lines | ||
| 730 | 730 | int32_t iTargetHeight = 0; |
| 731 | 731 | |
| 732 | 732 | 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 | |
| 733 | 742 | if (sConfig.ParamBaseTranscode (sEncodingParam)) { |
| 743 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | |
| 744 | + "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, ParamTranscode failed!"); | |
| 734 | 745 | return cmInitParaError; |
| 735 | 746 | } |
| 736 | 747 | /* New configuration available here */ |
| @@ -742,7 +753,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 5 unmodified lines | ||
| 742 | 753 | m_iMaxPicHeight = iTargetHeight; |
| 743 | 754 | } |
| 744 | 755 | if (sConfig.DetermineTemporalSettings()) { |
| 745 | − WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 756 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | |
| 746 | 757 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, DetermineTemporalSettings failed!"); |
| 747 | 758 | return cmInitParaError; |
| 748 | 759 | } |
| @@ -757,6 +768,11 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 8 unmodified lines | ||
| 757 | 768 | if (WelsEncoderParamAdjust (&m_pEncContext, &sConfig)) { |
| 758 | 769 | return cmInitParaError; |
| 759 | 770 | } |
| 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); | |
| 760 | 776 | } |
| 761 | 777 | break; |
| 762 | 778 | |
| @@ -769,33 +785,35 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 6 unmodified lines | ||
| 769 | 785 | memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage |
| 770 | 786 | TraceParamInfo (&sEncodingParam); |
| 771 | 787 | #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)) { | |
| 774 | 792 | ++ m_iSwitchTimes; |
| 775 | 793 | m_bSwitch = true; |
| 776 | 794 | } |
| 777 | 795 | #endif//OUTPUT_BIT_STREAM |
| 778 | 796 | if (sEncodingParam.iSpatialLayerNum < 1 |
| 779 | 797 | || 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, | |
| 781 | 799 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, iSpatialLayerNum(%d) failed!", |
| 782 | 800 | sEncodingParam.iSpatialLayerNum); |
| 783 | 801 | return cmInitParaError; |
| 784 | 802 | } |
| 785 | 803 | |
| 786 | 804 | if (sConfig.ParamTranscode (sEncodingParam)) { |
| 787 | − WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 805 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | |
| 788 | 806 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, ParamTranscode failed!"); |
| 789 | 807 | return cmInitParaError; |
| 790 | 808 | } |
| 791 | 809 | if (sConfig.iSpatialLayerNum < 1) { |
| 792 | − WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 810 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | |
| 793 | 811 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, iSpatialLayerNum(%d) failed!", |
| 794 | 812 | sConfig.iSpatialLayerNum); |
| 795 | 813 | return cmInitParaError; |
| 796 | 814 | } |
| 797 | 815 | if (sConfig.DetermineTemporalSettings()) { |
| 798 | − WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | |
| 816 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | |
| 799 | 817 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, DetermineTemporalSettings failed!"); |
| 800 | 818 | return cmInitParaError; |
| 801 | 819 | } |