summaryrefslogtreecommitdiff
path: root/libavcodec/atrac1.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2010-04-21 17:57:48 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-04-21 17:57:48 +0000
commitb1078e9fe6b5d8f034d15a6ab91430fd41921fe2 (patch)
tree5d16af4805e9567267f3f3daa96e015523f4216c /libavcodec/atrac1.c
parent6858ce2ffc4c57a279b22ab6d8eb56ac3884796e (diff)
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
Diffstat (limited to 'libavcodec/atrac1.c')
-rw-r--r--libavcodec/atrac1.c13
1 files changed, 4 insertions, 9 deletions
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];
}
}