MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / aom_init

Function aom_init

libavcodec/libaomdec.c:46–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44} AV1DecodeContext;
45
46static av_cold int aom_init(AVCodecContext *avctx,
47 const struct aom_codec_iface *iface)
48{
49 AV1DecodeContext *ctx = avctx->priv_data;
50 struct aom_codec_dec_cfg deccfg = {
51 .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16)
52 };
53
54 av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_version_str());
55 av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_build_config());
56
57 if (aom_codec_dec_init(&ctx->decoder, iface, &deccfg, 0) != AOM_CODEC_OK) {
58 const char *error = aom_codec_error(&ctx->decoder);
59 av_log(avctx, AV_LOG_ERROR, "Failed to initialize decoder: %s\n",
60 error);
61 return AVERROR(EINVAL);
62 }
63
64 return 0;
65}
66
67// returns 0 on success, AVERROR_INVALIDDATA otherwise
68static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)

Callers 1

av1_initFunction · 0.70

Calls 2

av_cpu_countFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected