Re: [PATCH] smallft.c
Segher Boessenkool <[email protected]> Wed, 9 Jan 2013 23:17:04 +0100
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Michael, > I have a small diff for Vorbis > which replaces some loops with memcpy. > This allows us to take advantage of > memcpy's optimisations when copying > the floating point data. > > Does this look OK? > - for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik]; > + memcpy(c2, ch2, idl1 * sizeof(float)); Most compilers can do this for you, e.g. GCC does this transformation at -O3. It usually does not help, and it can hurt. The original code is clearer and much less error-prone, in my opinion. For future patches, please keep the same coding style; the lack of whitespace is hard to read, but a mix of styles is even worse. Segher