Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 6 files). Show all
Unified · Split
| @@ -258,7 +258,7 @@ CWelsH264SVCEncoder::~CWelsH264SVCEncoder() · 257 unmodified lines | |||
| 258 | m_iSwitchTimes = 0; | 258 | m_iSwitchTimes = 0; |
| 259 | #endif//OUTPUT_BIT_STREAM | 259 | #endif//OUTPUT_BIT_STREAM |
| 260 | 260 | ||
| 261 | Unintialize(); | 261 | Uninitialize(); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | void CWelsH264SVCEncoder::InitEncoder( void ) | 264 | void CWelsH264SVCEncoder::InitEncoder( void ) |
| @@ -301,7 +301,7 @@ int CWelsH264SVCEncoder::Initialize(SVCEncodingParam* argv, const INIT_TYPE iIni · 36 unmodified lines | |||
| 301 | if ( m_bInitialFlag ) | 301 | if ( m_bInitialFlag ) |
| 302 | { | 302 | { |
| 303 | WelsLog(m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d\n", m_bInitialFlag); | 303 | WelsLog(m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d\n", m_bInitialFlag); |
| 304 | Unintialize(); | 304 | Uninitialize(); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | SVCEncodingParam sEncodingParam; | 307 | SVCEncodingParam sEncodingParam; |
| @@ -352,7 +352,7 @@ int CWelsH264SVCEncoder::Initialize(SVCEncodingParam* argv, const INIT_TYPE iIni · 44 unmodified lines | |||
| 352 | // Convert SVCEncodingParam into WelsSVCParamConfig here.. | 352 | // Convert SVCEncodingParam into WelsSVCParamConfig here.. |
| 353 | if ( sConfig.ParamTranscode( sEncodingParam, true ) ){ | 353 | if ( sConfig.ParamTranscode( sEncodingParam, true ) ){ |
| 354 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n"); | 354 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n"); |
| 355 | Unintialize(); | 355 | Uninitialize(); |
| 356 | return cmInitParaError; | 356 | return cmInitParaError; |
| 357 | } | 357 | } |
| 358 | 358 | ||
| @@ -372,7 +372,7 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 13 unmodified lines | |||
| 372 | if ( m_bInitialFlag ) | 372 | if ( m_bInitialFlag ) |
| 373 | { | 373 | { |
| 374 | WelsLog(m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", m_bInitialFlag); | 374 | WelsLog(m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", m_bInitialFlag); |
| 375 | Unintialize(); | 375 | Uninitialize(); |
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | SWelsSvcCodingParam *pCfg = static_cast<SWelsSvcCodingParam*>(argv); | 378 | SWelsSvcCodingParam *pCfg = static_cast<SWelsSvcCodingParam*>(argv); |
| @@ -381,7 +381,7 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 2 unmodified lines | |||
| 381 | if ( 0 == iColorspace ) | 381 | if ( 0 == iColorspace ) |
| 382 | { | 382 | { |
| 383 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n", iColorspace); | 383 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n", iColorspace); |
| 384 | Unintialize(); | 384 | Uninitialize(); |
| 385 | return cmInitParaError; | 385 | return cmInitParaError; |
| 386 | } | 386 | } |
| 387 | 387 | ||
| @@ -389,14 +389,14 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 1 unmodified line | |||
| 389 | const int32_t iNumOfLayers = pCfg->iNumDependencyLayer; | 389 | const int32_t iNumOfLayers = pCfg->iNumDependencyLayer; |
| 390 | if ( iNumOfLayers < 1 || iNumOfLayers > MAX_DEPENDENCY_LAYER ){ | 390 | if ( iNumOfLayers < 1 || iNumOfLayers > MAX_DEPENDENCY_LAYER ){ |
| 391 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iNumDependencyLayer= %d, valid at range of [1, %d].\n", iNumOfLayers, MAX_DEPENDENCY_LAYER); | 391 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iNumDependencyLayer= %d, valid at range of [1, %d].\n", iNumOfLayers, MAX_DEPENDENCY_LAYER); |
| 392 | Unintialize(); | 392 | Uninitialize(); |
| 393 | return cmInitParaError; | 393 | return cmInitParaError; |
| 394 | } | 394 | } |
| 395 | if ( pCfg->iNumTemporalLayer < 1 ) | 395 | if ( pCfg->iNumTemporalLayer < 1 ) |
| 396 | pCfg->iNumTemporalLayer = 1; | 396 | pCfg->iNumTemporalLayer = 1; |
| 397 | if ( pCfg->iNumTemporalLayer > MAX_TEMPORAL_LEVEL ){ | 397 | if ( pCfg->iNumTemporalLayer > MAX_TEMPORAL_LEVEL ){ |
| 398 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iNumTemporalLayer= %d, valid at range of [1, %d].\n", pCfg->iNumTemporalLayer, MAX_TEMPORAL_LEVEL); | 398 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iNumTemporalLayer= %d, valid at range of [1, %d].\n", pCfg->iNumTemporalLayer, MAX_TEMPORAL_LEVEL); |
| 399 | Unintialize(); | 399 | Uninitialize(); |
| 400 | return cmInitParaError; | 400 | return cmInitParaError; |
| 401 | } | 401 | } |
| 402 | 402 | ||
| @@ -404,27 +404,27 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 1 unmodified line | |||
| 404 | 404 | ||
| 405 | if ( pCfg->uiGopSize < 1 || pCfg->uiGopSize > MAX_GOP_SIZE ){ | 405 | if ( pCfg->uiGopSize < 1 || pCfg->uiGopSize > MAX_GOP_SIZE ){ |
| 406 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d].\n", pCfg->uiGopSize, MAX_GOP_SIZE); | 406 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d].\n", pCfg->uiGopSize, MAX_GOP_SIZE); |
| 407 | Unintialize(); | 407 | Uninitialize(); |
| 408 | return cmInitParaError; | 408 | return cmInitParaError; |
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | if ( !WELS_POWER2_IF(pCfg->uiGopSize) ){ | 411 | if ( !WELS_POWER2_IF(pCfg->uiGopSize) ){ |
| 412 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d] and yield to power of 2.\n", pCfg->uiGopSize, MAX_GOP_SIZE); | 412 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d] and yield to power of 2.\n", pCfg->uiGopSize, MAX_GOP_SIZE); |
| 413 | Unintialize(); | 413 | Uninitialize(); |
| 414 | return cmInitParaError; | 414 | return cmInitParaError; |
| 415 | } | 415 | } |
| 416 | 416 | ||
| 417 | if ( pCfg->uiIntraPeriod && pCfg->uiIntraPeriod < pCfg->uiGopSize ) | 417 | if ( pCfg->uiIntraPeriod && pCfg->uiIntraPeriod < pCfg->uiGopSize ) |
| 418 | { | 418 | { |
| 419 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d.\n", pCfg->uiIntraPeriod, pCfg->uiGopSize); | 419 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d.\n", pCfg->uiIntraPeriod, pCfg->uiGopSize); |
| 420 | Unintialize(); | 420 | Uninitialize(); |
| 421 | return cmInitParaError; | 421 | return cmInitParaError; |
| 422 | } | 422 | } |
| 423 | 423 | ||
| 424 | if ( ( pCfg->uiIntraPeriod && (pCfg->uiIntraPeriod & (pCfg->uiGopSize-1)) != 0) ) | 424 | if ( ( pCfg->uiIntraPeriod && (pCfg->uiIntraPeriod & (pCfg->uiGopSize-1)) != 0) ) |
| 425 | { | 425 | { |
| 426 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d also multiple of it.\n", pCfg->uiIntraPeriod, pCfg->uiGopSize); | 426 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d also multiple of it.\n", pCfg->uiIntraPeriod, pCfg->uiGopSize); |
| 427 | Unintialize(); | 427 | Uninitialize(); |
| 428 | return cmInitParaError; | 428 | return cmInitParaError; |
| 429 | } | 429 | } |
| 430 | 430 | ||
| @@ -455,7 +455,7 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 24 unmodified lines | |||
| 455 | 455 | ||
| 456 | if ( NULL == m_pSrcPicList ){ | 456 | if ( NULL == m_pSrcPicList ){ |
| 457 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), pOut of memory due m_pSrcPicList memory request.\n"); | 457 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), pOut of memory due m_pSrcPicList memory request.\n"); |
| 458 | Unintialize(); | 458 | Uninitialize(); |
| 459 | return cmMallocMemeError; | 459 | return cmMallocMemeError; |
| 460 | } | 460 | } |
| 461 | 461 | ||
| @@ -473,7 +473,7 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 11 unmodified lines | |||
| 473 | if ( NULL == m_pSrcPicList[i] ) | 473 | if ( NULL == m_pSrcPicList[i] ) |
| 474 | { | 474 | { |
| 475 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), pOut of memory due m_pSrcPicList[%d] memory request.\n", i); | 475 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), pOut of memory due m_pSrcPicList[%d] memory request.\n", i); |
| 476 | Unintialize(); | 476 | Uninitialize(); |
| 477 | m_iSrcListSize = 0; | 477 | m_iSrcListSize = 0; |
| 478 | return cmMallocMemeError; | 478 | return cmMallocMemeError; |
| 479 | } | 479 | } |
| @@ -503,7 +503,7 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 23 unmodified lines | |||
| 503 | if ( WelsInitEncoderExt( &m_pEncContext, pCfg ) ) | 503 | if ( WelsInitEncoderExt( &m_pEncContext, pCfg ) ) |
| 504 | { | 504 | { |
| 505 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed.\n"); | 505 | WelsLog(m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed.\n"); |
| 506 | Unintialize(); | 506 | Uninitialize(); |
| 507 | return cmInitParaError; | 507 | return cmInitParaError; |
| 508 | } | 508 | } |
| 509 | 509 | ||
| @@ -516,17 +516,17 @@ int CWelsH264SVCEncoder::Initialize(void * argv, const INIT_TYPE iInitType) · 6 unmodified lines | |||
| 516 | /* | 516 | /* |
| 517 | * SVC Encoder Uninitialization | 517 | * SVC Encoder Uninitialization |
| 518 | */ | 518 | */ |
| 519 | int32_t CWelsH264SVCEncoder::Unintialize() | 519 | int32_t CWelsH264SVCEncoder::Uninitialize() |
| 520 | { | 520 | { |
| 521 | if ( !m_bInitialFlag ) | 521 | if ( !m_bInitialFlag ) |
| 522 | { | 522 | { |
| 523 | return 0; | 523 | return 0; |
| 524 | } | 524 | } |
| 525 | 525 | ||
| 526 | WelsLog( m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Unintialize()..\n" ); | 526 | WelsLog( m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Uninitialize()..\n" ); |
| 527 | 527 | ||
| 528 | #ifdef REC_FRAME_COUNT | 528 | #ifdef REC_FRAME_COUNT |
| 529 | WelsLog( m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Unintialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal ); | 529 | WelsLog( m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Uninitialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal ); |
| 530 | #endif//REC_FRAME_COUNT | 530 | #endif//REC_FRAME_COUNT |
| 531 | 531 | ||
| 532 | if ( NULL != m_pEncContext ) | 532 | if ( NULL != m_pEncContext ) |