Lines Matching defs:avctx
350 static av_cold int decoder_init(AVCodecContext * avctx)
352 G729Context *s = avctx->priv_data;
354 int channels = avctx->ch_layout.nb_channels;
358 av_log(avctx, AV_LOG_ERROR, "Only mono and stereo are supported (requested channels: %d).\n", channels);
361 avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
364 avctx->frame_size = SUBFRAME_SIZE << 1;
404 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
415 G729Context *s = avctx->priv_data;
417 int channels = avctx->ch_layout.nb_channels;
432 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
435 if (buf_size && buf_size % ((G729_8K_BLOCK_SIZE + (avctx->codec_id == AV_CODEC_ID_ACELP_KELVIN)) * channels) == 0) {
441 av_log(avctx, AV_LOG_DEBUG, "Packet type: %s\n", "G.729 @ 8kbit/s");
442 } else if (buf_size == G729D_6K4_BLOCK_SIZE * channels && avctx->codec_id != AV_CODEC_ID_ACELP_KELVIN) {
445 av_log(avctx, AV_LOG_DEBUG, "Packet type: %s\n", "G.729D @ 6.4kbit/s");
447 av_log(avctx, AV_LOG_ERROR, "Packet size %d is unknown.\n", buf_size);
456 if (avctx->codec_id == AV_CODEC_ID_ACELP_KELVIN) {
457 if (*buf != ((avctx->ch_layout.nb_channels - 1 - c) * 0x80 | 2))
458 avpriv_request_sample(avctx, "First byte value %x for channel %d", *buf, c);
533 av_log(avctx, AV_LOG_WARNING, "pitch_delay_int %d is too large\n", pitch_delay_int[i]);
744 return (format->block_size + (avctx->codec_id == AV_CODEC_ID_ACELP_KELVIN)) * channels;
747 static av_cold int decode_close(AVCodecContext *avctx)
749 G729Context *s = avctx->priv_data;