Lines Matching defs:avctx
110 AVCodecContext *avctx;
386 for (unsigned int channel = 0; channel < ctx->avctx->ch_layout.nb_channels; channel++) {
387 ChannelParams *cp = ctx->seq_channel_params + index*(ctx->avctx->ch_layout.nb_channels) + channel;
477 static av_cold int mlp_encode_init(AVCodecContext *avctx)
480 MLPEncodeContext *ctx = avctx->priv_data;
486 ctx->avctx = avctx;
488 switch (avctx->sample_rate) {
490 avctx->frame_size = 40 << 0;
495 avctx->frame_size = 40 << 1;
501 avctx->frame_size = 40 << 2;
506 avctx->frame_size = 40 << 0;
511 avctx->frame_size = 40 << 1;
517 avctx->frame_size = 40 << 2;
522 av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d. Supported "
524 "96000, and 192000.\n", avctx->sample_rate);
530 ctx->coded_peak_bitrate = mlp_peak_bitrate(9600000, avctx->sample_rate);
533 if (avctx->ch_layout.nb_channels > 2) {
534 av_log(avctx, AV_LOG_WARNING,
539 if (avctx->ch_layout.nb_channels <= 2) {
543 switch (avctx->sample_fmt) {
547 avctx->bits_per_raw_sample = 16;
553 avctx->bits_per_raw_sample = 24;
556 av_log(avctx, AV_LOG_ERROR, "Sample format not supported. "
562 ctx->dts = -avctx->frame_size;
564 ctx->num_channels = avctx->ch_layout.nb_channels + 2; /* +2 noise channels */
565 ctx->one_sample_buffer_size = avctx->frame_size
576 size = avctx->frame_size * ctx->max_restart_interval;
592 if (ctx->avctx->codec_id == AV_CODEC_ID_MLP) {
604 if (!av_channel_layout_compare(&avctx->ch_layout, &layout_arrangement[i]))
607 av_log(avctx, AV_LOG_ERROR, "Unsupported channel arrangement\n");
616 if (!av_channel_layout_compare(&avctx->ch_layout,
622 } else if (!av_channel_layout_compare(&avctx->ch_layout,
628 } else if (!av_channel_layout_compare(&avctx->ch_layout,
635 av_log(avctx, AV_LOG_ERROR, "Unsupported channel arrangement\n");
659 size = ctx->restart_intervals * ctx->sequence_size * ctx->avctx->ch_layout.nb_channels;
673 rh->max_channel = avctx->ch_layout.nb_channels - 1;
682 ctx->filter_state_buffer[i] = av_calloc(avctx->frame_size * ctx->max_restart_interval,
688 ff_af_queue_init(avctx, &ctx->afq);
708 if (ctx->avctx->codec_id == AV_CODEC_ID_MLP) {
718 } else if (ctx->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
936 av_log(ctx->avctx, AV_LOG_ERROR, "Invalid Huff LSBs\n");
1055 if (ctx->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
1207 input_data_internal(ctx, samples, nb_samples, ctx->avctx->sample_fmt == AV_SAMPLE_FMT_S32);
1218 for (unsigned int i = 0; i < ctx->avctx->frame_size; i++) {
1219 for (unsigned int channel = 0; channel < ctx->avctx->ch_layout.nb_channels; channel++)
1813 unsigned int msb_mask_bits = (ctx->avctx->sample_fmt == AV_SAMPLE_FMT_S16 ? 8 : 0) - mp->shift[mat];
1938 ChannelParams *cp = ctx->seq_channel_params + index*(ctx->avctx->ch_layout.nb_channels) + channel;
1959 int channels = ctx->avctx->ch_layout.nb_channels;
2009 ctx->cur_channel_params = seq_cp + ctx->avctx->ch_layout.nb_channels;
2025 dp->blocksize = ctx->avctx->frame_size;
2036 ctx->cur_channel_params = seq_cp + index*(ctx->avctx->ch_layout.nb_channels);
2065 static int mlp_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
2068 MLPEncodeContext *ctx = avctx->priv_data;
2070 int channels = avctx->ch_layout.nb_channels;
2075 ctx->last_frames = (ctx->afq.remaining_samples + avctx->frame_size - 1) / avctx->frame_size;
2080 if ((ret = ff_alloc_packet(avctx, avpkt, 87500 * channels)) < 0)
2091 ctx->frame_index = avctx->frame_number % ctx->max_restart_interval;
2101 if (avctx->frame_number < ctx->max_restart_interval) {
2120 ctx->timestamp += avctx->frame_size;
2121 ctx->dts += avctx->frame_size;
2126 ctx->shorten_by = avctx->frame_size - frame->nb_samples;
2127 ctx->next_major_frame_size += avctx->frame_size;
2149 number_of_samples = avctx->frame_size * ctx->number_of_frames;
2171 avctx->frame_number++;
2175 FFMIN(avctx->frame_size, ctx->afq.remaining_samples),
2189 static av_cold int mlp_encode_close(AVCodecContext *avctx)
2191 MLPEncodeContext *ctx = avctx->priv_data;