static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx) { int i; vp8dx_remove_decompressor(ctx->pbi); for (i = NELEMENTS(ctx->mmaps) - 1; i >= 0; i--) { if (ctx->mmaps[i].dtor) ctx->mmaps[i].dtor(&ctx->mmaps[i]); } return VPX_CODEC_OK; }
VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf) { VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP)); if (!pbi) return NULL; vpx_memset(pbi, 0, sizeof(VP8D_COMP)); if (setjmp(pbi->common.error.jmp)) { pbi->common.error.setjmp = 0; vp8dx_remove_decompressor(pbi); return 0; } pbi->common.error.setjmp = 1; vp8dx_initialize(); vp8_create_common(&pbi->common); vp8_dmachine_specific_config(pbi); pbi->common.current_video_frame = 0; pbi->ready_for_new_data = 1; pbi->CPUFreq = 0; /*vp8_get_processor_freq();*/ #if CONFIG_MULTITHREAD pbi->max_threads = oxcf->max_threads; vp8_decoder_create_threads(pbi); #endif /* vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid * unnecessary calling of vp8cx_init_de_quantizer() for every frame. */ vp8cx_init_de_quantizer(pbi); { VP8_COMMON *cm = &pbi->common; vp8_init_loop_filter(cm); cm->last_frame_type = KEY_FRAME; cm->last_filter_type = cm->filter_type; cm->last_sharpness_level = cm->sharpness_level; } pbi->common.error.setjmp = 0; return (VP8D_PTR) pbi; }
static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx) { int i; vp8dx_remove_decompressor(ctx->pbi); for (i = NELEMENTS(ctx->mmaps) - 1; i >= 0; i--) { if (ctx->mmaps[i].dtor) ctx->mmaps[i].dtor(&ctx->mmaps[i]); } #if CONFIG_OPENCL if (cl_initialized == CL_SUCCESS){ cl_destroy(NULL, VP8_CL_NOT_INITIALIZED); #if HAVE_DLOPEN close_cl(); #endif } #endif return VPX_CODEC_OK; }