Lines Matching defs:avctx
44 static av_cold int cng_decode_close(AVCodecContext *avctx)
46 CNGContext *p = avctx->priv_data;
55 static av_cold int cng_decode_init(AVCodecContext *avctx)
57 CNGContext *p = avctx->priv_data;
59 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
60 av_channel_layout_uninit(&avctx->ch_layout);
61 avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
62 avctx->sample_rate = 8000;
65 avctx->frame_size = 640;
69 p->filter_out = av_calloc(avctx->frame_size + p->order,
71 p->excitation = av_calloc(avctx->frame_size, sizeof(*p->excitation));
99 static void cng_decode_flush(AVCodecContext *avctx)
101 CNGContext *p = avctx->priv_data;
105 static int cng_decode_frame(AVCodecContext *avctx, AVFrame *frame,
108 CNGContext *p = avctx->priv_data;
124 if (avctx->internal->skip_samples > 10 * avctx->frame_size) {
125 avctx->internal->skip_samples = 0;
144 for (i = 0; i < avctx->frame_size; i++) {
149 p->excitation, avctx->frame_size, p->order);
151 frame->nb_samples = avctx->frame_size;
152 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
155 for (i = 0; i < avctx->frame_size; i++)
157 memcpy(p->filter_out, p->filter_out + avctx->frame_size,