Lines Matching defs:avctx

107 static av_cold int decode_close(AVCodecContext *avctx)
109 RALFContext *ctx = avctx->priv_data;
128 static av_cold int decode_init(AVCodecContext *avctx)
130 RALFContext *ctx = avctx->priv_data;
134 if (avctx->extradata_size < 24 || memcmp(avctx->extradata, "LSD:", 4)) {
135 av_log(avctx, AV_LOG_ERROR, "Extradata is not groovy, dude\n");
139 ctx->version = AV_RB16(avctx->extradata + 4);
141 avpriv_request_sample(avctx, "Unknown version %X", ctx->version);
145 channels = AV_RB16(avctx->extradata + 8);
146 avctx->sample_rate = AV_RB32(avctx->extradata + 12);
148 || avctx->sample_rate < 8000 || avctx->sample_rate > 96000) {
149 av_log(avctx, AV_LOG_ERROR, "Invalid coding parameters %d Hz %d ch\n",
150 avctx->sample_rate, channels);
153 avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
154 av_channel_layout_uninit(&avctx->ch_layout);
155 av_channel_layout_default(&avctx->ch_layout, channels);
157 ctx->max_frame_size = AV_RB32(avctx->extradata + 16);
159 av_log(avctx, AV_LOG_ERROR, "invalid frame size %d\n",
162 ctx->max_frame_size = FFMAX(ctx->max_frame_size, avctx->sample_rate);
329 static int decode_block(AVCodecContext *avctx, GetBitContext *gb,
332 RALFContext *ctx = avctx->priv_data;
345 av_log(avctx, AV_LOG_ERROR,
350 if (avctx->ch_layout.nb_channels > 1)
360 for (ch = 0; ch < avctx->ch_layout.nb_channels; ch++) {
413 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
416 RALFContext *ctx = avctx->priv_data;
430 av_log(avctx, AV_LOG_ERROR, "Wrong packet's breath smells of wrong data!\n");
434 av_log(avctx, AV_LOG_ERROR, "Wrong packet tails are wrong!\n");
455 if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
461 av_log(avctx, AV_LOG_ERROR, "too short packets are too short!\n");
467 av_log(avctx, AV_LOG_ERROR, "short packets are short!\n");
475 ctx->block_size[ctx->num_blocks] = get_bits(&gb, 13 + avctx->ch_layout.nb_channels);
489 av_log(avctx, AV_LOG_ERROR, "I'm pedaling backwards\n");
493 if (decode_block(avctx, &gb, samples0 + ctx->sample_offset,
495 av_log(avctx, AV_LOG_ERROR, "Sir, I got carsick in your office. Not decoding the rest of packet.\n");
508 static void decode_flush(AVCodecContext *avctx)
510 RALFContext *ctx = avctx->priv_data;