Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 16 files). Show all
Unified · Split
| @@ -131,11 +131,11 @@ CWelsH264SVCEncoder::CWelsH264SVCEncoder() · 130 unmodified lines | |||
| 131 | 131 | ||
| 132 | CWelsH264SVCEncoder::~CWelsH264SVCEncoder() { | 132 | CWelsH264SVCEncoder::~CWelsH264SVCEncoder() { |
| 133 | if (m_pWelsTrace) { | 133 | if (m_pWelsTrace) { |
| 134 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::~CWelsH264SVCEncoder()\n"); | 134 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::~CWelsH264SVCEncoder()"); |
| 135 | 135 | ||
| 136 | #ifdef REC_FRAME_COUNT | 136 | #ifdef REC_FRAME_COUNT |
| 137 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 137 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 138 | "CWelsH264SVCEncoder::~CWelsH264SVCEncoder(), m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, | 138 | "CWelsH264SVCEncoder::~CWelsH264SVCEncoder(), m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", m_uiCountFrameNum, |
| 139 | m_iCspInternal); | 139 | m_iCspInternal); |
| 140 | #endif | 140 | #endif |
| 141 | } | 141 | } |
| @@ -177,7 +177,7 @@ void CWelsH264SVCEncoder::InitEncoder (void) { · 35 unmodified lines | |||
| 177 | VERSION_NUMBER); | 177 | VERSION_NUMBER); |
| 178 | #ifdef REC_FRAME_COUNT | 178 | #ifdef REC_FRAME_COUNT |
| 179 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 179 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 180 | "CWelsH264SVCEncoder::InitEncoder, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); | 180 | "CWelsH264SVCEncoder::InitEncoder, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", m_uiCountFrameNum, m_iCspInternal); |
| 181 | #endif | 181 | #endif |
| 182 | } | 182 | } |
| 183 | 183 | ||
| @@ -197,7 +197,7 @@ int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) { · 13 unmodified lines | |||
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | if (NULL == argv) { | 199 | if (NULL == argv) { |
| 200 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p\n", | 200 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p", |
| 201 | argv); | 201 | argv); |
| 202 | return cmInitParaError; | 202 | return cmInitParaError; |
| 203 | } | 203 | } |
| @@ -206,7 +206,7 @@ int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) { · 2 unmodified lines | |||
| 206 | // Convert SEncParamBase into WelsSVCParamConfig here.. | 206 | // Convert SEncParamBase into WelsSVCParamConfig here.. |
| 207 | if (sConfig.ParamBaseTranscode (*argv)) { | 207 | if (sConfig.ParamBaseTranscode (*argv)) { |
| 208 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 208 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 209 | "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n"); | 209 | "CWelsH264SVCEncoder::Initialize(), parameter_translation failed."); |
| 210 | Uninitialize(); | 210 | Uninitialize(); |
| 211 | return cmInitParaError; | 211 | return cmInitParaError; |
| 212 | } | 212 | } |
| @@ -220,7 +220,7 @@ int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { · 7 unmodified lines | |||
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | if (NULL == argv) { | 222 | if (NULL == argv) { |
| 223 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::InitializeExt(), invalid argv= 0x%p\n", | 223 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::InitializeExt(), invalid argv= 0x%p", |
| 224 | argv); | 224 | argv); |
| 225 | return cmInitParaError; | 225 | return cmInitParaError; |
| 226 | } | 226 | } |
| @@ -229,7 +229,7 @@ int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { · 2 unmodified lines | |||
| 229 | // Convert SEncParamExt into WelsSVCParamConfig here.. | 229 | // Convert SEncParamExt into WelsSVCParamConfig here.. |
| 230 | if (sConfig.ParamTranscode (*argv)) { | 230 | if (sConfig.ParamTranscode (*argv)) { |
| 231 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 231 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 232 | "CWelsH264SVCEncoder::InitializeExt(), parameter_translation failed.\n"); | 232 | "CWelsH264SVCEncoder::InitializeExt(), parameter_translation failed."); |
| 233 | Uninitialize(); | 233 | Uninitialize(); |
| 234 | return cmInitParaError; | 234 | return cmInitParaError; |
| 235 | } | 235 | } |
| @@ -239,14 +239,14 @@ int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { · 3 unmodified lines | |||
| 239 | 239 | ||
| 240 | int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { | 240 | int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { |
| 241 | if (NULL == pCfg) { | 241 | if (NULL == pCfg) { |
| 242 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n", | 242 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.", |
| 243 | pCfg); | 243 | pCfg); |
| 244 | return cmInitParaError; | 244 | return cmInitParaError; |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | if (m_bInitialFlag) { | 247 | if (m_bInitialFlag) { |
| 248 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | 248 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 249 | "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", | 249 | "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.", |
| 250 | m_bInitialFlag); | 250 | m_bInitialFlag); |
| 251 | Uninitialize(); | 251 | Uninitialize(); |
| 252 | } | 252 | } |
| @@ -254,10 +254,10 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 254 | #ifdef REC_FRAME_COUNT | 254 | #ifdef REC_FRAME_COUNT |
| 255 | SWelsSvcCodingParam& sEncodingParam = *pCfg; | 255 | SWelsSvcCodingParam& sEncodingParam = *pCfg; |
| 256 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 256 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 257 | "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 257 | "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 258 | m_uiCountFrameNum, m_iCspInternal); | 258 | m_uiCountFrameNum, m_iCspInternal); |
| 259 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 259 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 260 | "coding_param->iPicWidth= %d;coding_param->iPicHeight= %d;coding_param->iTargetBitrate= %d;coding_param->iRCMode= %d;coding_param->iTemporalLayerNum= %d;coding_param->iSpatialLayerNum= %d;coding_param->fFrameRate= %.6ff;coding_param->iInputCsp= %d;coding_param->uiIntraPeriod= %d;coding_param->bEnableSpsPpsIdAddition = %d;coding_param->bPrefixNalAddingCtrl = %d;coding_param->bEnableDenoise= %d;coding_param->bEnableBackgroundDetection= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableFrameSkip= %d;coding_param->bEnableCropPic= %d;coding_param->bEnableLongTermReference= %d;coding_param->iLtrMarkPeriod= %d;\n", | 260 | "coding_param->iPicWidth= %d;coding_param->iPicHeight= %d;coding_param->iTargetBitrate= %d;coding_param->iRCMode= %d;coding_param->iTemporalLayerNum= %d;coding_param->iSpatialLayerNum= %d;coding_param->fFrameRate= %.6ff;coding_param->iInputCsp= %d;coding_param->uiIntraPeriod= %d;coding_param->bEnableSpsPpsIdAddition = %d;coding_param->bPrefixNalAddingCtrl = %d;coding_param->bEnableDenoise= %d;coding_param->bEnableBackgroundDetection= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableFrameSkip= %d;coding_param->bEnableCropPic= %d;coding_param->bEnableLongTermReference= %d;coding_param->iLtrMarkPeriod= %d;", |
| 261 | sEncodingParam.iPicWidth, | 261 | sEncodingParam.iPicWidth, |
| 262 | sEncodingParam.iPicHeight, | 262 | sEncodingParam.iPicHeight, |
| 263 | sEncodingParam.iTargetBitrate, | 263 | sEncodingParam.iTargetBitrate, |
| @@ -280,7 +280,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 16 unmodified lines | |||
| 280 | while (i < sEncodingParam.iSpatialLayerNum) { | 280 | while (i < sEncodingParam.iSpatialLayerNum) { |
| 281 | SSpatialLayerConfig* spatial_cfg = &sEncodingParam.sSpatialLayers[i]; | 281 | SSpatialLayerConfig* spatial_cfg = &sEncodingParam.sSpatialLayers[i]; |
| 282 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 282 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 283 | "coding_param->sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.uiSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;\n", | 283 | "coding_param->sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.uiSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;", |
| 284 | i, spatial_cfg->iVideoWidth, | 284 | i, spatial_cfg->iVideoWidth, |
| 285 | spatial_cfg->iVideoHeight, | 285 | spatial_cfg->iVideoHeight, |
| 286 | spatial_cfg->fFrameRate, | 286 | spatial_cfg->fFrameRate, |
| @@ -297,7 +297,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 10 unmodified lines | |||
| 297 | const int32_t iNumOfLayers = pCfg->iSpatialLayerNum; | 297 | const int32_t iNumOfLayers = pCfg->iSpatialLayerNum; |
| 298 | if (iNumOfLayers < 1 || iNumOfLayers > MAX_DEPENDENCY_LAYER) { | 298 | if (iNumOfLayers < 1 || iNumOfLayers > MAX_DEPENDENCY_LAYER) { |
| 299 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 299 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 300 | "CWelsH264SVCEncoder::Initialize(), invalid iSpatialLayerNum= %d, valid at range of [1, %d].\n", iNumOfLayers, | 300 | "CWelsH264SVCEncoder::Initialize(), invalid iSpatialLayerNum= %d, valid at range of [1, %d].", iNumOfLayers, |
| 301 | MAX_DEPENDENCY_LAYER); | 301 | MAX_DEPENDENCY_LAYER); |
| 302 | Uninitialize(); | 302 | Uninitialize(); |
| 303 | return cmInitParaError; | 303 | return cmInitParaError; |
| @@ -306,7 +306,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 2 unmodified lines | |||
| 306 | pCfg->iTemporalLayerNum = 1; | 306 | pCfg->iTemporalLayerNum = 1; |
| 307 | if (pCfg->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) { | 307 | if (pCfg->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) { |
| 308 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 308 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 309 | "CWelsH264SVCEncoder::Initialize(), invalid iTemporalLayerNum= %d, valid at range of [1, %d].\n", | 309 | "CWelsH264SVCEncoder::Initialize(), invalid iTemporalLayerNum= %d, valid at range of [1, %d].", |
| 310 | pCfg->iTemporalLayerNum, MAX_TEMPORAL_LEVEL); | 310 | pCfg->iTemporalLayerNum, MAX_TEMPORAL_LEVEL); |
| 311 | Uninitialize(); | 311 | Uninitialize(); |
| 312 | return cmInitParaError; | 312 | return cmInitParaError; |
| @@ -316,7 +316,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 3 unmodified lines | |||
| 316 | 316 | ||
| 317 | if (pCfg->uiGopSize < 1 || pCfg->uiGopSize > MAX_GOP_SIZE) { | 317 | if (pCfg->uiGopSize < 1 || pCfg->uiGopSize > MAX_GOP_SIZE) { |
| 318 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 318 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 319 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d].\n", pCfg->uiGopSize, | 319 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d].", pCfg->uiGopSize, |
| 320 | MAX_GOP_SIZE); | 320 | MAX_GOP_SIZE); |
| 321 | Uninitialize(); | 321 | Uninitialize(); |
| 322 | return cmInitParaError; | 322 | return cmInitParaError; |
| @@ -324,7 +324,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 324 | 324 | ||
| 325 | if (!WELS_POWER2_IF (pCfg->uiGopSize)) { | 325 | if (!WELS_POWER2_IF (pCfg->uiGopSize)) { |
| 326 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 326 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 327 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d] and yield to power of 2.\n", | 327 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d] and yield to power of 2.", |
| 328 | pCfg->uiGopSize, MAX_GOP_SIZE); | 328 | pCfg->uiGopSize, MAX_GOP_SIZE); |
| 329 | Uninitialize(); | 329 | Uninitialize(); |
| 330 | return cmInitParaError; | 330 | return cmInitParaError; |
| @@ -332,7 +332,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 332 | 332 | ||
| 333 | if (pCfg->uiIntraPeriod && pCfg->uiIntraPeriod < pCfg->uiGopSize) { | 333 | if (pCfg->uiIntraPeriod && pCfg->uiIntraPeriod < pCfg->uiGopSize) { |
| 334 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 334 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 335 | "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d.\n", | 335 | "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d.", |
| 336 | pCfg->uiIntraPeriod, pCfg->uiGopSize); | 336 | pCfg->uiIntraPeriod, pCfg->uiGopSize); |
| 337 | Uninitialize(); | 337 | Uninitialize(); |
| 338 | return cmInitParaError; | 338 | return cmInitParaError; |
| @@ -340,7 +340,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 340 | 340 | ||
| 341 | if ((pCfg->uiIntraPeriod && (pCfg->uiIntraPeriod & (pCfg->uiGopSize - 1)) != 0)) { | 341 | if ((pCfg->uiIntraPeriod && (pCfg->uiIntraPeriod & (pCfg->uiGopSize - 1)) != 0)) { |
| 342 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 342 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 343 | "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", | 343 | "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.", |
| 344 | pCfg->uiIntraPeriod, pCfg->uiGopSize); | 344 | pCfg->uiIntraPeriod, pCfg->uiGopSize); |
| 345 | Uninitialize(); | 345 | Uninitialize(); |
| 346 | return cmInitParaError; | 346 | return cmInitParaError; |
| @@ -379,7 +379,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 32 unmodified lines | |||
| 379 | m_iMaxPicHeight = pCfg->iPicHeight; | 379 | m_iMaxPicHeight = pCfg->iPicHeight; |
| 380 | 380 | ||
| 381 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx)) { | 381 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx)) { |
| 382 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed.\n"); | 382 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed."); |
| 383 | Uninitialize(); | 383 | Uninitialize(); |
| 384 | return cmInitParaError; | 384 | return cmInitParaError; |
| 385 | } | 385 | } |
| @@ -397,11 +397,11 @@ int32_t CWelsH264SVCEncoder::Uninitialize() { · 11 unmodified lines | |||
| 397 | return 0; | 397 | return 0; |
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::Uninitialize()..\n"); | 400 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::Uninitialize().."); |
| 401 | 401 | ||
| 402 | #ifdef REC_FRAME_COUNT | 402 | #ifdef REC_FRAME_COUNT |
| 403 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 403 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 404 | "CWelsH264SVCEncoder::Uninitialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); | 404 | "CWelsH264SVCEncoder::Uninitialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", m_uiCountFrameNum, m_iCspInternal); |
| 405 | #endif//REC_FRAME_COUNT | 405 | #endif//REC_FRAME_COUNT |
| 406 | 406 | ||
| 407 | if (NULL != m_pEncContext) { | 407 | if (NULL != m_pEncContext) { |
| @@ -433,7 +433,7 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn · 25 unmodified lines | |||
| 433 | #ifdef REC_FRAME_COUNT | 433 | #ifdef REC_FRAME_COUNT |
| 434 | ++ m_uiCountFrameNum; | 434 | ++ m_uiCountFrameNum; |
| 435 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 435 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 436 | "CWelsH264SVCEncoder::EncodeFrame(), m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); | 436 | "CWelsH264SVCEncoder::EncodeFrame(), m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", m_uiCountFrameNum, m_iCspInternal); |
| 437 | #endif//REC_FRAME_COUNT | 437 | #endif//REC_FRAME_COUNT |
| 438 | 438 | ||
| 439 | #ifdef DUMP_SRC_PICTURE | 439 | #ifdef DUMP_SRC_PICTURE |
| @@ -450,7 +450,7 @@ int CWelsH264SVCEncoder::EncodeFrameInternal (const SSourcePicture* pSrcPic, SF · 10 unmodified lines | |||
| 450 | WelsUninitEncoderExt (&m_pEncContext); | 450 | WelsUninitEncoderExt (&m_pEncContext); |
| 451 | return cmMallocMemeError; | 451 | return cmMallocMemeError; |
| 452 | } else if ((kiEncoderReturn != ENC_RETURN_SUCCESS) && (kiEncoderReturn == ENC_RETURN_CORRECTED)) { | 452 | } else if ((kiEncoderReturn != ENC_RETURN_SUCCESS) && (kiEncoderReturn == ENC_RETURN_CORRECTED)) { |
| 453 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!\n", | 453 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!", |
| 454 | kiEncoderReturn); | 454 | kiEncoderReturn); |
| 455 | return cmUnkonwReason; | 455 | return cmUnkonwReason; |
| 456 | } | 456 | } |
| @@ -519,7 +519,7 @@ int CWelsH264SVCEncoder::ForceIntraFrame (bool bIDR) { · 62 unmodified lines | |||
| 519 | 519 | ||
| 520 | #ifdef REC_FRAME_COUNT | 520 | #ifdef REC_FRAME_COUNT |
| 521 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 521 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 522 | "CWelsH264SVCEncoder::ForceIntraFrame(), bIDR= %d, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", bIDR, | 522 | "CWelsH264SVCEncoder::ForceIntraFrame(), bIDR= %d, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", bIDR, |
| 523 | m_uiCountFrameNum, m_iCspInternal); | 523 | m_uiCountFrameNum, m_iCspInternal); |
| 524 | #endif//REC_FRAME_COUNT | 524 | #endif//REC_FRAME_COUNT |
| 525 | 525 | ||
| @@ -532,13 +532,13 @@ void CWelsH264SVCEncoder::CheckProfileSetting (int32_t iLayer, EProfileIdc uiPro · 6 unmodified lines | |||
| 532 | pLayerInfo->uiProfileIdc = uiProfileIdc; | 532 | pLayerInfo->uiProfileIdc = uiProfileIdc; |
| 533 | if ((iLayer == SPATIAL_LAYER_0) && (uiProfileIdc != PRO_BASELINE)) { | 533 | if ((iLayer == SPATIAL_LAYER_0) && (uiProfileIdc != PRO_BASELINE)) { |
| 534 | pLayerInfo->uiProfileIdc = PRO_BASELINE; | 534 | pLayerInfo->uiProfileIdc = PRO_BASELINE; |
| 535 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support profile(%d),change to baseline profile\n", | 535 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support profile(%d),change to baseline profile", |
| 536 | uiProfileIdc); | 536 | uiProfileIdc); |
| 537 | } | 537 | } |
| 538 | if (iLayer > SPATIAL_LAYER_0) { | 538 | if (iLayer > SPATIAL_LAYER_0) { |
| 539 | if ((uiProfileIdc != PRO_BASELINE) || (uiProfileIdc != PRO_SCALABLE_BASELINE)) { | 539 | if ((uiProfileIdc != PRO_BASELINE) || (uiProfileIdc != PRO_SCALABLE_BASELINE)) { |
| 540 | pLayerInfo->uiProfileIdc = PRO_BASELINE; | 540 | pLayerInfo->uiProfileIdc = PRO_BASELINE; |
| 541 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support profile(%d),change to baseline profile\n", | 541 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support profile(%d),change to baseline profile", |
| 542 | uiProfileIdc); | 542 | uiProfileIdc); |
| 543 | } | 543 | } |
| 544 | } | 544 | } |
| @@ -548,7 +548,7 @@ void CWelsH264SVCEncoder::CheckLevelSetting (int32_t iLayer, ELevelIdc uiLevelId · 3 unmodified lines | |||
| 548 | pLayerInfo->uiLevelIdc = uiLevelIdc; | 548 | pLayerInfo->uiLevelIdc = uiLevelIdc; |
| 549 | if ((uiLevelIdc < LEVEL_1_0) || (uiLevelIdc > LEVEL_5_2)) { | 549 | if ((uiLevelIdc < LEVEL_1_0) || (uiLevelIdc > LEVEL_5_2)) { |
| 550 | pLayerInfo->uiLevelIdc = LEVEL_5_2; | 550 | pLayerInfo->uiLevelIdc = LEVEL_5_2; |
| 551 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support level(%d) change to LEVEL_5_2\n", uiLevelIdc); | 551 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, "doesn't support level(%d) change to LEVEL_5_2", uiLevelIdc); |
| 552 | } | 552 | } |
| 553 | } | 553 | } |
| 554 | void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) { | 554 | void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) { |
| @@ -556,7 +556,7 @@ void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) { · 1 unmodified line | |||
| 556 | if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > MAX_REFERENCE_PICTURE_COUNT_NUM)) { | 556 | if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > MAX_REFERENCE_PICTURE_COUNT_NUM)) { |
| 557 | m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT; | 557 | m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT; |
| 558 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, | 558 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 559 | "doesn't support the number of reference frame(%d) change to auto select mode\n", iNumRef); | 559 | "doesn't support the number of reference frame(%d) change to auto select mode", iNumRef); |
| 560 | } | 560 | } |
| 561 | } | 561 | } |
| 562 | /************************************************************************ | 562 | /************************************************************************ |
| @@ -575,7 +575,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 12 unmodified lines | |||
| 575 | switch (eOptionId) { | 575 | switch (eOptionId) { |
| 576 | case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag | 576 | case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag |
| 577 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 577 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 578 | "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present.\n"); | 578 | "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present."); |
| 579 | } | 579 | } |
| 580 | break; | 580 | break; |
| 581 | case ENCODER_OPTION_DATAFORMAT: { // Input color space | 581 | case ENCODER_OPTION_DATAFORMAT: { // Input color space |
| @@ -587,14 +587,14 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 5 unmodified lines | |||
| 587 | 587 | ||
| 588 | #ifdef REC_FRAME_COUNT | 588 | #ifdef REC_FRAME_COUNT |
| 589 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 589 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 590 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n", | 590 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d", |
| 591 | m_uiCountFrameNum, m_iCspInternal, iValue); | 591 | m_uiCountFrameNum, m_iCspInternal, iValue); |
| 592 | #endif//REC_FRAME_COUNT | 592 | #endif//REC_FRAME_COUNT |
| 593 | 593 | ||
| 594 | m_iCspInternal = iColorspace; | 594 | m_iCspInternal = iColorspace; |
| 595 | #ifdef REC_FRAME_COUNT | 595 | #ifdef REC_FRAME_COUNT |
| 596 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 596 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 597 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 597 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 598 | m_uiCountFrameNum, m_iCspInternal); | 598 | m_uiCountFrameNum, m_iCspInternal); |
| 599 | #endif//REC_FRAME_COUNT | 599 | #endif//REC_FRAME_COUNT |
| 600 | } | 600 | } |
| @@ -603,7 +603,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 2 unmodified lines | |||
| 603 | int32_t iValue = * ((int32_t*)pOption); | 603 | int32_t iValue = * ((int32_t*)pOption); |
| 604 | #ifdef REC_FRAME_COUNT | 604 | #ifdef REC_FRAME_COUNT |
| 605 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 605 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 606 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_IDR_INTERVAL, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n", | 606 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_IDR_INTERVAL, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d", |
| 607 | m_uiCountFrameNum, m_iCspInternal, iValue); | 607 | m_uiCountFrameNum, m_iCspInternal, iValue); |
| 608 | #endif//REC_FRAME_COUNT | 608 | #endif//REC_FRAME_COUNT |
| 609 | 609 | ||
| @@ -625,7 +625,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 15 unmodified lines | |||
| 625 | 625 | ||
| 626 | memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage | 626 | memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage |
| 627 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 627 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 628 | "coding_param->iPicWidth= %d;coding_param->iPicHeight= %d;coding_param->iTargetBitrate= %d; coding_param->iMaxBitrate= %d; coding_param->iRCMode= %d;coding_param->iPaddingFlag= %d;coding_param->iTemporalLayerNum= %d;coding_param->iSpatialLayerNum= %d;coding_param->fFrameRate= %.6ff;coding_param->uiIntraPeriod= %d;coding_param->bEnableSpsPpsIdAddition = %d;coding_param->bPrefixNalAddingCtrl = %d;coding_param->bEnableDenoise= %d;coding_param->bEnableBackgroundDetection= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableLongTermReference= %d;coding_param->iLtrMarkPeriod= %d;\n", | 628 | "coding_param->iPicWidth= %d;coding_param->iPicHeight= %d;coding_param->iTargetBitrate= %d; coding_param->iMaxBitrate= %d; coding_param->iRCMode= %d;coding_param->iPaddingFlag= %d;coding_param->iTemporalLayerNum= %d;coding_param->iSpatialLayerNum= %d;coding_param->fFrameRate= %.6ff;coding_param->uiIntraPeriod= %d;coding_param->bEnableSpsPpsIdAddition = %d;coding_param->bPrefixNalAddingCtrl = %d;coding_param->bEnableDenoise= %d;coding_param->bEnableBackgroundDetection= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableLongTermReference= %d;coding_param->iLtrMarkPeriod= %d;", |
| 629 | sEncodingParam.iPicWidth, | 629 | sEncodingParam.iPicWidth, |
| 630 | sEncodingParam.iPicHeight, | 630 | sEncodingParam.iPicHeight, |
| 631 | sEncodingParam.iTargetBitrate, | 631 | sEncodingParam.iTargetBitrate, |
| @@ -648,7 +648,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 16 unmodified lines | |||
| 648 | while (i < sEncodingParam.iSpatialLayerNum) { | 648 | while (i < sEncodingParam.iSpatialLayerNum) { |
| 649 | SSpatialLayerConfig* pSpatialCfg = &sEncodingParam.sSpatialLayers[i]; | 649 | SSpatialLayerConfig* pSpatialCfg = &sEncodingParam.sSpatialLayers[i]; |
| 650 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 650 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 651 | "coding_param->sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .iMaxSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.iSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;\n", | 651 | "coding_param->sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .iMaxSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.iSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;", |
| 652 | i, pSpatialCfg->iVideoWidth, | 652 | i, pSpatialCfg->iVideoWidth, |
| 653 | pSpatialCfg->iVideoHeight, | 653 | pSpatialCfg->iVideoHeight, |
| 654 | pSpatialCfg->fFrameRate, | 654 | pSpatialCfg->fFrameRate, |
| @@ -687,7 +687,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 32 unmodified lines | |||
| 687 | } | 687 | } |
| 688 | #ifdef REC_FRAME_COUNT | 688 | #ifdef REC_FRAME_COUNT |
| 689 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 689 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 690 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 690 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 691 | m_uiCountFrameNum, m_iCspInternal); | 691 | m_uiCountFrameNum, m_iCspInternal); |
| 692 | #endif//REC_FRAME_COUNT | 692 | #endif//REC_FRAME_COUNT |
| 693 | 693 | ||
| @@ -702,7 +702,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 8 unmodified lines | |||
| 702 | float iValue = * ((float*)pOption); | 702 | float iValue = * ((float*)pOption); |
| 703 | #ifdef REC_FRAME_COUNT | 703 | #ifdef REC_FRAME_COUNT |
| 704 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 704 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 705 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_FRAME_RATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %f\n", | 705 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_FRAME_RATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %f", |
| 706 | m_uiCountFrameNum, m_iCspInternal, iValue); | 706 | m_uiCountFrameNum, m_iCspInternal, iValue); |
| 707 | #endif//REC_FRAME_COUNT | 707 | #endif//REC_FRAME_COUNT |
| 708 | if (iValue <= 0) { | 708 | if (iValue <= 0) { |
| @@ -718,12 +718,12 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 9 unmodified lines | |||
| 718 | int32_t iBitrate = pInfo->iBitrate; | 718 | int32_t iBitrate = pInfo->iBitrate; |
| 719 | #ifdef REC_FRAME_COUNT | 719 | #ifdef REC_FRAME_COUNT |
| 720 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 720 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 721 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n", | 721 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d", |
| 722 | m_uiCountFrameNum, m_iCspInternal, iValue); | 722 | m_uiCountFrameNum, m_iCspInternal, iValue); |
| 723 | #endif//REC_FRAME_COUNT | 723 | #endif//REC_FRAME_COUNT |
| 724 | if (iBitrate <= 0) { | 724 | if (iBitrate <= 0) { |
| 725 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 725 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 726 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iBitrate = %d\n", | 726 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iBitrate = %d", |
| 727 | iBitrate); | 727 | iBitrate); |
| 728 | return cmInitParaError; | 728 | return cmInitParaError; |
| 729 | } | 729 | } |
| @@ -746,7 +746,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 16 unmodified lines | |||
| 746 | break; | 746 | break; |
| 747 | default: | 747 | default: |
| 748 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 748 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 749 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iLayer = %d\n", | 749 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE,iLayer = %d", |
| 750 | pInfo->iLayer); | 750 | pInfo->iLayer); |
| 751 | return cmInitParaError; | 751 | return cmInitParaError; |
| 752 | break; | 752 | break; |
| @@ -761,12 +761,12 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 8 unmodified lines | |||
| 761 | 761 | ||
| 762 | #ifdef REC_FRAME_COUNT | 762 | #ifdef REC_FRAME_COUNT |
| 763 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 763 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 764 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d\n", | 764 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x, iValue= %d", |
| 765 | m_uiCountFrameNum, m_iCspInternal, iValue); | 765 | m_uiCountFrameNum, m_iCspInternal, iValue); |
| 766 | #endif//REC_FRAME_COUNT | 766 | #endif//REC_FRAME_COUNT |
| 767 | if (iBitrate <= 0) { | 767 | if (iBitrate <= 0) { |
| 768 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 768 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 769 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iBitrate = %d\n", | 769 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iBitrate = %d", |
| 770 | iBitrate); | 770 | iBitrate); |
| 771 | return cmInitParaError; | 771 | return cmInitParaError; |
| 772 | } | 772 | } |
| @@ -789,7 +789,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 16 unmodified lines | |||
| 789 | break; | 789 | break; |
| 790 | default: | 790 | default: |
| 791 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 791 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 792 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iLayer = %d\n", | 792 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_MAX_BITRATE,iLayer = %d", |
| 793 | pInfo->iLayer); | 793 | pInfo->iLayer); |
| 794 | return cmInitParaError; | 794 | return cmInitParaError; |
| 795 | break; | 795 | break; |
| @@ -831,14 +831,14 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 35 unmodified lines | |||
| 831 | case ENCODER_OPTION_ENABLE_SSEI: { | 831 | case ENCODER_OPTION_ENABLE_SSEI: { |
| 832 | bool iValue = * ((bool*)pOption); | 832 | bool iValue = * ((bool*)pOption); |
| 833 | m_pEncContext->pSvcParam->bEnableSSEI = iValue; | 833 | m_pEncContext->pSvcParam->bEnableSSEI = iValue; |
| 834 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable SSEI = %d \n", | 834 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable SSEI = %d ", |
| 835 | m_pEncContext->pSvcParam->bEnableSSEI); | 835 | m_pEncContext->pSvcParam->bEnableSSEI); |
| 836 | } | 836 | } |
| 837 | break; | 837 | break; |
| 838 | case ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING: { | 838 | case ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING: { |
| 839 | bool iValue = * ((bool*)pOption); | 839 | bool iValue = * ((bool*)pOption); |
| 840 | m_pEncContext->pSvcParam->bPrefixNalAddingCtrl = iValue; | 840 | m_pEncContext->pSvcParam->bPrefixNalAddingCtrl = iValue; |
| 841 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption bPrefixNalAddingCtrl = %d \n", | 841 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption bPrefixNalAddingCtrl = %d ", |
| 842 | m_pEncContext->pSvcParam->bPrefixNalAddingCtrl); | 842 | m_pEncContext->pSvcParam->bPrefixNalAddingCtrl); |
| 843 | } | 843 | } |
| 844 | break; | 844 | break; |
| @@ -846,7 +846,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 1 unmodified line | |||
| 846 | bool iValue = * ((bool*)pOption); | 846 | bool iValue = * ((bool*)pOption); |
| 847 | 847 | ||
| 848 | m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition = iValue; | 848 | m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition = iValue; |
| 849 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable SPS/PPS ID = %d \n", | 849 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable SPS/PPS ID = %d ", |
| 850 | m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition); | 850 | m_pEncContext->pSvcParam->bEnableSpsPpsIdAddition); |
| 851 | } | 851 | } |
| 852 | break; | 852 | break; |
| @@ -892,7 +892,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 39 unmodified lines | |||
| 892 | SProfileInfo* pProfileInfo = (static_cast<SProfileInfo*> (pOption)); | 892 | SProfileInfo* pProfileInfo = (static_cast<SProfileInfo*> (pOption)); |
| 893 | if ((pProfileInfo->iLayer < SPATIAL_LAYER_0) || (pProfileInfo->iLayer > SPATIAL_LAYER_3)) { | 893 | if ((pProfileInfo->iLayer < SPATIAL_LAYER_0) || (pProfileInfo->iLayer > SPATIAL_LAYER_3)) { |
| 894 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 894 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 895 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)\n", pProfileInfo->iLayer); | 895 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)", pProfileInfo->iLayer); |
| 896 | return cmInitParaError; | 896 | return cmInitParaError; |
| 897 | } | 897 | } |
| 898 | CheckProfileSetting (pProfileInfo->iLayer, pProfileInfo->uiProfileIdc); | 898 | CheckProfileSetting (pProfileInfo->iLayer, pProfileInfo->uiProfileIdc); |
| @@ -902,7 +902,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 3 unmodified lines | |||
| 902 | SLevelInfo* pLevelInfo = (static_cast<SLevelInfo*> (pOption)); | 902 | SLevelInfo* pLevelInfo = (static_cast<SLevelInfo*> (pOption)); |
| 903 | if ((pLevelInfo->iLayer < SPATIAL_LAYER_0) || (pLevelInfo->iLayer > SPATIAL_LAYER_3)) { | 903 | if ((pLevelInfo->iLayer < SPATIAL_LAYER_0) || (pLevelInfo->iLayer > SPATIAL_LAYER_3)) { |
| 904 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, | 904 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 905 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)\n", pLevelInfo->iLayer); | 905 | "CWelsH264SVCEncoder::SetOption():ENCODER_OPTION_PROFILE,iLayer = %d(rang0-3)", pLevelInfo->iLayer); |
| 906 | return cmInitParaError; | 906 | return cmInitParaError; |
| 907 | } | 907 | } |
| 908 | CheckLevelSetting (pLevelInfo->iLayer, pLevelInfo->uiLevelIdc); | 908 | CheckLevelSetting (pLevelInfo->iLayer, pLevelInfo->uiLevelIdc); |
| @@ -941,13 +941,13 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 32 unmodified lines | |||
| 941 | switch (eOptionId) { | 941 | switch (eOptionId) { |
| 942 | case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag | 942 | case ENCODER_OPTION_INTER_SPATIAL_PRED: { // Inter spatial layer prediction flag |
| 943 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 943 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 944 | "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present.\n"); | 944 | "ENCODER_OPTION_INTER_SPATIAL_PRED, this feature not supported at present."); |
| 945 | } | 945 | } |
| 946 | break; | 946 | break; |
| 947 | case ENCODER_OPTION_DATAFORMAT: { // Input color space | 947 | case ENCODER_OPTION_DATAFORMAT: { // Input color space |
| 948 | #ifdef REC_FRAME_COUNT | 948 | #ifdef REC_FRAME_COUNT |
| 949 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 949 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 950 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 950 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_DATAFORMAT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 951 | m_uiCountFrameNum, m_iCspInternal); | 951 | m_uiCountFrameNum, m_iCspInternal); |
| 952 | #endif//REC_FRAME_COUNT | 952 | #endif//REC_FRAME_COUNT |
| 953 | 953 | ||
| @@ -957,7 +957,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 3 unmodified lines | |||
| 957 | case ENCODER_OPTION_IDR_INTERVAL: { // IDR Interval | 957 | case ENCODER_OPTION_IDR_INTERVAL: { // IDR Interval |
| 958 | #ifdef REC_FRAME_COUNT | 958 | #ifdef REC_FRAME_COUNT |
| 959 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 959 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 960 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_IDR_INTERVAL, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 960 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_IDR_INTERVAL, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 961 | m_uiCountFrameNum, m_iCspInternal); | 961 | m_uiCountFrameNum, m_iCspInternal); |
| 962 | #endif//REC_FRAME_COUNT | 962 | #endif//REC_FRAME_COUNT |
| 963 | * ((int32_t*)pOption) = m_pEncContext->pSvcParam->uiIntraPeriod; | 963 | * ((int32_t*)pOption) = m_pEncContext->pSvcParam->uiIntraPeriod; |
| @@ -966,7 +966,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 2 unmodified lines | |||
| 966 | case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: { // SVC Encoding Parameter | 966 | case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: { // SVC Encoding Parameter |
| 967 | #ifdef REC_FRAME_COUNT | 967 | #ifdef REC_FRAME_COUNT |
| 968 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 968 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 969 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 969 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 970 | m_uiCountFrameNum, m_iCspInternal); | 970 | m_uiCountFrameNum, m_iCspInternal); |
| 971 | #endif//REC_FRAME_COUNT | 971 | #endif//REC_FRAME_COUNT |
| 972 | memcpy (pOption, m_pEncContext->pSvcParam, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage | 972 | memcpy (pOption, m_pEncContext->pSvcParam, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage |
| @@ -975,7 +975,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 2 unmodified lines | |||
| 975 | case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter | 975 | case ENCODER_OPTION_SVC_ENCODE_PARAM_BASE: { // SVC Encoding Parameter |
| 976 | #ifdef REC_FRAME_COUNT | 976 | #ifdef REC_FRAME_COUNT |
| 977 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 977 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 978 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 978 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 979 | m_uiCountFrameNum, m_iCspInternal); | 979 | m_uiCountFrameNum, m_iCspInternal); |
| 980 | #endif//REC_FRAME_COUNT | 980 | #endif//REC_FRAME_COUNT |
| 981 | m_pEncContext->pSvcParam->GetBaseParams ((SEncParamBase*) pOption); | 981 | m_pEncContext->pSvcParam->GetBaseParams ((SEncParamBase*) pOption); |
| @@ -985,7 +985,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 3 unmodified lines | |||
| 985 | case ENCODER_OPTION_FRAME_RATE: { // Maximal input frame rate | 985 | case ENCODER_OPTION_FRAME_RATE: { // Maximal input frame rate |
| 986 | #ifdef REC_FRAME_COUNT | 986 | #ifdef REC_FRAME_COUNT |
| 987 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 987 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 988 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_FRAME_RATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 988 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_FRAME_RATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 989 | m_uiCountFrameNum, m_iCspInternal); | 989 | m_uiCountFrameNum, m_iCspInternal); |
| 990 | #endif//REC_FRAME_COUNT | 990 | #endif//REC_FRAME_COUNT |
| 991 | * ((float*)pOption) = m_pEncContext->pSvcParam->fMaxFrameRate; | 991 | * ((float*)pOption) = m_pEncContext->pSvcParam->fMaxFrameRate; |
| @@ -994,7 +994,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 2 unmodified lines | |||
| 994 | case ENCODER_OPTION_BITRATE: { // Target bit-rate | 994 | case ENCODER_OPTION_BITRATE: { // Target bit-rate |
| 995 | #ifdef REC_FRAME_COUNT | 995 | #ifdef REC_FRAME_COUNT |
| 996 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 996 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 997 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 997 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 998 | m_uiCountFrameNum, m_iCspInternal); | 998 | m_uiCountFrameNum, m_iCspInternal); |
| 999 | #endif//REC_FRAME_COUNT | 999 | #endif//REC_FRAME_COUNT |
| 1000 | SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption)); | 1000 | SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption)); |
| @@ -1011,7 +1011,7 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) { · 10 unmodified lines | |||
| 1011 | case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate | 1011 | case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate |
| 1012 | #ifdef REC_FRAME_COUNT | 1012 | #ifdef REC_FRAME_COUNT |
| 1013 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, | 1013 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 1014 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_MAX_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 1014 | "CWelsH264SVCEncoder::GetOption():ENCODER_OPTION_MAX_BITRATE, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x", |
| 1015 | m_uiCountFrameNum, m_iCspInternal); | 1015 | m_uiCountFrameNum, m_iCspInternal); |
| 1016 | #endif//REC_FRAME_COUNT | 1016 | #endif//REC_FRAME_COUNT |
| 1017 | SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption)); | 1017 | SBitrateInfo* pInfo = (static_cast<SBitrateInfo*> (pOption)); |
| @@ -1057,7 +1057,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 39 unmodified lines | |||
| 1057 | case videoFormatYV12: | 1057 | case videoFormatYV12: |
| 1058 | WelsStrcat (strFileName, 256, "yuv"); // confirmed_safe_unsafe_usage | 1058 | WelsStrcat (strFileName, 256, "yuv"); // confirmed_safe_unsafe_usage |
| 1059 | pFile = WelsFopen (strFileName, "ab+"); | 1059 | pFile = WelsFopen (strFileName, "ab+"); |
| 1060 | // WelsLog( &m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "WELS_CSP_I420, m_iCspInternal= 0x%x\n", m_iCspInternal); | 1060 | // WelsLog( &m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "WELS_CSP_I420, m_iCspInternal= 0x%x", m_iCspInternal); |
| 1061 | if (NULL != pFile) { | 1061 | if (NULL != pFile) { |
| 1062 | fwrite (pSrc, sizeof (uint8_t), (iDataLength * 3) >> 1, pFile); | 1062 | fwrite (pSrc, sizeof (uint8_t), (iDataLength * 3) >> 1, pFile); |
| 1063 | fflush (pFile); | 1063 | fflush (pFile); |
| @@ -1075,7 +1075,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 11 unmodified lines | |||
| 1075 | case videoFormatBGR: | 1075 | case videoFormatBGR: |
| 1076 | WelsStrcat (strFileName, 256, "bgr"); // confirmed_safe_unsafe_usage | 1076 | WelsStrcat (strFileName, 256, "bgr"); // confirmed_safe_unsafe_usage |
| 1077 | pFile = WelsFopen (strFileName, "ab+"); | 1077 | pFile = WelsFopen (strFileName, "ab+"); |
| 1078 | // WelsLog( &m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "WELS_CSP_BGR, m_iCspInternal= 0x%x\n", m_iCspInternal); | 1078 | // WelsLog( &m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "WELS_CSP_BGR, m_iCspInternal= 0x%x", m_iCspInternal); |
| 1079 | if (NULL != pFile) { | 1079 | if (NULL != pFile) { |
| 1080 | fwrite (pSrc, sizeof (uint8_t), iDataLength * 3, pFile); | 1080 | fwrite (pSrc, sizeof (uint8_t), iDataLength * 3, pFile); |
| 1081 | fflush (pFile); | 1081 | fflush (pFile); |
| @@ -1092,7 +1092,7 @@ void CWelsH264SVCEncoder::DumpSrcPicture (const uint8_t* pSrc) { · 10 unmodified lines | |||
| 1092 | } | 1092 | } |
| 1093 | break; | 1093 | break; |
| 1094 | default: | 1094 | default: |
| 1095 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "Exclusive case, m_iCspInternal= 0x%x\n", m_iCspInternal); | 1095 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "Exclusive case, m_iCspInternal= 0x%x", m_iCspInternal); |
| 1096 | break; | 1096 | break; |
| 1097 | } | 1097 | } |
| 1098 | #endif//DUMP_SRC_PICTURE | 1098 | #endif//DUMP_SRC_PICTURE |