]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/nellymoserenc.c
aarch64: vp9itxfm: Restructure the idct32 store macros
[ffmpeg] / libavcodec / nellymoserenc.c
index fc803a2d5646cd2b540973eaa400afd2ec388acc..9d120816e0dcd8ce654ca3abcbcb19e4338f5cea 100644 (file)
  * http://wiki.multimedia.cx/index.php?title=Nellymoser
  */
 
+#include "libavutil/common.h"
 #include "libavutil/float_dsp.h"
 #include "libavutil/mathematics.h"
-#include "nellymoser.h"
-#include "avcodec.h"
+
 #include "audio_frame_queue.h"
+#include "avcodec.h"
 #include "fft.h"
 #include "internal.h"
+#include "nellymoser.h"
 #include "sinewin.h"
 
 #define BITSTREAM_WRITER_LE
@@ -60,8 +62,8 @@ typedef struct NellyMoserEncodeContext {
     DECLARE_ALIGNED(32, float, mdct_out)[NELLY_SAMPLES];
     DECLARE_ALIGNED(32, float, in_buff)[NELLY_SAMPLES];
     DECLARE_ALIGNED(32, float, buf)[3 * NELLY_BUF_LEN];     ///< sample buffer
-    float           (*opt )[NELLY_BANDS];
-    uint8_t         (*path)[NELLY_BANDS];
+    float           (*opt )[OPT_SIZE];
+    uint8_t         (*path)[OPT_SIZE];
 } NellyMoserEncodeContext;
 
 static float pow_table[POW_TABLE_SIZE];     ///< -pow(2, -i / 2048.0 - 3.0);
@@ -163,12 +165,12 @@ static av_cold int encode_init(AVCodecContext *avctx)
     }
 
     avctx->frame_size = NELLY_SAMPLES;
-    avctx->delay      = NELLY_BUF_LEN;
+    avctx->initial_padding = NELLY_BUF_LEN;
     ff_af_queue_init(avctx, &s->afq);
     s->avctx = avctx;
     if ((ret = ff_mdct_init(&s->mdct_ctx, 8, 0, 32768.0)) < 0)
         goto error;
-    avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+    avpriv_float_dsp_init(&s->fdsp, avctx->flags & AV_CODEC_FLAG_BITEXACT);
 
     /* Generate overlap window */
     ff_sine_window_init(ff_sine_128, 128);
@@ -226,10 +228,10 @@ static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int *i
     int i, j, band, best_idx;
     float power_candidate, best_val;
 
-    float  (*opt )[NELLY_BANDS] = s->opt ;
-    uint8_t(*path)[NELLY_BANDS] = s->path;
+    float  (*opt )[OPT_SIZE] = s->opt ;
+    uint8_t(*path)[OPT_SIZE] = s->path;
 
-    for (i = 0; i < NELLY_BANDS * OPT_SIZE; i++) {
+    for (i = 0; i < OPT_SIZE; i++) {
         opt[0][i] = INFINITY;
     }
 
@@ -413,7 +415,7 @@ AVCodec ff_nellymoser_encoder = {
     .init           = encode_init,
     .encode2        = encode_frame,
     .close          = encode_end,
-    .capabilities   = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
+    .capabilities   = AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_DELAY,
     .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
                                                      AV_SAMPLE_FMT_NONE },
 };