From b1078e9fe6b5d8f034d15a6ab91430fd41921fe2 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 21 Apr 2010 17:57:48 +0000 Subject: Move clipping of audio samples (for those codecs outputting float) from decoder to the audio conversion routines. Originally committed as revision 22937 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/atrac1.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'libavcodec/atrac1.c') diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index 6159954966..5ff8816476 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -305,20 +305,15 @@ static int atrac1_decode_frame(AVCodecContext *avctx, void *data, at1_subband_synthesis(q, su, q->out_samples[ch]); } - /* round, convert to 16bit and interleave */ + /* interleave; FIXME, should create/use a DSP function */ if (q->channels == 1) { /* mono */ - q->dsp.vector_clipf(samples, q->out_samples[0], -32700.0 / (1 << 15), - 32700.0 / (1 << 15), AT1_SU_SAMPLES); + memcpy(samples, q->out_samples[0], AT1_SU_SAMPLES * 4); } else { /* stereo */ for (i = 0; i < AT1_SU_SAMPLES; i++) { - samples[i * 2] = av_clipf(q->out_samples[0][i], - -32700.0 / (1 << 15), - 32700.0 / (1 << 15)); - samples[i * 2 + 1] = av_clipf(q->out_samples[1][i], - -32700.0 / (1 << 15), - 32700.0 / (1 << 15)); + samples[i * 2] = q->out_samples[0][i]; + samples[i * 2 + 1] = q->out_samples[1][i]; } } -- cgit v1.2.3