]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/nellymoserenc.c
Icc 11.1 still does not align the stack pointer, disable some x264 functions.
[ffmpeg] / libavcodec / nellymoserenc.c
index 1cf0f14e19e5edddfe681a78d68081f7403a50c9..c9f93dbcb88656464a88f83479a36989b4cdbff4 100644 (file)
@@ -54,6 +54,7 @@ typedef struct NellyMoserEncodeContext {
     DSPContext      dsp;
     MDCTContext     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
     float           (*opt )[NELLY_BANDS];
     uint8_t         (*path)[NELLY_BANDS];
@@ -111,13 +112,11 @@ static const uint8_t quant_lut_offset[8] = { 0, 0, 1, 4, 11, 32, 81, 230 };
 
 void apply_mdct(NellyMoserEncodeContext *s)
 {
-    DECLARE_ALIGNED_16(float, in_buff[NELLY_SAMPLES]);
-
-    memcpy(in_buff, s->buf[s->bufsel], NELLY_BUF_LEN * sizeof(float));
-    s->dsp.vector_fmul(in_buff, ff_sine_128, NELLY_BUF_LEN);
-    s->dsp.vector_fmul_reverse(in_buff + NELLY_BUF_LEN, s->buf[s->bufsel] + NELLY_BUF_LEN, ff_sine_128,
+    memcpy(s->in_buff, s->buf[s->bufsel], NELLY_BUF_LEN * sizeof(float));
+    s->dsp.vector_fmul(s->in_buff, ff_sine_128, NELLY_BUF_LEN);
+    s->dsp.vector_fmul_reverse(s->in_buff + NELLY_BUF_LEN, s->buf[s->bufsel] + NELLY_BUF_LEN, ff_sine_128,
                                NELLY_BUF_LEN);
-    ff_mdct_calc(&s->mdct_ctx, s->mdct_out, in_buff);
+    ff_mdct_calc(&s->mdct_ctx, s->mdct_out, s->in_buff);
 
     s->dsp.vector_fmul(s->buf[s->bufsel] + NELLY_BUF_LEN, ff_sine_128, NELLY_BUF_LEN);
     s->dsp.vector_fmul_reverse(s->buf[s->bufsel] + 2 * NELLY_BUF_LEN, s->buf[1 - s->bufsel], ff_sine_128,
@@ -135,16 +134,17 @@ static av_cold int encode_init(AVCodecContext *avctx)
         return -1;
     }
 
-    if (avctx->sample_rate != 8000 && avctx->sample_rate != 11025 &&
+    if (avctx->sample_rate != 8000 && avctx->sample_rate != 16000 &&
+        avctx->sample_rate != 11025 &&
         avctx->sample_rate != 22050 && avctx->sample_rate != 44100 &&
         avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
-        av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 11025, 22050 and 44100 sample rate\n");
+        av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 16000, 11025, 22050 and 44100 sample rate\n");
         return -1;
     }
 
     avctx->frame_size = NELLY_SAMPLES;
     s->avctx = avctx;
-    ff_mdct_init(&s->mdct_ctx, 8, 0);
+    ff_mdct_init(&s->mdct_ctx, 8, 0, 1.0);
     dsputil_init(&s->dsp, avctx);
 
     /* Generate overlap window */