Lines Matching refs:avctx
32 static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
39 av_log(avctx, AV_LOG_ERROR, "frame is too short\n");
58 av_log(avctx, AV_LOG_ERROR, "frame has invalid header\n");
63 avctx->bits_per_coded_sample = bits;
65 avctx->sample_fmt = AV_SAMPLE_FMT_S32;
67 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
69 avctx->channels = channels;
70 avctx->sample_rate = 48000;
71 avctx->bit_rate = 48000 * avctx->channels * (avctx->bits_per_coded_sample + 4) +
73 (avctx->channels *
74 (avctx->bits_per_coded_sample + 4))));
79 static int s302m_decode_frame(AVCodecContext *avctx, void *data,
82 S302MDecodeContext *s = avctx->priv_data;
87 int frame_size = s302m_parse_frame_header(avctx, buf, buf_size);
95 block_size = (avctx->bits_per_coded_sample + 4) / 4;
96 s->frame.nb_samples = 2 * (buf_size / block_size) / avctx->channels;
97 if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
98 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
102 buf_size = (s->frame.nb_samples * avctx->channels / 2) * block_size;
104 if (avctx->bits_per_coded_sample == 24) {
116 } else if (avctx->bits_per_coded_sample == 20) {
145 static int s302m_decode_init(AVCodecContext *avctx)
147 S302MDecodeContext *s = avctx->priv_data;
150 avctx->coded_frame = &s->frame;