Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 64 files). Show all
Unified · Split
| @@ -124,8 +124,8 @@ CWelsH264SVCEncoder::CWelsH264SVCEncoder() · 123 unmodified lines | |||
| 124 | m_pFileBs = WelsFopen (strStreamFileName, "wb"); | 124 | m_pFileBs = WelsFopen (strStreamFileName, "wb"); |
| 125 | m_pFileBsSize = WelsFopen (strLenFileName, "wb"); | 125 | m_pFileBsSize = WelsFopen (strLenFileName, "wb"); |
| 126 | 126 | ||
| 127 | m_bSwitch = false; | 127 | m_bSwitch = false; |
| 128 | m_iSwitchTimes = 0; | 128 | m_iSwitchTimes = 0; |
| 129 | #endif//OUTPUT_BIT_STREAM | 129 | #endif//OUTPUT_BIT_STREAM |
| 130 | 130 | ||
| 131 | InitEncoder(); | 131 | InitEncoder(); |
| @@ -149,8 +149,8 @@ CWelsH264SVCEncoder::~CWelsH264SVCEncoder() { · 17 unmodified lines | |||
| 149 | WelsFclose (m_pFileBsSize); | 149 | WelsFclose (m_pFileBsSize); |
| 150 | m_pFileBsSize = NULL; | 150 | m_pFileBsSize = NULL; |
| 151 | } | 151 | } |
| 152 | m_bSwitch = false; | 152 | m_bSwitch = false; |
| 153 | m_iSwitchTimes = 0; | 153 | m_iSwitchTimes = 0; |
| 154 | #endif//OUTPUT_BIT_STREAM | 154 | #endif//OUTPUT_BIT_STREAM |
| 155 | 155 | ||
| 156 | Uninitialize(); | 156 | Uninitialize(); |
| @@ -323,13 +323,13 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 166 unmodified lines | |||
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | const int32_t kiDecStages = WELS_LOG2 (pCfg->uiGopSize); | 325 | const int32_t kiDecStages = WELS_LOG2 (pCfg->uiGopSize); |
| 326 | pCfg->iTemporalLayerNum = (int8_t) (1 + kiDecStages); | 326 | pCfg->iTemporalLayerNum = (int8_t) (1 + kiDecStages); |
| 327 | pCfg->iLoopFilterAlphaC0Offset = WELS_CLIP3 (pCfg->iLoopFilterAlphaC0Offset, -6, 6); | 327 | pCfg->iLoopFilterAlphaC0Offset = WELS_CLIP3 (pCfg->iLoopFilterAlphaC0Offset, -6, 6); |
| 328 | pCfg->iLoopFilterBetaOffset = WELS_CLIP3 (pCfg->iLoopFilterBetaOffset, -6, 6); | 328 | pCfg->iLoopFilterBetaOffset = WELS_CLIP3 (pCfg->iLoopFilterBetaOffset, -6, 6); |
| 329 | 329 | ||
| 330 | // decide property list size between INIT_TYPE_PARAMETER_BASED/INIT_TYPE_CONFIG_BASED | 330 | // decide property list size between INIT_TYPE_PARAMETER_BASED/INIT_TYPE_CONFIG_BASED |
| 331 | m_iMaxPicWidth = pCfg->iPicWidth; | 331 | m_iMaxPicWidth = pCfg->iPicWidth; |
| 332 | m_iMaxPicHeight = pCfg->iPicHeight; | 332 | m_iMaxPicHeight = pCfg->iPicHeight; |
| 333 | 333 | ||
| 334 | TraceParamInfo (pCfg); | 334 | TraceParamInfo (pCfg); |
| 335 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx, NULL)) { | 335 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx, NULL)) { |
| @@ -683,9 +683,9 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 347 unmodified lines | |||
| 683 | m_pEncContext->pSvcParam->uiIntraPeriod = (uint32_t)iValue; | 683 | m_pEncContext->pSvcParam->uiIntraPeriod = (uint32_t)iValue; |
| 684 | } | 684 | } |
| 685 | break; | 685 | break; |
| 686 | case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter | 686 | case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter |
| 687 | SEncParamBase sEncodingParam; | 687 | SEncParamBase sEncodingParam; |
| 688 | SWelsSvcCodingParam sConfig; | 688 | SWelsSvcCodingParam sConfig; |
| 689 | int32_t iTargetWidth = 0; | 689 | int32_t iTargetWidth = 0; |
| 690 | int32_t iTargetHeight = 0; | 690 | int32_t iTargetHeight = 0; |
| 691 | 691 | ||
| @@ -694,12 +694,12 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 2 unmodified lines | |||
| 694 | return cmInitParaError; | 694 | return cmInitParaError; |
| 695 | } | 695 | } |
| 696 | /* New configuration available here */ | 696 | /* New configuration available here */ |
| 697 | iTargetWidth = sConfig.iPicWidth; | 697 | iTargetWidth = sConfig.iPicWidth; |
| 698 | iTargetHeight = sConfig.iPicHeight; | 698 | iTargetHeight = sConfig.iPicHeight; |
| 699 | if (m_iMaxPicWidth != iTargetWidth | 699 | if (m_iMaxPicWidth != iTargetWidth |
| 700 | || m_iMaxPicHeight != iTargetHeight) { | 700 | || m_iMaxPicHeight != iTargetHeight) { |
| 701 | m_iMaxPicWidth = iTargetWidth; | 701 | m_iMaxPicWidth = iTargetWidth; |
| 702 | m_iMaxPicHeight = iTargetHeight; | 702 | m_iMaxPicHeight = iTargetHeight; |
| 703 | } | 703 | } |
| 704 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 704 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 705 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;fMaxFrameRate= %.6ff;iRCMode= %d", | 705 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;fMaxFrameRate= %.6ff;iRCMode= %d", |
| @@ -715,9 +715,9 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 9 unmodified lines | |||
| 715 | } | 715 | } |
| 716 | break; | 716 | break; |
| 717 | 717 | ||
| 718 | case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: { // SVC Encoding Parameter | 718 | case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: { // SVC Encoding Parameter |
| 719 | SEncParamExt sEncodingParam; | 719 | SEncParamExt sEncodingParam; |
| 720 | SWelsSvcCodingParam sConfig; | 720 | SWelsSvcCodingParam sConfig; |
| 721 | int32_t iTargetWidth = 0; | 721 | int32_t iTargetWidth = 0; |
| 722 | int32_t iTargetHeight = 0; | 722 | int32_t iTargetHeight = 0; |
| 723 | 723 | ||
| @@ -756,12 +756,12 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 32 unmodified lines | |||
| 756 | } | 756 | } |
| 757 | 757 | ||
| 758 | /* New configuration available here */ | 758 | /* New configuration available here */ |
| 759 | iTargetWidth = sConfig.iPicWidth; | 759 | iTargetWidth = sConfig.iPicWidth; |
| 760 | iTargetHeight = sConfig.iPicHeight; | 760 | iTargetHeight = sConfig.iPicHeight; |
| 761 | if (m_iMaxPicWidth != iTargetWidth | 761 | if (m_iMaxPicWidth != iTargetWidth |
| 762 | || m_iMaxPicHeight != iTargetHeight) { | 762 | || m_iMaxPicHeight != iTargetHeight) { |
| 763 | m_iMaxPicWidth = iTargetWidth; | 763 | m_iMaxPicWidth = iTargetWidth; |
| 764 | m_iMaxPicHeight = iTargetHeight; | 764 | m_iMaxPicHeight = iTargetHeight; |
| 765 | } | 765 | } |
| 766 | /* Check every field whether there is new request for memory block changed or else, Oct. 24, 2008 */ | 766 | /* Check every field whether there is new request for memory block changed or else, Oct. 24, 2008 */ |
| 767 | if (WelsEncoderParamAdjust (&m_pEncContext, &sConfig)) { | 767 | if (WelsEncoderParamAdjust (&m_pEncContext, &sConfig)) { |