diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2010-03-29 17:37:03 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2010-03-29 17:37:03 +0000 |
commit | 8ff5d1f31966573ac807d2b4020c39be35463ecf (patch) | |
tree | 695369da12d8531b83a3d120a74521224563ca35 | |
parent | 9cba6f5f4077e30fdf42eddf6b6e9af07979f9e8 (diff) | |
download | ffmpeg-8ff5d1f31966573ac807d2b4020c39be35463ecf.tar.gz |
Simplify interleaving code.
Originally committed as revision 22719 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/wmaprodec.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 922b75beff..a323a19fba 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -1346,14 +1346,12 @@ static int decode_frame(WMAProDecodeCtx *s) /** interleave samples and write them to the output buffer */ for (i = 0; i < s->num_channels; i++) { - float* ptr; + float* ptr = s->samples + i; int incr = s->num_channels; float* iptr = s->channel[i].out; - int x; - - ptr = s->samples + i; + float* iend = iptr + s->samples_per_frame; - for (x = 0; x < s->samples_per_frame; x++) { + while (iptr < iend) { *ptr = av_clipf(*iptr++, -1.0, 32767.0 / 32768.0); ptr += incr; } |