Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -233,8 +233,25 @@ int CWelsH264SVCEncoder::Initialize (SEncParamBase* argv, const INIT_TYPE iInitT · 232 unmodified lines | |||
| 233 | return cmInitParaError; | 233 | return cmInitParaError; |
| 234 | } | 234 | } |
| 235 | } | 235 | } |
| 236 | |||
| 237 | return Initialize2 (&sConfig); | ||
| 238 | } | ||
| 239 | |||
| 240 | int CWelsH264SVCEncoder::Initialize2 (SWelsSvcCodingParam* pCfg) { | ||
| 241 | if (NULL == pCfg) { | ||
| 242 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n", | ||
| 243 | pCfg); | ||
| 244 | return cmInitParaError; | ||
| 245 | } | ||
| 246 | |||
| 247 | if (m_bInitialFlag) { | ||
| 248 | WelsLog (m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", | ||
| 249 | m_bInitialFlag); | ||
| 250 | Uninitialize(); | ||
| 251 | } | ||
| 252 | |||
| 236 | #ifdef REC_FRAME_COUNT | 253 | #ifdef REC_FRAME_COUNT |
| 237 | SWelsSvcCodingParam &sEncodingParam = sConfig; | 254 | SWelsSvcCodingParam &sEncodingParam = *pCfg; |
| 238 | WelsLog (m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 255 | WelsLog (m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", |
| 239 | m_uiCountFrameNum, m_iCspInternal); | 256 | m_uiCountFrameNum, m_iCspInternal); |
| 240 | WelsLog (m_pEncContext, WELS_LOG_INFO, | 257 | WelsLog (m_pEncContext, WELS_LOG_INFO, |
| @@ -277,22 +294,6 @@ int CWelsH264SVCEncoder::Initialize (SEncParamBase* argv, const INIT_TYPE iInitT · 36 unmodified lines | |||
| 277 | } | 294 | } |
| 278 | #endif//REC_FRAME_COUNT | 295 | #endif//REC_FRAME_COUNT |
| 279 | 296 | ||
| 280 | return Initialize2 (&sConfig); | ||
| 281 | } | ||
| 282 | |||
| 283 | int CWelsH264SVCEncoder::Initialize2 (SWelsSvcCodingParam* pCfg) { | ||
| 284 | if (NULL == pCfg) { | ||
| 285 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n", | ||
| 286 | pCfg); | ||
| 287 | return cmInitParaError; | ||
| 288 | } | ||
| 289 | |||
| 290 | if (m_bInitialFlag) { | ||
| 291 | WelsLog (m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", | ||
| 292 | m_bInitialFlag); | ||
| 293 | Uninitialize(); | ||
| 294 | } | ||
| 295 | |||
| 296 | const int32_t iColorspace = pCfg->iInputCsp; | 297 | const int32_t iColorspace = pCfg->iInputCsp; |
| 297 | if (0 == iColorspace) { | 298 | if (0 == iColorspace) { |
| 298 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n", iColorspace); | 299 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n", iColorspace); |