]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/nellymoserenc.c
imc: fix undefined float to int conversion
[ffmpeg] / libavcodec / nellymoserenc.c
index 3c50cb4c565855fbd3ac45e9960765a547bf10b6..a596926f5013b8ae894e71d6a1f25f4c8c0ad6ab 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 /**
- * @file libavcodec/nellymoserenc.c
+ * @file
  * Nellymoser encoder
  * by Bartlomiej Wolowiec
  *
@@ -38,6 +38,7 @@
 #include "nellymoser.h"
 #include "avcodec.h"
 #include "dsputil.h"
+#include "fft.h"
 
 #define BITSTREAM_WRITER_LE
 #include "put_bits.h"
@@ -53,9 +54,9 @@ typedef struct NellyMoserEncodeContext {
     int             have_saved;
     DSPContext      dsp;
     FFTContext      mdct_ctx;
-    DECLARE_ALIGNED_16(float, mdct_out[NELLY_SAMPLES]);
-    DECLARE_ALIGNED_16(float, in_buff[NELLY_SAMPLES]);
-    DECLARE_ALIGNED_16(float, buf[2][3 * NELLY_BUF_LEN]);     ///< sample buffer
+    DECLARE_ALIGNED(16, float, mdct_out)[NELLY_SAMPLES];
+    DECLARE_ALIGNED(16, float, in_buff)[NELLY_SAMPLES];
+    DECLARE_ALIGNED(16, float, buf)[2][3 * NELLY_BUF_LEN];     ///< sample buffer
     float           (*opt )[NELLY_BANDS];
     uint8_t         (*path)[NELLY_BANDS];
 } NellyMoserEncodeContext;
@@ -269,7 +270,7 @@ static void get_exponent_dynamic(NellyMoserEncodeContext *s, float *cand, int *i
 }
 
 /**
- * Encodes NELLY_SAMPLES samples. It assumes, that samples contains 3 * NELLY_BUF_LEN values
+ * Encode NELLY_SAMPLES samples. It assumes, that samples contains 3 * NELLY_BUF_LEN values
  *  @param s               encoder context
  *  @param output          output buffer
  *  @param output_size     size of output buffer
@@ -350,7 +351,7 @@ static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int
 static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data)
 {
     NellyMoserEncodeContext *s = avctx->priv_data;
-    int16_t *samples = data;
+    const int16_t *samples = data;
     int i;
 
     if (s->last_frame)
@@ -383,7 +384,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, voi
 
 AVCodec nellymoser_encoder = {
     .name = "nellymoser",
-    .type = CODEC_TYPE_AUDIO,
+    .type = AVMEDIA_TYPE_AUDIO,
     .id = CODEC_ID_NELLYMOSER,
     .priv_data_size = sizeof(NellyMoserEncodeContext),
     .init = encode_init,
@@ -391,4 +392,5 @@ AVCodec nellymoser_encoder = {
     .close = encode_end,
     .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
     .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"),
+    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
 };