static void initialize_dec(void) { static volatile int init_done = 0; if (!init_done) { vpx_dsp_rtcd(); vp8_init_intra_predictors(); init_done = 1; } }
static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx, vpx_codec_priv_enc_mr_cfg_t *data) { vpx_codec_err_t res = VPX_CODEC_OK; vpx_codec_alg_priv_t *priv = NULL; (void) data; vp8_rtcd(); vpx_dsp_rtcd(); vpx_scale_rtcd(); /* This function only allocates space for the vpx_codec_alg_priv_t * structure. More memory may be required at the time the stream * information becomes known. */ if (!ctx->priv) { vp8_init_ctx(ctx); priv = (vpx_codec_alg_priv_t *)ctx->priv; /* initialize number of fragments to zero */ priv->fragments.count = 0; /* is input fragments enabled? */ priv->fragments.enabled = (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS); /*post processing level initialized to do nothing */ } else { priv = (vpx_codec_alg_priv_t *)ctx->priv; } priv->yv12_frame_buffers.use_frame_threads = (ctx->priv->init_flags & VPX_CODEC_USE_FRAME_THREADING); /* for now, disable frame threading */ priv->yv12_frame_buffers.use_frame_threads = 0; if (priv->yv12_frame_buffers.use_frame_threads && ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) || (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) { /* row-based threading, error concealment, and input fragments will * not be supported when using frame-based threading */ res = VPX_CODEC_INVALID_PARAM; } return res; }