Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 4 files). Show all
Unified · Split
| @@ -343,7 +343,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 342 unmodified lines | |||
| 343 | m_iMaxPicWidth = pCfg->iPicWidth; | 343 | m_iMaxPicWidth = pCfg->iPicWidth; |
| 344 | m_iMaxPicHeight = pCfg->iPicHeight; | 344 | m_iMaxPicHeight = pCfg->iPicHeight; |
| 345 | 345 | ||
| 346 | TraceParamInfo(pCfg); | 346 | TraceParamInfo (pCfg); |
| 347 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx)) { | 347 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx)) { |
| 348 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed."); | 348 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed."); |
| 349 | Uninitialize(); | 349 | Uninitialize(); |
| @@ -525,57 +525,57 @@ void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) { · 175 unmodified lines | |||
| 525 | "doesn't support the number of reference frame(%d) change to auto select mode", iNumRef); | 525 | "doesn't support the number of reference frame(%d) change to auto select mode", iNumRef); |
| 526 | } | 526 | } |
| 527 | } | 527 | } |
| 528 | void CWelsH264SVCEncoder::TraceParamInfo(SEncParamExt *pParam){ | 528 | void CWelsH264SVCEncoder::TraceParamInfo (SEncParamExt* pParam) { |
| 529 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 529 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 530 | "iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;iMaxBitrate= %d;iRCMode= %d;iPaddingFlag= %d;iTemporalLayerNum= %d;iSpatialLayerNum= %d;fFrameRate= %.6ff;uiIntraPeriod= %d;\ | 530 | "iUsageType = %d,iPicWidth= %d;iPicHeight= %d;iTargetBitrate= %d;iMaxBitrate= %d;iRCMode= %d;iPaddingFlag= %d;iTemporalLayerNum= %d;iSpatialLayerNum= %d;fFrameRate= %.6ff;uiIntraPeriod= %d;\ |
| 531 | bEnableSpsPpsIdAddition = %d;bPrefixNalAddingCtrl = %d;bEnableDenoise= %d;bEnableBackgroundDetection= %d;bEnableAdaptiveQuant= %d;bEnableFrameSkip= %d;bEnableLongTermReference= %d;iLtrMarkPeriod= %d;\ | 531 | bEnableSpsPpsIdAddition = %d;bPrefixNalAddingCtrl = %d;bEnableDenoise= %d;bEnableBackgroundDetection= %d;bEnableAdaptiveQuant= %d;bEnableFrameSkip= %d;bEnableLongTermReference= %d;iLtrMarkPeriod= %d;\ |
| 532 | iComplexityMode = %d;iNumRefFrame = %d;iEntropyCodingModeFlag = %d;uiMaxNalSize = %d;iLTRRefNum = %d;iMultipleThreadIdc = %d;iLoopFilterDisableIdc = %d", | 532 | iComplexityMode = %d;iNumRefFrame = %d;iEntropyCodingModeFlag = %d;uiMaxNalSize = %d;iLTRRefNum = %d;iMultipleThreadIdc = %d;iLoopFilterDisableIdc = %d", |
| 533 | pParam->iUsageType, | 533 | pParam->iUsageType, |
| 534 | pParam->iPicWidth, | 534 | pParam->iPicWidth, |
| 535 | pParam->iPicHeight, | 535 | pParam->iPicHeight, |
| 536 | pParam->iTargetBitrate, | 536 | pParam->iTargetBitrate, |
| 537 | pParam->iMaxBitrate, | 537 | pParam->iMaxBitrate, |
| 538 | pParam->iRCMode, | 538 | pParam->iRCMode, |
| 539 | pParam->iPaddingFlag, | 539 | pParam->iPaddingFlag, |
| 540 | pParam->iTemporalLayerNum, | 540 | pParam->iTemporalLayerNum, |
| 541 | pParam->iSpatialLayerNum, | 541 | pParam->iSpatialLayerNum, |
| 542 | pParam->fMaxFrameRate, | 542 | pParam->fMaxFrameRate, |
| 543 | pParam->uiIntraPeriod, | 543 | pParam->uiIntraPeriod, |
| 544 | pParam->bEnableSpsPpsIdAddition, | 544 | pParam->bEnableSpsPpsIdAddition, |
| 545 | pParam->bPrefixNalAddingCtrl, | 545 | pParam->bPrefixNalAddingCtrl, |
| 546 | pParam->bEnableDenoise, | 546 | pParam->bEnableDenoise, |
| 547 | pParam->bEnableBackgroundDetection, | 547 | pParam->bEnableBackgroundDetection, |
| 548 | pParam->bEnableAdaptiveQuant, | 548 | pParam->bEnableAdaptiveQuant, |
| 549 | pParam->bEnableFrameSkip, | 549 | pParam->bEnableFrameSkip, |
| 550 | pParam->bEnableLongTermReference, | 550 | pParam->bEnableLongTermReference, |
| 551 | pParam->iLtrMarkPeriod, | 551 | pParam->iLtrMarkPeriod, |
| 552 | pParam->iComplexityMode, | 552 | pParam->iComplexityMode, |
| 553 | pParam->iNumRefFrame, | 553 | pParam->iNumRefFrame, |
| 554 | pParam->iEntropyCodingModeFlag, | 554 | pParam->iEntropyCodingModeFlag, |
| 555 | pParam->uiMaxNalSize, | 555 | pParam->uiMaxNalSize, |
| 556 | pParam->iLTRRefNum, | 556 | pParam->iLTRRefNum, |
| 557 | pParam->iMultipleThreadIdc, | 557 | pParam->iMultipleThreadIdc, |
| 558 | pParam->iLoopFilterDisableIdc | 558 | pParam->iLoopFilterDisableIdc |
| 559 | ); | 559 | ); |
| 560 | int32_t i = 0; | 560 | int32_t i = 0; |
| 561 | while (i < pParam->iSpatialLayerNum) { | 561 | while (i < pParam->iSpatialLayerNum) { |
| 562 | SSpatialLayerConfig* pSpatialCfg = &pParam->sSpatialLayers[i]; | 562 | SSpatialLayerConfig* pSpatialCfg = &pParam->sSpatialLayers[i]; |
| 563 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 563 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 564 | "sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .iMaxSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.iSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;\ | 564 | "sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .iMaxSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.iSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;\ |
| 565 | uiProfileIdc = %d;uiLevelIdc = %d", | 565 | uiProfileIdc = %d;uiLevelIdc = %d", |
| 566 | i, pSpatialCfg->iVideoWidth, | 566 | i, pSpatialCfg->iVideoWidth, |
| 567 | pSpatialCfg->iVideoHeight, | 567 | pSpatialCfg->iVideoHeight, |
| 568 | pSpatialCfg->fFrameRate, | 568 | pSpatialCfg->fFrameRate, |
| 569 | pSpatialCfg->iSpatialBitrate, | 569 | pSpatialCfg->iSpatialBitrate, |
| 570 | pSpatialCfg->iMaxSpatialBitrate, | 570 | pSpatialCfg->iMaxSpatialBitrate, |
| 571 | pSpatialCfg->sSliceCfg.uiSliceMode, | 571 | pSpatialCfg->sSliceCfg.uiSliceMode, |
| 572 | pSpatialCfg->sSliceCfg.sSliceArgument.uiSliceNum, | 572 | pSpatialCfg->sSliceCfg.sSliceArgument.uiSliceNum, |
| 573 | pSpatialCfg->sSliceCfg.sSliceArgument.uiSliceSizeConstraint, | 573 | pSpatialCfg->sSliceCfg.sSliceArgument.uiSliceSizeConstraint, |
| 574 | pSpatialCfg->uiProfileIdc, | 574 | pSpatialCfg->uiProfileIdc, |
| 575 | pSpatialCfg->uiLevelIdc | 575 | pSpatialCfg->uiLevelIdc |
| 576 | ); | 576 | ); |
| 577 | ++ i; | 577 | ++ i; |
| 578 | } | 578 | } |
| 579 | } | 579 | } |
| 580 | /************************************************************************ | 580 | /************************************************************************ |
| 581 | * InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,.. | 581 | * InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,.. |
| @@ -642,7 +642,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 60 unmodified lines | |||
| 642 | int32_t iTargetHeight = 0; | 642 | int32_t iTargetHeight = 0; |
| 643 | 643 | ||
| 644 | memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage | 644 | memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage |
| 645 | TraceParamInfo(&sEncodingParam); | 645 | TraceParamInfo (&sEncodingParam); |
| 646 | #ifdef OUTPUT_BIT_STREAM | 646 | #ifdef OUTPUT_BIT_STREAM |
| 647 | if (sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoWidth != | 647 | if (sEncodingParam.sSpatialLayers[sEncodingParam.iSpatialLayerNum - 1].iVideoWidth != |
| 648 | m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - 1].iActualWidth) { | 648 | m_pEncContext->pSvcParam->sDependencyLayers[m_pEncContext->pSvcParam->iSpatialLayerNum - 1].iActualWidth) { |
| @@ -808,7 +808,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 159 unmodified lines | |||
| 808 | break; | 808 | break; |
| 809 | case ENCODER_OPTION_LTR: { | 809 | case ENCODER_OPTION_LTR: { |
| 810 | SLTRConfig* pLTRValue = ((SLTRConfig*) (pOption)); | 810 | SLTRConfig* pLTRValue = ((SLTRConfig*) (pOption)); |
| 811 | WelsEncoderApplyLTR (&m_pWelsTrace->m_sLogCtx, m_pEncContext, pLTRValue); | 811 | WelsEncoderApplyLTR (&m_pWelsTrace->m_sLogCtx, &m_pEncContext, pLTRValue); |
| 812 | } | 812 | } |
| 813 | break; | 813 | break; |
| 814 | case ENCODER_OPTION_ENABLE_SSEI: { | 814 | case ENCODER_OPTION_ENABLE_SSEI: { |