* fill data fields in default for decoder context */
| 312 | * fill data fields in default for decoder context |
| 313 | */ |
| 314 | void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { |
| 315 | int32_t iCpuCores = 1; |
| 316 | pCtx->sLogCtx = *pLogCtx; |
| 317 | |
| 318 | pCtx->pArgDec = NULL; |
| 319 | |
| 320 | pCtx->bHaveGotMemory = false; // not ever request memory blocks for decoder context related |
| 321 | pCtx->uiCpuFlag = 0; |
| 322 | |
| 323 | pCtx->bAuReadyFlag = 0; // au data is not ready |
| 324 | pCtx->bCabacInited = false; |
| 325 | |
| 326 | pCtx->uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores); |
| 327 | |
| 328 | pCtx->iImgWidthInPixel = 0; |
| 329 | pCtx->iImgHeightInPixel = 0; // alloc picture data when picture size is available |
| 330 | pCtx->iLastImgWidthInPixel = 0; |
| 331 | pCtx->iLastImgHeightInPixel = 0; |
| 332 | pCtx->bFreezeOutput = true; |
| 333 | |
| 334 | pCtx->iFrameNum = -1; |
| 335 | pCtx->pLastDecPicInfo->iPrevFrameNum = -1; |
| 336 | pCtx->iErrorCode = ERR_NONE; |
| 337 | |
| 338 | pCtx->pDec = NULL; |
| 339 | |
| 340 | pCtx->pTempDec = NULL; |
| 341 | |
| 342 | WelsResetRefPic (pCtx); |
| 343 | |
| 344 | pCtx->iActiveFmoNum = 0; |
| 345 | |
| 346 | pCtx->pPicBuff = NULL; |
| 347 | |
| 348 | //pCtx->sSpsPpsCtx.bAvcBasedFlag = true; |
| 349 | pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb = NULL; |
| 350 | pCtx->pDecoderStatistics->iAvgLumaQp = -1; |
| 351 | pCtx->pDecoderStatistics->iStatisticsLogInterval = 1000; |
| 352 | pCtx->bUseScalingList = false; |
| 353 | /*pCtx->sSpsPpsCtx.iSpsErrorIgnored = 0; |
| 354 | pCtx->sSpsPpsCtx.iSubSpsErrorIgnored = 0; |
| 355 | pCtx->sSpsPpsCtx.iPpsErrorIgnored = 0; |
| 356 | pCtx->sSpsPpsCtx.iPPSInvalidNum = 0; |
| 357 | pCtx->sSpsPpsCtx.iPPSLastInvalidId = -1; |
| 358 | pCtx->sSpsPpsCtx.iSPSInvalidNum = 0; |
| 359 | pCtx->sSpsPpsCtx.iSPSLastInvalidId = -1; |
| 360 | pCtx->sSpsPpsCtx.iSubSPSInvalidNum = 0; |
| 361 | pCtx->sSpsPpsCtx.iSubSPSLastInvalidId = -1; |
| 362 | */ |
| 363 | pCtx->iFeedbackNalRefIdc = -1; //initialize |
| 364 | pCtx->pLastDecPicInfo->iPrevPicOrderCntMsb = 0; |
| 365 | pCtx->pLastDecPicInfo->iPrevPicOrderCntLsb = 0; |
| 366 | |
| 367 | } |
| 368 | |
| 369 | /* |
| 370 | * fill data fields in SPS and PPS default for decoder context |
no test coverage detected