[FFmpeg-devel] [PATCH] wmaprodec rewrite interleaving
Ronald S. Bultje
rsbultje
Sat Mar 27 17:17:53 CET 2010
Hi,
the interleaving code right now is plain ugly, this is an attempt to
make it slightly less ugly. But honestly someone should write a DSP
function for this (and that's not me), because other decoders (e.g.
atrac1) do similar silly stuff and I'm sure that can be optimized.
Ronald
-------------- next part --------------
Index: ffmpeg-svn/libavcodec/wmaprodec.c
===================================================================
--- ffmpeg-svn.orig/libavcodec/wmaprodec.c 2010-03-27 10:48:32.000000000 -0400
+++ ffmpeg-svn/libavcodec/wmaprodec.c 2010-03-27 12:06:42.000000000 -0400
@@ -1343,14 +1343,11 @@
/** interleave samples and write them to the output buffer */
for (i = 0; i < s->num_channels; i++) {
- float* ptr;
+ float *ptr = s->samples + i, *iptr = s->channel[i].out,
+ *iend = iptr + s->samples_per_frame;
int incr = s->num_channels;
- float* iptr = s->channel[i].out;
- int x;
- 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;
}
More information about the ffmpeg-devel
mailing list