X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fffv1enc.c;h=e24c320e3202ccf66691bf3034f04eee62d52fa8;hb=9ca19971bcdd1af39680c15a0319d57505b9542b;hp=af42a18608b6f8064b9a1c537d3ed4beba6796eb;hpb=bb619f41bea81e6ee9e208476a92fced4107a853;p=ffmpeg diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index af42a18608b..e24c320e320 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -312,7 +312,7 @@ static av_always_inline int encode_line(FFV1Context *s, int w, diff = fold(diff, bits); if (s->ac) { - if (s->flags & CODEC_FLAG_PASS1) { + if (s->flags & AV_CODEC_FLAG_PASS1) { put_symbol_inline(c, p->state[context], diff, 1, s->rc_stat, s->rc_stat2[p->quant_table_index][context]); } else { @@ -550,7 +550,7 @@ static int write_extradata(FFV1Context *f) f->avctx->extradata_size = 10000 + 4 + (11 * 11 * 5 * 5 * 5 + 11 * 11 * 11) * 32; - f->avctx->extradata = av_malloc(f->avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + f->avctx->extradata = av_malloc(f->avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!f->avctx->extradata) return AVERROR(ENOMEM); ff_init_range_encoder(c, f->avctx->extradata, f->avctx->extradata_size); @@ -672,7 +672,8 @@ static av_cold int encode_init(AVCodecContext *avctx) s->version = 0; - if ((avctx->flags & (CODEC_FLAG_PASS1|CODEC_FLAG_PASS2)) || avctx->slices>1) + if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) || + avctx->slices > 1) s->version = FFMAX(s->version, 2); // Unspecified level & slices, we choose version 1.2+ to ensure multithreaded decodability @@ -867,7 +868,7 @@ FF_ENABLE_DEPRECATION_WARNINGS avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift); s->picture_number = 0; - if (avctx->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) { + if (avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) { for (i = 0; i < s->quant_table_count; i++) { s->rc_stat2[i] = av_mallocz(s->context_count[i] * sizeof(*s->rc_stat2[i])); @@ -980,7 +981,7 @@ slices_ok: return ret; #define STATS_OUT_SIZE 1024 * 1024 * 6 - if (avctx->flags & CODEC_FLAG_PASS1) { + if (avctx->flags & AV_CODEC_FLAG_PASS1) { avctx->stats_out = av_mallocz(STATS_OUT_SIZE); if (!avctx->stats_out) return AVERROR(ENOMEM); @@ -1196,11 +1197,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, uint8_t keystate = 128; uint8_t *buf_p; int i, ret; - int64_t maxsize = FF_MIN_BUFFER_SIZE + int64_t maxsize = AV_INPUT_BUFFER_MIN_SIZE + avctx->width*avctx->height*35LL*4; if(!pict) { - if (avctx->flags & CODEC_FLAG_PASS1) { + if (avctx->flags & AV_CODEC_FLAG_PASS1) { int j, k, m; char *p = avctx->stats_out; char *end = p + STATS_OUT_SIZE; @@ -1245,9 +1246,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, } if (f->version > 3) - maxsize = FF_MIN_BUFFER_SIZE + avctx->width*avctx->height*3LL*4; + maxsize = AV_INPUT_BUFFER_MIN_SIZE + avctx->width*avctx->height*3LL*4; - if ((ret = ff_alloc_packet2(avctx, pkt, maxsize)) < 0) + if ((ret = ff_alloc_packet2(avctx, pkt, maxsize, 0)) < 0) return ret; ff_init_range_encoder(c, pkt->data, pkt->size); @@ -1315,7 +1316,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, buf_p += bytes; } - if (avctx->flags & CODEC_FLAG_PASS1) + if (avctx->flags & AV_CODEC_FLAG_PASS1) avctx->stats_out[0] = '\0'; #if FF_API_CODED_FRAME @@ -1368,7 +1369,7 @@ AVCodec ff_ffv1_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .capabilities = CODEC_CAP_SLICE_THREADS | CODEC_CAP_DELAY, + .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_DELAY, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,