]> git.sesse.net Git - ffmpeg/commitdiff
avcodec: stop using deprecated codec flags
authorJames Almer <jamrial@gmail.com>
Sun, 26 Mar 2017 00:35:15 +0000 (21:35 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 26 Mar 2017 00:37:05 +0000 (21:37 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/aaccoder.c
libavcodec/aaccoder_twoloop.h
libavcodec/aacenc.c
libavcodec/aacpsy.c
libavcodec/clearvideo.c
libavcodec/pngenc.c
libavcodec/psymodel.h
libavcodec/snowenc.c
libavcodec/xpmdec.c

index 9f3b4ed3895b19440ba58b57a167e1fdedd10699..abd0b9c636c1725f72d0a62fe4ee1e1aff223ce5 100644 (file)
@@ -557,13 +557,13 @@ static void search_for_pns(AACEncContext *s, AVCodecContext *avctx, SingleChanne
     const float pns_transient_energy_r = FFMIN(0.7f, lambda / 140.f);
 
     int refbits = avctx->bit_rate * 1024.0 / avctx->sample_rate
-        / ((avctx->flags & CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
+        / ((avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
         * (lambda / 120.f);
 
     /** Keep this in sync with twoloop's cutoff selection */
     float rate_bandwidth_multiplier = 1.5f;
     int prev = -1000, prev_sf = -1;
-    int frame_bit_rate = (avctx->flags & CODEC_FLAG_QSCALE)
+    int frame_bit_rate = (avctx->flags & AV_CODEC_FLAG_QSCALE)
         ? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024)
         : (avctx->bit_rate / avctx->channels);
 
@@ -694,12 +694,12 @@ static void mark_pns(AACEncContext *s, AVCodecContext *avctx, SingleChannelEleme
     const float pns_transient_energy_r = FFMIN(0.7f, lambda / 140.f);
 
     int refbits = avctx->bit_rate * 1024.0 / avctx->sample_rate
-        / ((avctx->flags & CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
+        / ((avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
         * (lambda / 120.f);
 
     /** Keep this in sync with twoloop's cutoff selection */
     float rate_bandwidth_multiplier = 1.5f;
-    int frame_bit_rate = (avctx->flags & CODEC_FLAG_QSCALE)
+    int frame_bit_rate = (avctx->flags & AV_CODEC_FLAG_QSCALE)
         ? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024)
         : (avctx->bit_rate / avctx->channels);
 
index f175c5f8b88463fa5ea6957a2f1b13e5764ee719..8e1bc88a8538f41e71a1bd1e4168c78c04d27fa5 100644 (file)
@@ -71,7 +71,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
 {
     int start = 0, i, w, w2, g, recomprd;
     int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate
-        / ((avctx->flags & CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
+        / ((avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : avctx->channels)
         * (lambda / 120.f);
     int refbits = destbits;
     int toomanybits, toofewbits;
@@ -136,7 +136,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
             * (lambda / (avctx->global_quality ? avctx->global_quality : 120));
     }
 
-    if (avctx->flags & CODEC_FLAG_QSCALE) {
+    if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
         /**
          * Constant Q-scale doesn't compensate MS coding on its own
          * No need to be overly precise, this only controls RD
@@ -184,7 +184,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
          * AAC_CUTOFF_FROM_BITRATE is calibrated for effective bitrate.
          */
         float rate_bandwidth_multiplier = 1.5f;
-        int frame_bit_rate = (avctx->flags & CODEC_FLAG_QSCALE)
+        int frame_bit_rate = (avctx->flags & AV_CODEC_FLAG_QSCALE)
             ? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024)
             : (avctx->bit_rate / avctx->channels);
 
@@ -332,7 +332,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
                     sce->coeffs + start,
                     nzslope * cleanup_factor);
                 energy2uplim *= de_psy_factor;
-                if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
+                if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) {
                     /** In ABR, we need to priorize less and let rate control do its thing */
                     energy2uplim = sqrtf(energy2uplim);
                 }
@@ -346,7 +346,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
                     sce->coeffs + start,
                     2.0f);
                 energy2uplim *= de_psy_factor;
-                if (!(avctx->flags & CODEC_FLAG_QSCALE)) {
+                if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) {
                     /** In ABR, we need to priorize less and let rate control do its thing */
                     energy2uplim = sqrtf(energy2uplim);
                 }
index 956e974cb2abaceec84dd98895bb63fdfa05c880..11da260742b09695ce4f7e114b719ebc4f592b80 100644 (file)
@@ -769,7 +769,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
             start_ch += chans;
         }
 
-        if (avctx->flags & CODEC_FLAG_QSCALE) {
+        if (avctx->flags & AV_CODEC_FLAG_QSCALE) {
             /* When using a constant Q-scale, don't mess with lambda */
             break;
         }
index a5fec7374ee37d99591ebcdbf731f86c3c948eda..e32faaa908075a748932321861991ff7af8a224a 100644 (file)
@@ -303,7 +303,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
     float bark;
     int i, j, g, start;
     float prev, minscale, minath, minsnr, pe_min;
-    int chan_bitrate = ctx->avctx->bit_rate / ((ctx->avctx->flags & CODEC_FLAG_QSCALE) ? 2.0f : ctx->avctx->channels);
+    int chan_bitrate = ctx->avctx->bit_rate / ((ctx->avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : ctx->avctx->channels);
 
     const int bandwidth    = ctx->cutoff ? ctx->cutoff : AAC_CUTOFF(ctx->avctx);
     const float num_bark   = calc_bark((float)bandwidth);
@@ -314,7 +314,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
     pctx = (AacPsyContext*) ctx->model_priv_data;
     pctx->global_quality = (ctx->avctx->global_quality ? ctx->avctx->global_quality : 120) * 0.01f;
 
-    if (ctx->avctx->flags & CODEC_FLAG_QSCALE) {
+    if (ctx->avctx->flags & AV_CODEC_FLAG_QSCALE) {
         /* Use the target average bitrate to compute spread parameters */
         chan_bitrate = (int)(chan_bitrate / 120.0 * (ctx->avctx->global_quality ? ctx->avctx->global_quality : 120));
     }
@@ -704,7 +704,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
 
     /* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
     ctx->ch[channel].entropy = pe;
-    if (ctx->avctx->flags & CODEC_FLAG_QSCALE) {
+    if (ctx->avctx->flags & AV_CODEC_FLAG_QSCALE) {
         /* (2.5 * 120) achieves almost transparent rate, and we want to give
          * ample room downwards, so we make that equivalent to QSCALE=2.4
          */
index 91f37e1b62a7f1ba9d70a1bfced59bb3d7c414c2..e2644e3090d114821c460413110c411dc43522b1 100644 (file)
@@ -382,6 +382,6 @@ AVCodec ff_clearvideo_decoder = {
     .init           = clv_decode_init,
     .close          = clv_decode_end,
     .decode         = clv_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("Iterated Systems ClearVideo"),
 };
index f67a546f951d43176be9562b220d5959681926c4..69b44954049a5b3448d921d78a1d2a5c0273d8af 100644 (file)
@@ -873,7 +873,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
         if (!pict)
             return AVERROR(EINVAL);
 
-        s->bytestream = s->extra_data = av_malloc(FF_MIN_BUFFER_SIZE);
+        s->bytestream = s->extra_data = av_malloc(AV_INPUT_BUFFER_MIN_SIZE);
         if (!s->extra_data)
             return AVERROR(ENOMEM);
 
@@ -1167,7 +1167,7 @@ AVCodec ff_apng_encoder = {
     .init           = png_enc_init,
     .close          = png_enc_close,
     .encode2        = encode_apng,
-    .capabilities   = CODEC_CAP_DELAY,
+    .capabilities   = AV_CODEC_CAP_DELAY,
     .pix_fmts       = (const enum AVPixelFormat[]) {
         AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
         AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE,
index 582f040c7a380f15cd1ee809796ffc1df5db62a2..e5f917d495d0bbf405b16ed7228df41517861220 100644 (file)
@@ -39,7 +39,7 @@
     22000, \
     sample_rate / 2): (sample_rate / 2))
 #define AAC_CUTOFF(s) ( \
-    (s->flags & CODEC_FLAG_QSCALE) \
+    (s->flags & AV_CODEC_FLAG_QSCALE) \
     ? s->sample_rate / 2 \
     : AAC_CUTOFF_FROM_BITRATE(s->bit_rate, s->channels, s->sample_rate) \
 )
index 5cc7997f5c9c4b0484971729211dbfdd292f4304..ca55914d9e313c78603a32ed51b2738e7dd75a18 100644 (file)
@@ -106,11 +106,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
         if (!avctx->stats_out)
             return AVERROR(ENOMEM);
     }
-    if((avctx->flags&AV_CODEC_FLAG_PASS2) || !(avctx->flags&CODEC_FLAG_QSCALE)){
+    if((avctx->flags&AV_CODEC_FLAG_PASS2) || !(avctx->flags&AV_CODEC_FLAG_QSCALE)){
         if(ff_rate_control_init(&s->m) < 0)
             return -1;
     }
-    s->pass1_rc= !(avctx->flags & (AV_CODEC_FLAG_QSCALE|CODEC_FLAG_PASS2));
+    s->pass1_rc= !(avctx->flags & (AV_CODEC_FLAG_QSCALE|AV_CODEC_FLAG_PASS2));
 
     switch(avctx->pix_fmt){
     case AV_PIX_FMT_YUV444P:
index 3c025a6bc5baa0d9b7c4b59debb704189a62673b..9112d4cb5e0b37b7878276322fd9a4d15ce6f649 100644 (file)
@@ -415,6 +415,6 @@ AVCodec ff_xpm_decoder = {
     .priv_data_size = sizeof(XPMDecContext),
     .close          = xpm_decode_close,
     .decode         = xpm_decode_frame,
-    .capabilities   = CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_DR1,
     .long_name      = NULL_IF_CONFIG_SMALL("XPM (X PixMap) image")
 };