Lines Matching refs:avctx
39 /* We clip the value of avctx->trellis to prevent data type overflows and
44 static av_cold int g722_encode_init(AVCodecContext * avctx)
46 G722Context *c = avctx->priv_data;
48 if (avctx->channels != 1) {
49 av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n");
57 if (avctx->trellis) {
58 int frontier = 1 << avctx->trellis;
68 if (avctx->frame_size) {
70 if (avctx->frame_size & 1 || avctx->frame_size > MAX_FRAME_SIZE) {
73 if (avctx->frame_size == 1)
75 else if (avctx->frame_size > MAX_FRAME_SIZE)
78 new_frame_size = avctx->frame_size - 1;
80 av_log(avctx, AV_LOG_WARNING, "Requested frame size is not "
82 avctx->frame_size);
83 avctx->frame_size = new_frame_size;
88 avctx->frame_size = 320;
91 if (avctx->trellis) {
93 if (avctx->trellis < MIN_TRELLIS || avctx->trellis > MAX_TRELLIS) {
94 int new_trellis = av_clip(avctx->trellis, MIN_TRELLIS, MAX_TRELLIS);
95 av_log(avctx, AV_LOG_WARNING, "Requested trellis value is not "
97 avctx->trellis);
98 avctx->trellis = new_trellis;
105 static av_cold int g722_encode_close(AVCodecContext *avctx)
107 G722Context *c = avctx->priv_data;
340 static int g722_encode_frame(AVCodecContext *avctx,
343 G722Context *c = avctx->priv_data;
347 nb_samples = avctx->frame_size - (avctx->frame_size & 1);
349 if (avctx->trellis)
350 g722_encode_trellis(c, avctx->trellis, dst, nb_samples, samples);
355 if (nb_samples < avctx->frame_size) {
360 return (avctx->frame_size + 1) >> 1;