Lines Matching defs:avctx
101 static int adx_encode_header(AVCodecContext *avctx, uint8_t *buf, int bufsize)
103 ADXContext *c = avctx->priv_data;
110 bytestream_put_byte(&buf, avctx->ch_layout.nb_channels); /* channels */
111 bytestream_put_be32(&buf, avctx->sample_rate); /* sample rate */
124 static av_cold int adx_encode_init(AVCodecContext *avctx)
126 ADXContext *c = avctx->priv_data;
128 if (avctx->ch_layout.nb_channels > 2) {
129 av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
132 avctx->frame_size = BLOCK_SAMPLES;
136 ff_adx_calculate_coeffs(c->cutoff, avctx->sample_rate, COEFF_BITS, c->coeff);
141 static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
144 ADXContext *c = avctx->priv_data;
147 int channels = avctx->ch_layout.nb_channels;
153 if ((ret = ff_get_encode_buffer(avctx, avpkt, 18, 0)) < 0)
167 if ((ret = ff_get_encode_buffer(avctx, avpkt, out_size, 0)) < 0)
173 if ((hdrsize = adx_encode_header(avctx, dst, avpkt->size)) < 0) {
174 av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n");