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

Function cng_encode_init

libavcodec/cngenc.c:48–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48static av_cold int cng_encode_init(AVCodecContext *avctx)
49{
50 CNGContext *p = avctx->priv_data;
51 int ret;
52
53 avctx->frame_size = 640;
54 p->order = 10;
55 if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)
56 return ret;
57 p->samples32 = av_malloc_array(avctx->frame_size, sizeof(*p->samples32));
58 p->ref_coef = av_malloc_array(p->order, sizeof(*p->ref_coef));
59 if (!p->samples32 || !p->ref_coef)
60 return AVERROR(ENOMEM);
61
62 return 0;
63}
64
65static int cng_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
66 const AVFrame *frame, int *got_packet_ptr)

Callers

nothing calls this directly

Calls 2

ff_lpc_initFunction · 0.85
av_malloc_arrayFunction · 0.85

Tested by

no test coverage detected