* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <string.h>
+
#include "avcodec.h"
#include "psymodel.h"
#include "iirfilter.h"
+#include "libavutil/mem.h"
extern const FFPsyModel ff_aac_psy_model;
}
switch (ctx->avctx->codec_id) {
- case CODEC_ID_AAC:
+ case AV_CODEC_ID_AAC:
ctx->model = &ff_aac_psy_model;
break;
}
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);
}
}
av_freep(&ctx->fstate);
av_free(ctx);
}
-