Beispiel #1
0
/*
 * fill data fields in default for decoder context
 */
void WelsDecoderDefaults (PWelsDecoderContext pCtx) {
  int32_t iCpuCores               = 1;
  memset (pCtx, 0, sizeof (SWelsDecoderContext));	// fill zero first

  pCtx->pArgDec                   = NULL;

  pCtx->iOutputColorFormat		= videoFormatI420;	// yuv in default
  pCtx->bHaveGotMemory			= false;	// not ever request memory blocks for decoder context related
  pCtx->uiCpuFlag					= 0;

  pCtx->bAuReadyFlag				= 0; // au data is not ready


  pCtx->uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);

  pCtx->iImgWidthInPixel		= 0;
  pCtx->iImgHeightInPixel		= 0;		// alloc picture data when picture size is available

  pCtx->iFrameNum				= -1;
  pCtx->iPrevFrameNum			= -1;
  pCtx->iErrorCode			= ERR_NONE;

  pCtx->pDec					= NULL;

  WelsResetRefPic (pCtx);

  pCtx->iActiveFmoNum			= 0;

  pCtx->pPicBuff[LIST_0]		= NULL;
  pCtx->pPicBuff[LIST_1]		= NULL;

  pCtx->bAvcBasedFlag			= true;
  pCtx->iErrorConMethod = ERROR_CON_DISABLE;

}
Beispiel #2
0
/*
 * fill data fields in default for decoder context
 */
void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
  int32_t iCpuCores               = 1;
  pCtx->sLogCtx = *pLogCtx;

  pCtx->pArgDec                   = NULL;

  pCtx->eOutputColorFormat        = videoFormatI420;    // yuv in default
  pCtx->bHaveGotMemory            = false;              // not ever request memory blocks for decoder context related
  pCtx->uiCpuFlag                 = 0;

  pCtx->bAuReadyFlag              = 0;                  // au data is not ready
  pCtx->bCabacInited = false;

  pCtx->uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);

  pCtx->iImgWidthInPixel          = 0;
  pCtx->iImgHeightInPixel         = 0;                  // alloc picture data when picture size is available
  pCtx->iLastImgWidthInPixel      = 0;
  pCtx->iLastImgHeightInPixel     = 0;
  pCtx->bFreezeOutput = true;

  pCtx->iFrameNum                 = -1;
  pCtx->iPrevFrameNum             = -1;
  pCtx->iErrorCode                = ERR_NONE;

  pCtx->pDec                      = NULL;

  WelsResetRefPic (pCtx);

  pCtx->iActiveFmoNum             = 0;

  pCtx->pPicBuff[LIST_0]          = NULL;
  pCtx->pPicBuff[LIST_1]          = NULL;

  pCtx->bAvcBasedFlag             = true;
  pCtx->eErrorConMethod = ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE;
  pCtx->pPreviousDecodedPictureInDpb = NULL;
  pCtx->sDecoderStatistics.iAvgLumaQp = -1;
  pCtx->bSpsLatePps = false;
  pCtx->bUseScalingList = false;
  pCtx->iSpsErrorIgnored = 0;
  pCtx->iSubSpsErrorIgnored = 0;
  pCtx->iPpsErrorIgnored = 0;
  pCtx->iPPSInvalidNum = 0;
  pCtx->iPPSLastInvalidId = -1;
  pCtx->iSPSInvalidNum = 0;
  pCtx->iSPSLastInvalidId = -1;
  pCtx->iSubSPSInvalidNum = 0;
  pCtx->iSubSPSLastInvalidId = -1;
}
Beispiel #3
0
/*
 * fill data fields in default for decoder context
 */
void_t WelsDecoderDefaults (PWelsDecoderContext pCtx) {
  int32_t iCpuCores               = 1;
  memset (pCtx, 0, sizeof (SWelsDecoderContext));	// fill zero first

  pCtx->pArgDec                   = NULL;

  pCtx->iOutputColorFormat		= videoFormatI420;	// yuv in default
  pCtx->bHaveGotMemory			= false;	// not ever request memory blocks for decoder context related
  pCtx->uiCpuFlag					= 0;

  pCtx->bAuReadyFlag				= 0; // au data is not ready


  g_uiCacheLineSize				= 16;
#if defined(X86_ASM)
  pCtx->uiCpuFlag = WelsCPUFeatureDetect (&iCpuCores);
#ifdef HAVE_CACHE_LINE_ALIGN
  if (pCtx->uiCpuFlag & WELS_CPU_CACHELINE_64) {
    g_uiCacheLineSize	= 64;
  } else if (pCtx->uiCpuFlag & WELS_CPU_CACHELINE_32) {
    g_uiCacheLineSize	= 32;
  }
#endif//HAVE_CACHE_LINE_ALIGN
#endif//X86_ASM	

  pCtx->iImgWidthInPixel		= 0;
  pCtx->iImgHeightInPixel		= 0;		// alloc picture data when picture size is available

  pCtx->iFrameNum				= -1;
  pCtx->iPrevFrameNum			= -1;
  pCtx->iErrorCode			= ERR_NONE;

  pCtx->pDec					= NULL;

  WelsResetRefPic (pCtx);

  pCtx->iActiveFmoNum			= 0;

  pCtx->pPicBuff[LIST_0]		= NULL;
  pCtx->pPicBuff[LIST_1]		= NULL;

  pCtx->bAvcBasedFlag			= true;

}