]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/psymodel.c
ARM: intmath: use native-size return types for clipping functions
[ffmpeg] / libavcodec / psymodel.c
index 49df1189e436557f659bcaa052f0460d1c98f2ab..d145a53691c2e0c61aa3e6bafdf111899d42c8cb 100644 (file)
@@ -51,7 +51,7 @@ av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens,
     }
 
     switch (ctx->avctx->codec_id) {
-    case CODEC_ID_AAC:
+    case AV_CODEC_ID_AAC:
         ctx->model = &ff_aac_psy_model;
         break;
     }
@@ -112,19 +112,15 @@ av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *av
     return ctx;
 }
 
-void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, const float *audio,
-                       float *dest, int tag, int channels)
+void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, float **audio, int channels)
 {
-    int ch, i;
+    int ch;
+    int frame_size = ctx->avctx->frame_size;
+
     if (ctx->fstate) {
         for (ch = 0; ch < channels; ch++)
-            ff_iir_filter_flt(ctx->fcoeffs, ctx->fstate[tag+ch], ctx->avctx->frame_size,
-                          audio + ch, ctx->avctx->channels,
-                          dest  + ch, ctx->avctx->channels);
-    } else {
-        for (ch = 0; ch < channels; ch++)
-            for (i = 0; i < ctx->avctx->frame_size; i++)
-                dest[i*ctx->avctx->channels + ch] = audio[i*ctx->avctx->channels + ch];
+            ff_iir_filter_flt(ctx->fcoeffs, ctx->fstate[ch], frame_size,
+                              &audio[ch][frame_size], 1, &audio[ch][frame_size], 1);
     }
 }
 
@@ -138,4 +134,3 @@ av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
     av_freep(&ctx->fstate);
     av_free(ctx);
 }
-