Lines Matching defs:avctx
45 /* We clip the value of avctx->trellis to prevent data type overflows and
50 static av_cold int g722_encode_close(AVCodecContext *avctx)
52 G722Context *c = avctx->priv_data;
62 static av_cold int g722_encode_init(AVCodecContext * avctx)
64 G722Context *c = avctx->priv_data;
70 if (avctx->frame_size) {
72 if (avctx->frame_size & 1 || avctx->frame_size > MAX_FRAME_SIZE) {
75 if (avctx->frame_size == 1)
77 else if (avctx->frame_size > MAX_FRAME_SIZE)
80 new_frame_size = avctx->frame_size - 1;
82 av_log(avctx, AV_LOG_WARNING, "Requested frame size is not "
84 avctx->frame_size);
85 avctx->frame_size = new_frame_size;
90 avctx->frame_size = 320;
92 avctx->initial_padding = 22;
94 if (avctx->trellis) {
96 if (avctx->trellis < MIN_TRELLIS || avctx->trellis > MAX_TRELLIS) {
97 int new_trellis = av_clip(avctx->trellis, MIN_TRELLIS, MAX_TRELLIS);
98 av_log(avctx, AV_LOG_WARNING, "Requested trellis value is not "
100 avctx->trellis);
101 avctx->trellis = new_trellis;
103 if (avctx->trellis) {
104 int frontier = 1 << avctx->trellis;
344 static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
347 G722Context *c = avctx->priv_data;
352 if ((ret = ff_get_encode_buffer(avctx, avpkt, out_size, 0)) < 0)
357 if (avctx->trellis)
358 g722_encode_trellis(c, avctx->trellis, avpkt->data, nb_samples, samples);
369 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);