Lines Matching defs:avctx

404     f->avctx->extradata_size = 10000 + 4 +
406 f->avctx->extradata = av_malloc(f->avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
407 if (!f->avctx->extradata)
409 ff_init_range_encoder(c, f->avctx->extradata, f->avctx->extradata_size);
455 put_symbol(c, state, f->intra = (f->avctx->gop_size < 2), 0);
458 f->avctx->extradata_size = ff_rac_terminate(c, 0);
459 v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0, f->avctx->extradata, f->avctx->extradata_size);
460 AV_WL32(f->avctx->extradata + f->avctx->extradata_size, v);
461 f->avctx->extradata_size += 4;
514 static av_cold int encode_init(AVCodecContext *avctx)
516 FFV1Context *s = avctx->priv_data;
517 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
520 if ((ret = ff_ffv1_common_init(avctx)) < 0)
525 if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) ||
526 avctx->slices > 1)
530 if (avctx->slices == 0 && avctx->level < 0 && avctx->width * avctx->height > 720*576)
533 if (avctx->level <= 0 && s->version == 2) {
536 if (avctx->level >= 0 && avctx->level <= 4) {
537 if (avctx->level < s->version) {
538 av_log(avctx, AV_LOG_ERROR, "Version %d needed for requested features but %d requested\n", s->version, avctx->level);
541 s->version = avctx->level;
552 if ((s->version == 2 || s->version>3) && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
553 av_log(avctx, AV_LOG_ERROR, "Version 2 needed for requested features but version 2 is experimental and not enabled\n");
563 switch(avctx->pix_fmt) {
571 if (!avctx->bits_per_raw_sample)
581 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
588 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
593 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
603 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) {
606 s->bits_per_raw_sample = avctx->bits_per_raw_sample;
609 av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n");
627 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
659 if (!avctx->bits_per_raw_sample)
663 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
667 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
670 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
674 if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample)
677 s->bits_per_raw_sample = avctx->bits_per_raw_sample;
687 av_log(avctx, AV_LOG_ERROR, "format not supported\n");
694 av_log(avctx, AV_LOG_INFO,
753 ret = av_pix_fmt_get_chroma_sub_sample (avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
759 if (avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) {
767 if (avctx->stats_in) {
768 char *p = avctx->stats_in;
782 av_log(avctx, AV_LOG_ERROR,
795 av_log(avctx, AV_LOG_ERROR,
806 av_log(avctx, AV_LOG_ERROR, "2Pass file invalid\n");
851 int max_h_slices = AV_CEIL_RSHIFT(avctx->width , s->chroma_h_shift);
852 int max_v_slices = AV_CEIL_RSHIFT(avctx->height, s->chroma_v_shift);
853 s->num_v_slices = (avctx->width > 352 || avctx->height > 288 || !avctx->slices) ? 2 : 1;
859 int maxw = (avctx->width + s->num_h_slices - 1) / s->num_h_slices;
860 int maxh = (avctx->height + s->num_v_slices - 1) / s->num_v_slices;
865 if (avctx->slices == s->num_h_slices * s->num_v_slices && avctx->slices <= MAX_SLICES || !avctx->slices)
869 av_log(avctx, AV_LOG_ERROR,
872 avctx->slices);
886 if (avctx->flags & AV_CODEC_FLAG_PASS1) {
887 avctx->stats_out = av_mallocz(STATS_OUT_SIZE);
888 if (!avctx->stats_out)
1022 FFV1Context *f = fs->avctx->priv_data;
1096 static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
1099 FFV1Context *f = avctx->priv_data;
1106 + avctx->width*avctx->height*37LL*4;
1109 if (avctx->flags & AV_CODEC_FLAG_PASS1) {
1111 char *p = avctx->stats_out;
1155 maxsize = AV_INPUT_BUFFER_MIN_SIZE + avctx->width*avctx->height*3LL*4;
1158 av_log(avctx, AV_LOG_WARNING, "Cannot allocate worst case packet size, the encoding could fail\n");
1162 if ((ret = ff_alloc_packet(avctx, pkt, maxsize)) < 0)
1172 if (avctx->gop_size == 0 || f->picture_number % avctx->gop_size == 0) {
1202 avctx->execute(avctx, encode_slice, &f->slice_context[0], NULL,
1233 if (avctx->flags & AV_CODEC_FLAG_PASS1)
1234 avctx->stats_out[0] = '\0';
1246 static av_cold int encode_close(AVCodecContext *avctx)
1248 ff_ffv1_close(avctx);