Mercurial > libavcodec.hg
comparison wmaprodec.c @ 11652:8b6f3d3b55cb libavcodec
Move clipping of audio samples (for those codecs outputting float) from decoder
to the audio conversion routines.
author | rbultje |
---|---|
date | Wed, 21 Apr 2010 17:57:48 +0000 |
parents | 7dd2a45249a9 |
children | a08f20066719 |
comparison
equal
deleted
inserted
replaced
11651:926ad89ae57a | 11652:8b6f3d3b55cb |
---|---|
1349 float* ptr = s->samples + i; | 1349 float* ptr = s->samples + i; |
1350 int incr = s->num_channels; | 1350 int incr = s->num_channels; |
1351 float* iptr = s->channel[i].out; | 1351 float* iptr = s->channel[i].out; |
1352 float* iend = iptr + s->samples_per_frame; | 1352 float* iend = iptr + s->samples_per_frame; |
1353 | 1353 |
1354 // FIXME should create/use a DSP function here | |
1354 while (iptr < iend) { | 1355 while (iptr < iend) { |
1355 *ptr = av_clipf(*iptr++, -1.0, 32767.0 / 32768.0); | 1356 *ptr = *iptr++; |
1356 ptr += incr; | 1357 ptr += incr; |
1357 } | 1358 } |
1358 | 1359 |
1359 /** reuse second half of the IMDCT output for the next frame */ | 1360 /** reuse second half of the IMDCT output for the next frame */ |
1360 memcpy(&s->channel[i].out[0], | 1361 memcpy(&s->channel[i].out[0], |