Lines Matching defs:avctx
543 static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
548 ProresContext *ctx = avctx->priv_data;
588 pwidth = avctx->width;
593 pwidth = avctx->width >> 1;
602 pwidth, avctx->height / ctx->pictures_per_frame,
616 pwidth, avctx->height / ctx->pictures_per_frame,
791 static int find_slice_quant(AVCodecContext *avctx,
795 ProresContext *ctx = avctx->priv_data;
827 pwidth = avctx->width;
832 pwidth = avctx->width >> 1;
841 pwidth, avctx->height / ctx->pictures_per_frame,
846 pwidth, avctx->height / ctx->pictures_per_frame,
960 static int find_quant_thread(AVCodecContext *avctx, void *arg,
963 ProresContext *ctx = avctx->priv_data;
971 q = find_slice_quant(avctx,
984 static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
987 ProresContext *ctx = avctx->priv_data;
1002 if ((ret = ff_alloc_packet(avctx, pkt, pkt_size + AV_INPUT_BUFFER_MIN_SIZE)) < 0)
1017 bytestream_put_be16 (&buf, avctx->width);
1018 bytestream_put_be16 (&buf, avctx->height);
1021 if (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT)
1060 ret = avctx->execute2(avctx, find_quant_thread, (void*)pic, NULL,
1090 avpriv_request_sample(avctx,
1112 ret = encode_slice(avctx, pic, &pb, sizes, x, y, q,
1144 static av_cold int encode_close(AVCodecContext *avctx)
1146 ProresContext *ctx = avctx->priv_data;
1150 for (i = 0; i < avctx->thread_count; i++)
1173 static av_cold int encode_init(AVCodecContext *avctx)
1175 ProresContext *ctx = avctx->priv_data;
1179 int interlaced = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
1181 avctx->bits_per_raw_sample = 10;
1186 ff_fdctdsp_init(&ctx->fdsp, avctx);
1190 av_log(avctx, AV_LOG_ERROR,
1195 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
1199 av_log(avctx, AV_LOG_INFO, "Autoselected %s. It can be overridden "
1204 if (av_pix_fmt_desc_get(avctx->pix_fmt)->flags & AV_PIX_FMT_FLAG_ALPHA) {
1208 av_log(avctx, AV_LOG_WARNING, "Profile selected will not "
1213 av_log(avctx, AV_LOG_ERROR, "alpha bits should be 0, 8 or 16\n");
1216 avctx->bits_per_coded_sample = 32;
1221 ctx->chroma_factor = avctx->pix_fmt == AV_PIX_FMT_YUV422P10
1227 ctx->mb_width = FFALIGN(avctx->width, 16) >> 4;
1230 ctx->mb_height = FFALIGN(avctx->height, 32) >> 5;
1232 ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
1248 av_log(avctx, AV_LOG_ERROR, "vendor ID should be 4 bytes\n");
1252 ctx->force_quant = avctx->global_quality / FF_QP2LAMBDA;
1263 av_log(avctx, AV_LOG_ERROR, "too few bits per MB, please set at least 128\n");
1280 ctx->tdata = av_calloc(avctx->thread_count, sizeof(*ctx->tdata));
1284 for (j = 0; j < avctx->thread_count; j++) {
1301 av_log(avctx, AV_LOG_ERROR, "too large quantiser, maximum is 64\n");
1331 avctx->codec_tag = ctx->profile_info->tag;
1333 av_log(avctx, AV_LOG_DEBUG,
1337 av_log(avctx, AV_LOG_DEBUG, "frame size upper bound: %d\n",