Mercurial > libavcodec.hg
changeset 11550:ee30fc612763 libavcodec
Simplify interleaving code.
author | rbultje |
---|---|
date | Mon, 29 Mar 2010 17:37:03 +0000 |
parents | 12416eb1ba88 |
children | 04f5fe406669 |
files | wmaprodec.c |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/wmaprodec.c Mon Mar 29 12:53:35 2010 +0000 +++ b/wmaprodec.c Mon Mar 29 17:37:03 2010 +0000 @@ -1346,14 +1346,12 @@ /** 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; + float* iend = iptr + s->samples_per_frame; - ptr = s->samples + i; - - for (x = 0; x < s->samples_per_frame; x++) { + while (iptr < iend) { *ptr = av_clipf(*iptr++, -1.0, 32767.0 / 32768.0); ptr += incr; }