Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 5 files). Show all
Unified · Split
| @@ -131,17 +131,15 @@ CWelsH264SVCEncoder::CWelsH264SVCEncoder() · 130 unmodified lines | |||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | CWelsH264SVCEncoder::~CWelsH264SVCEncoder() { | 133 | CWelsH264SVCEncoder::~CWelsH264SVCEncoder() { |
| 134 | WelsLog (NULL, WELS_LOG_INFO, "CWelsH264SVCEncoder::~CWelsH264SVCEncoder()\n"); | 134 | if (m_pWelsTrace) { |
| 135 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::~CWelsH264SVCEncoder()\n"); | ||
| 135 | 136 | ||
| 136 | if (m_pWelsTrace != NULL) { | ||
| 137 | delete m_pWelsTrace; | ||
| 138 | m_pWelsTrace = NULL; | ||
| 139 | } | ||
| 140 | #ifdef REC_FRAME_COUNT | 137 | #ifdef REC_FRAME_COUNT |
| 141 | WelsLog (m_pEncContext, WELS_LOG_INFO, | 138 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 142 | "CWelsH264SVCEncoder::~CWelsH264SVCEncoder(), m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, | 139 | "CWelsH264SVCEncoder::~CWelsH264SVCEncoder(), m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, |
| 143 | m_iCspInternal); | 140 | m_iCspInternal); |
| 144 | #endif | 141 | #endif |
| 142 | } | ||
| 145 | 143 | ||
| 146 | #ifdef REC_FRAME_COUNT | 144 | #ifdef REC_FRAME_COUNT |
| 147 | m_uiCountFrameNum = 0; | 145 | m_uiCountFrameNum = 0; |
| @@ -161,20 +159,27 @@ CWelsH264SVCEncoder::~CWelsH264SVCEncoder() { · 13 unmodified lines | |||
| 161 | #endif//OUTPUT_BIT_STREAM | 159 | #endif//OUTPUT_BIT_STREAM |
| 162 | 160 | ||
| 163 | Uninitialize(); | 161 | Uninitialize(); |
| 162 | |||
| 163 | if (m_pWelsTrace) { | ||
| 164 | delete m_pWelsTrace; | ||
| 165 | m_pWelsTrace = NULL; | ||
| 166 | } | ||
| 164 | } | 167 | } |
| 165 | 168 | ||
| 166 | void CWelsH264SVCEncoder::InitEncoder (void) { | 169 | void CWelsH264SVCEncoder::InitEncoder (void) { |
| 167 | 170 | ||
| 171 | m_pWelsTrace = new welsCodecTrace(); | ||
| 172 | if (m_pWelsTrace == NULL) { | ||
| 173 | return; | ||
| 174 | } | ||
| 175 | |||
| 176 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); | ||
| 177 | WelsSetLogCallback (welsCodecTrace::CODEC_TRACE); | ||
| 178 | |||
| 168 | #ifdef REC_FRAME_COUNT | 179 | #ifdef REC_FRAME_COUNT |
| 169 | WelsLog (m_pEncContext, WELS_LOG_INFO, | 180 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 170 | "CWelsH264SVCEncoder::InitEncoder, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); | 181 | "CWelsH264SVCEncoder::InitEncoder, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); |
| 171 | #endif | 182 | #endif |
| 172 | |||
| 173 | m_pWelsTrace = new welsCodecTrace(); | ||
| 174 | if (m_pWelsTrace != NULL) { | ||
| 175 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); | ||
| 176 | WelsSetLogCallback (welsCodecTrace::CODEC_TRACE); | ||
| 177 | } | ||
| 178 | } | 183 | } |
| 179 | 184 | ||
| 180 | /* Interfaces override from ISVCEncoder */ | 185 | /* Interfaces override from ISVCEncoder */ |
| @@ -188,9 +193,12 @@ int CWelsH264SVCEncoder::GetDefaultParams (SEncParamExt* argv) { · 7 unmodified lines | |||
| 188 | * SVC Encoder Initialization | 193 | * SVC Encoder Initialization |
| 189 | */ | 194 | */ |
| 190 | int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) { | 195 | int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) { |
| 196 | if (m_pWelsTrace == NULL) { | ||
| 197 | return cmMallocMemeError; | ||
| 198 | } | ||
| 191 | 199 | ||
| 192 | if (NULL == argv) { | 200 | if (NULL == argv) { |
| 193 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p\n", | 201 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p\n", |
| 194 | argv); | 202 | argv); |
| 195 | return cmInitParaError; | 203 | return cmInitParaError; |
| 196 | } | 204 | } |
| @@ -198,7 +206,8 @@ int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) { · 1 unmodified line | |||
| 198 | SWelsSvcCodingParam sConfig; | 206 | SWelsSvcCodingParam sConfig; |
| 199 | // Convert SEncParamBase into WelsSVCParamConfig here.. | 207 | // Convert SEncParamBase into WelsSVCParamConfig here.. |
| 200 | if (sConfig.ParamBaseTranscode (*argv)) { | 208 | if (sConfig.ParamBaseTranscode (*argv)) { |
| 201 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n"); | 209 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 210 | "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n"); | ||
| 202 | Uninitialize(); | 211 | Uninitialize(); |
| 203 | return cmInitParaError; | 212 | return cmInitParaError; |
| 204 | } | 213 | } |
| @@ -207,9 +216,12 @@ int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv) { · 2 unmodified lines | |||
| 207 | } | 216 | } |
| 208 | 217 | ||
| 209 | int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { | 218 | int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { |
| 219 | if (m_pWelsTrace == NULL) { | ||
| 220 | return cmMallocMemeError; | ||
| 221 | } | ||
| 210 | 222 | ||
| 211 | if (NULL == argv) { | 223 | if (NULL == argv) { |
| 212 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::InitializeExt(), invalid argv= 0x%p\n", | 224 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::InitializeExt(), invalid argv= 0x%p\n", |
| 213 | argv); | 225 | argv); |
| 214 | return cmInitParaError; | 226 | return cmInitParaError; |
| 215 | } | 227 | } |
| @@ -217,7 +229,8 @@ int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { · 1 unmodified line | |||
| 217 | SWelsSvcCodingParam sConfig; | 229 | SWelsSvcCodingParam sConfig; |
| 218 | // Convert SEncParamExt into WelsSVCParamConfig here.. | 230 | // Convert SEncParamExt into WelsSVCParamConfig here.. |
| 219 | if (sConfig.ParamTranscode (*argv)) { | 231 | if (sConfig.ParamTranscode (*argv)) { |
| 220 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::InitializeExt(), parameter_translation failed.\n"); | 232 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 233 | "CWelsH264SVCEncoder::InitializeExt(), parameter_translation failed.\n"); | ||
| 221 | Uninitialize(); | 234 | Uninitialize(); |
| 222 | return cmInitParaError; | 235 | return cmInitParaError; |
| 223 | } | 236 | } |
| @@ -227,22 +240,24 @@ int CWelsH264SVCEncoder::InitializeExt (const SEncParamExt* argv) { · 3 unmodified lines | |||
| 227 | 240 | ||
| 228 | int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { | 241 | int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { |
| 229 | if (NULL == pCfg) { | 242 | if (NULL == pCfg) { |
| 230 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n", | 243 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid argv= 0x%p.\n", |
| 231 | pCfg); | 244 | pCfg); |
| 232 | return cmInitParaError; | 245 | return cmInitParaError; |
| 233 | } | 246 | } |
| 234 | 247 | ||
| 235 | if (m_bInitialFlag) { | 248 | if (m_bInitialFlag) { |
| 236 | WelsLog (m_pEncContext, WELS_LOG_WARNING, "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", | 249 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 250 | "CWelsH264SVCEncoder::Initialize(), reinitialize, m_bInitialFlag= %d.\n", | ||
| 237 | m_bInitialFlag); | 251 | m_bInitialFlag); |
| 238 | Uninitialize(); | 252 | Uninitialize(); |
| 239 | } | 253 | } |
| 240 | 254 | ||
| 241 | #ifdef REC_FRAME_COUNT | 255 | #ifdef REC_FRAME_COUNT |
| 242 | SWelsSvcCodingParam& sEncodingParam = *pCfg; | 256 | SWelsSvcCodingParam& sEncodingParam = *pCfg; |
| 243 | WelsLog (m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | 257 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 258 | "CWelsH264SVCEncoder::Initialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", | ||
| 244 | m_uiCountFrameNum, m_iCspInternal); | 259 | m_uiCountFrameNum, m_iCspInternal); |
| 245 | WelsLog (m_pEncContext, WELS_LOG_INFO, | 260 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 246 | "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", | 261 | "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", |
| 247 | sEncodingParam.iPicWidth, | 262 | sEncodingParam.iPicWidth, |
| 248 | sEncodingParam.iPicHeight, | 263 | sEncodingParam.iPicHeight, |
| @@ -265,7 +280,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 16 unmodified lines | |||
| 265 | int32_t i = 0; | 280 | int32_t i = 0; |
| 266 | while (i < sEncodingParam.iSpatialLayerNum) { | 281 | while (i < sEncodingParam.iSpatialLayerNum) { |
| 267 | SSpatialLayerConfig* spatial_cfg = &sEncodingParam.sSpatialLayers[i]; | 282 | SSpatialLayerConfig* spatial_cfg = &sEncodingParam.sSpatialLayers[i]; |
| 268 | WelsLog (m_pEncContext, WELS_LOG_INFO, | 283 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 269 | "coding_param->sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.uiSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;\n", | 284 | "coding_param->sSpatialLayers[%d]: .iVideoWidth= %d; .iVideoHeight= %d; .fFrameRate= %.6ff; .iSpatialBitrate= %d; .sSliceCfg.uiSliceMode= %d; .sSliceCfg.sSliceArgument.uiSliceNum= %d; .sSliceCfg.sSliceArgument.uiSliceSizeConstraint= %d;\n", |
| 270 | i, spatial_cfg->iVideoWidth, | 285 | i, spatial_cfg->iVideoWidth, |
| 271 | spatial_cfg->iVideoHeight, | 286 | spatial_cfg->iVideoHeight, |
| @@ -281,7 +296,8 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 9 unmodified lines | |||
| 281 | 296 | ||
| 282 | const int32_t iColorspace = pCfg->iInputCsp; | 297 | const int32_t iColorspace = pCfg->iInputCsp; |
| 283 | if (videoFormatI420 != iColorspace) { | 298 | if (videoFormatI420 != iColorspace) { |
| 284 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n", iColorspace); | 299 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n", |
| 300 | iColorspace); | ||
| 285 | Uninitialize(); | 301 | Uninitialize(); |
| 286 | return cmInitParaError; | 302 | return cmInitParaError; |
| 287 | } | 303 | } |
| @@ -289,7 +305,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 289 | // Check valid parameters | 305 | // Check valid parameters |
| 290 | const int32_t iNumOfLayers = pCfg->iSpatialLayerNum; | 306 | const int32_t iNumOfLayers = pCfg->iSpatialLayerNum; |
| 291 | if (iNumOfLayers < 1 || iNumOfLayers > MAX_DEPENDENCY_LAYER) { | 307 | if (iNumOfLayers < 1 || iNumOfLayers > MAX_DEPENDENCY_LAYER) { |
| 292 | WelsLog (m_pEncContext, WELS_LOG_ERROR, | 308 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 293 | "CWelsH264SVCEncoder::Initialize(), invalid iSpatialLayerNum= %d, valid at range of [1, %d].\n", iNumOfLayers, | 309 | "CWelsH264SVCEncoder::Initialize(), invalid iSpatialLayerNum= %d, valid at range of [1, %d].\n", iNumOfLayers, |
| 294 | MAX_DEPENDENCY_LAYER); | 310 | MAX_DEPENDENCY_LAYER); |
| 295 | Uninitialize(); | 311 | Uninitialize(); |
| @@ -298,7 +314,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 2 unmodified lines | |||
| 298 | if (pCfg->iTemporalLayerNum < 1) | 314 | if (pCfg->iTemporalLayerNum < 1) |
| 299 | pCfg->iTemporalLayerNum = 1; | 315 | pCfg->iTemporalLayerNum = 1; |
| 300 | if (pCfg->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) { | 316 | if (pCfg->iTemporalLayerNum > MAX_TEMPORAL_LEVEL) { |
| 301 | WelsLog (m_pEncContext, WELS_LOG_ERROR, | 317 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 302 | "CWelsH264SVCEncoder::Initialize(), invalid iTemporalLayerNum= %d, valid at range of [1, %d].\n", | 318 | "CWelsH264SVCEncoder::Initialize(), invalid iTemporalLayerNum= %d, valid at range of [1, %d].\n", |
| 303 | pCfg->iTemporalLayerNum, MAX_TEMPORAL_LEVEL); | 319 | pCfg->iTemporalLayerNum, MAX_TEMPORAL_LEVEL); |
| 304 | Uninitialize(); | 320 | Uninitialize(); |
| @@ -308,7 +324,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 3 unmodified lines | |||
| 308 | // assert( cfg.uiGopSize >= 1 && ( cfg.uiIntraPeriod && (cfg.uiIntraPeriod % cfg.uiGopSize) == 0) ); | 324 | // assert( cfg.uiGopSize >= 1 && ( cfg.uiIntraPeriod && (cfg.uiIntraPeriod % cfg.uiGopSize) == 0) ); |
| 309 | 325 | ||
| 310 | if (pCfg->uiGopSize < 1 || pCfg->uiGopSize > MAX_GOP_SIZE) { | 326 | if (pCfg->uiGopSize < 1 || pCfg->uiGopSize > MAX_GOP_SIZE) { |
| 311 | WelsLog (m_pEncContext, WELS_LOG_ERROR, | 327 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 312 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d].\n", pCfg->uiGopSize, | 328 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d].\n", pCfg->uiGopSize, |
| 313 | MAX_GOP_SIZE); | 329 | MAX_GOP_SIZE); |
| 314 | Uninitialize(); | 330 | Uninitialize(); |
| @@ -316,7 +332,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 316 | } | 332 | } |
| 317 | 333 | ||
| 318 | if (!WELS_POWER2_IF (pCfg->uiGopSize)) { | 334 | if (!WELS_POWER2_IF (pCfg->uiGopSize)) { |
| 319 | WelsLog (m_pEncContext, WELS_LOG_ERROR, | 335 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 320 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d] and yield to power of 2.\n", | 336 | "CWelsH264SVCEncoder::Initialize(), invalid uiGopSize= %d, valid at range of [1, %d] and yield to power of 2.\n", |
| 321 | pCfg->uiGopSize, MAX_GOP_SIZE); | 337 | pCfg->uiGopSize, MAX_GOP_SIZE); |
| 322 | Uninitialize(); | 338 | Uninitialize(); |
| @@ -324,7 +340,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 324 | } | 340 | } |
| 325 | 341 | ||
| 326 | if (pCfg->uiIntraPeriod && pCfg->uiIntraPeriod < pCfg->uiGopSize) { | 342 | if (pCfg->uiIntraPeriod && pCfg->uiIntraPeriod < pCfg->uiGopSize) { |
| 327 | WelsLog (m_pEncContext, WELS_LOG_ERROR, | 343 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 328 | "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d.\n", | 344 | "CWelsH264SVCEncoder::Initialize(), invalid uiIntraPeriod= %d, valid in case it equals to 0 for unlimited intra period or exceeds specified uiGopSize= %d.\n", |
| 329 | pCfg->uiIntraPeriod, pCfg->uiGopSize); | 345 | pCfg->uiIntraPeriod, pCfg->uiGopSize); |
| 330 | Uninitialize(); | 346 | Uninitialize(); |
| @@ -332,7 +348,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 1 unmodified line | |||
| 332 | } | 348 | } |
| 333 | 349 | ||
| 334 | if ((pCfg->uiIntraPeriod && (pCfg->uiIntraPeriod & (pCfg->uiGopSize - 1)) != 0)) { | 350 | if ((pCfg->uiIntraPeriod && (pCfg->uiIntraPeriod & (pCfg->uiGopSize - 1)) != 0)) { |
| 335 | WelsLog (m_pEncContext, WELS_LOG_ERROR, | 351 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, |
| 336 | "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", | 352 | "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", |
| 337 | pCfg->uiIntraPeriod, pCfg->uiGopSize); | 353 | pCfg->uiIntraPeriod, pCfg->uiGopSize); |
| 338 | Uninitialize(); | 354 | Uninitialize(); |
| @@ -371,8 +387,8 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 32 unmodified lines | |||
| 371 | m_iMaxPicWidth = pCfg->iPicWidth; | 387 | m_iMaxPicWidth = pCfg->iPicWidth; |
| 372 | m_iMaxPicHeight = pCfg->iPicHeight; | 388 | m_iMaxPicHeight = pCfg->iPicHeight; |
| 373 | 389 | ||
| 374 | if (WelsInitEncoderExt (&m_pEncContext, pCfg)) { | 390 | if (WelsInitEncoderExt (&m_pEncContext, pCfg, &m_pWelsTrace->m_sLogCtx)) { |
| 375 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed.\n"); | 391 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), WelsInitEncoderExt failed.\n"); |
| 376 | Uninitialize(); | 392 | Uninitialize(); |
| 377 | return cmInitParaError; | 393 | return cmInitParaError; |
| 378 | } | 394 | } |
| @@ -391,10 +407,10 @@ int32_t CWelsH264SVCEncoder::Uninitialize() { · 12 unmodified lines | |||
| 391 | return 0; | 407 | return 0; |
| 392 | } | 408 | } |
| 393 | 409 | ||
| 394 | WelsLog (m_pEncContext, WELS_LOG_INFO, "CWelsH264SVCEncoder::Uninitialize()..\n"); | 410 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::Uninitialize()..\n"); |
| 395 | 411 | ||
| 396 | #ifdef REC_FRAME_COUNT | 412 | #ifdef REC_FRAME_COUNT |
| 397 | WelsLog (m_pEncContext, WELS_LOG_INFO, | 413 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 398 | "CWelsH264SVCEncoder::Uninitialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); | 414 | "CWelsH264SVCEncoder::Uninitialize, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal); |
| 399 | #endif//REC_FRAME_COUNT | 415 | #endif//REC_FRAME_COUNT |
| 400 | 416 | ||
| @@ -734,7 +750,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 333 unmodified lines | |||
| 734 | break; | 750 | break; |
| 735 | } | 751 | } |
| 736 | //adjust to valid range | 752 | //adjust to valid range |
| 737 | WelsEncoderApplyBitRate (m_pEncContext->pSvcParam, pInfo->iLayer); | 753 | WelsEncoderApplyBitRate (&m_pWelsTrace->m_sLogCtx, m_pEncContext->pSvcParam, pInfo->iLayer); |
| 738 | } | 754 | } |
| 739 | break; | 755 | break; |
| 740 | case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate | 756 | case ENCODER_OPTION_MAX_BITRATE: { // Target bit-rate |
| @@ -775,7 +791,7 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) { · 34 unmodified lines | |||
| 775 | break; | 791 | break; |
| 776 | } | 792 | } |
| 777 | //adjust to valid range | 793 | //adjust to valid range |
| 778 | WelsEncoderApplyBitRate (m_pEncContext->pSvcParam, pInfo->iLayer); | 794 | WelsEncoderApplyBitRate (&m_pWelsTrace->m_sLogCtx, m_pEncContext->pSvcParam, pInfo->iLayer); |
| 779 | } | 795 | } |
| 780 | break; | 796 | break; |
| 781 | case ENCODER_OPTION_RC_MODE: { // 0:quality mode;1:bit-rate mode;2:bitrate limited mode | 797 | case ENCODER_OPTION_RC_MODE: { // 0:quality mode;1:bit-rate mode;2:bitrate limited mode |