Lines Matching defs:avctx

65     AVCodecContext *avctx;
89 int shift = av_get_bytes_per_sample(s->avctx->sample_fmt) * 8 -
90 s->avctx->bits_per_raw_sample;
101 if (s->avctx->sample_fmt == AV_SAMPLE_FMT_S32P)
380 if (s->avctx->sample_fmt == AV_SAMPLE_FMT_S32P) {
381 int shift = 32 - s->avctx->bits_per_raw_sample;
386 put_sbits(pb, s->avctx->bits_per_raw_sample,
393 put_sbits(pb, s->avctx->bits_per_raw_sample,
397 s->write_sample_size = s->avctx->bits_per_raw_sample - s->extra_bits +
465 int channels = s->avctx->ch_layout.nb_channels;
499 static av_cold int alac_encode_close(AVCodecContext *avctx)
501 AlacEncodeContext *s = avctx->priv_data;
506 static av_cold int alac_encode_init(AVCodecContext *avctx)
508 AlacEncodeContext *s = avctx->priv_data;
512 avctx->frame_size = s->frame_size = DEFAULT_FRAME_SIZE;
514 if (avctx->sample_fmt == AV_SAMPLE_FMT_S32P) {
515 if (avctx->bits_per_raw_sample != 24)
516 av_log(avctx, AV_LOG_WARNING, "encoding as 24 bits-per-sample\n");
517 avctx->bits_per_raw_sample = 24;
519 avctx->bits_per_raw_sample = 16;
524 if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
527 s->compression_level = av_clip(avctx->compression_level, 0, 2);
535 s->max_coded_frame_size = get_max_frame_size(avctx->frame_size,
536 avctx->ch_layout.nb_channels,
537 avctx->bits_per_raw_sample);
539 avctx->extradata = av_mallocz(ALAC_EXTRADATA_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
540 if (!avctx->extradata)
542 avctx->extradata_size = ALAC_EXTRADATA_SIZE;
544 alac_extradata = avctx->extradata;
547 AV_WB32(alac_extradata+12, avctx->frame_size);
548 AV_WB8 (alac_extradata+17, avctx->bits_per_raw_sample);
549 AV_WB8 (alac_extradata+21, avctx->ch_layout.nb_channels);
552 avctx->sample_rate * avctx->ch_layout.nb_channels * avctx->bits_per_raw_sample); // average bitrate
553 AV_WB32(alac_extradata+32, avctx->sample_rate);
563 av_log(avctx, AV_LOG_ERROR,
569 s->avctx = avctx;
571 if ((ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size,
580 static int alac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
583 AlacEncodeContext *s = avctx->priv_data;
589 max_frame_size = get_max_frame_size(s->frame_size, avctx->ch_layout.nb_channels,
590 avctx->bits_per_raw_sample);
594 if ((ret = ff_alloc_packet(avctx, avpkt, 4 * max_frame_size)) < 0)
600 s->extra_bits = avctx->bits_per_raw_sample - 16;