Lines Matching defs:avctx

38         av_log(avctx, AV_LOG_WARNING, "Invalid value for %s: %s\n", name, opt_str);\
63 static av_cold int xavs2_init(AVCodecContext *avctx)
65 XAVS2EContext *cae = avctx->priv_data;
68 bit_depth = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? 8 : 10;
73 av_log(avctx, AV_LOG_ERROR, "Failed to get xavs2 api context\n");
79 av_log(avctx, AV_LOG_ERROR, "Failed to alloc xavs2 parameters\n");
83 xavs2_opt_set2("Width", "%d", avctx->width);
84 xavs2_opt_set2("Height", "%d", avctx->height);
85 xavs2_opt_set2("BFrames", "%d", avctx->max_b_frames);
90 xavs2_opt_set2("IntraPeriodMax", "%d", avctx->gop_size);
91 xavs2_opt_set2("IntraPeriodMin", "%d", avctx->gop_size);
93 xavs2_opt_set2("ThreadFrames", "%d", avctx->thread_count);
96 xavs2_opt_set2("OpenGOP", "%d", !(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP));
105 if (avctx->bit_rate > 0) {
107 xavs2_opt_set2("TargetBitRate", "%"PRId64"", avctx->bit_rate);
109 xavs2_opt_set2("MaxQP", "%d", avctx->qmax >= 0 ? avctx->qmax : cae->max_qp);
110 xavs2_opt_set2("MinQP", "%d", avctx->qmin >= 0 ? avctx->qmin : cae->min_qp);
115 ff_mpeg12_find_best_frame_rate(avctx->framerate, &code, NULL, NULL, 0);
121 av_log(avctx, AV_LOG_ERROR, "Failed to create xavs2 encoder instance.\n");
170 static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
173 XAVS2EContext *cae = avctx->priv_data;
180 av_log(avctx, AV_LOG_ERROR, "Failed to get xavs2 frame buffer\n");
199 av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");
211 av_log(avctx, AV_LOG_ERROR, "Encoding error occurred.\n");
220 if ((ret = ff_get_encode_buffer(avctx, pkt, cae->packet.len, 0)) < 0) {
246 static av_cold int xavs2_close(AVCodecContext *avctx)
248 XAVS2EContext *cae = avctx->priv_data;