Lines Matching defs:avctx
53 static av_cold int libkvazaar_init(AVCodecContext *avctx)
55 LibkvazaarContext *const ctx = avctx->priv_data;
61 if (avctx->width % 8 || avctx->height % 8) {
62 av_log(avctx, AV_LOG_ERROR,
64 avctx->width, avctx->height);
70 av_log(avctx, AV_LOG_ERROR,
76 av_log(avctx, AV_LOG_ERROR,
81 cfg->width = avctx->width;
82 cfg->height = avctx->height;
84 if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
85 cfg->framerate_num = avctx->framerate.num;
86 cfg->framerate_denom = avctx->framerate.den;
88 if (avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) {
89 av_log(avctx, AV_LOG_ERROR,
93 cfg->framerate_num = avctx->time_base.den;
94 cfg->framerate_denom = avctx->time_base.num * avctx->ticks_per_frame;
96 cfg->target_bitrate = avctx->bit_rate;
97 cfg->vui.sar_width = avctx->sample_aspect_ratio.num;
98 cfg->vui.sar_height = avctx->sample_aspect_ratio.den;
99 if (avctx->bit_rate) {
109 av_log(avctx, AV_LOG_WARNING, "Invalid option: %s=%s.\n",
119 av_log(avctx, AV_LOG_ERROR, "Could not open kvazaar encoder.\n");
123 if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
132 avctx->extradata = p = av_mallocz(len_out + AV_INPUT_BUFFER_PADDING_SIZE);
138 avctx->extradata_size = len_out;
151 static av_cold int libkvazaar_close(AVCodecContext *avctx)
153 LibkvazaarContext *ctx = avctx->priv_data;
163 static int libkvazaar_encode(AVCodecContext *avctx,
168 LibkvazaarContext *ctx = avctx->priv_data;
182 av_log(avctx, AV_LOG_ERROR,
191 if (frame->format != avctx->pix_fmt) {
192 av_log(avctx, AV_LOG_ERROR,
195 av_get_pix_fmt_name(avctx->pix_fmt),
204 av_log(avctx, AV_LOG_ERROR, "Failed to allocate picture.\n");
237 av_log(avctx, AV_LOG_ERROR, "Failed to encode frame.\n");
247 retval = ff_get_encode_buffer(avctx, avpkt, len_out, 0);
249 av_log(avctx, AV_LOG_ERROR, "Failed to allocate output packet.\n");
280 av_log(avctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");