[PATCH] slightly faster float2int
Hi, please comment and if possible benchmark as well. Not sure if it's worth changing, but this rots in my tree... Greetings, Reimar Döffinger
Hi, Reimar Döffinger wrote:
Hi, please comment and if possible benchmark as well. Not sure if it's worth changing, but this rots in my tree...
Wooh! This patch is OLD! What happened to it? Could you maybe give a sample command-line to test it? I doubt that it's possible to see any difference with -benchmark option, however, it's probably possible to bench with HW timers. BTW, what did you test your patch with, and what speed-up were you getting? Guillaume
On Fri, 18 Aug 2006, Guillaume POIRIER wrote:
Reimar D�ffinger wrote:
Hi, please comment and if possible benchmark as well. Not sure if it's worth changing, but this rots in my tree...
Wooh! This patch is OLD! What happened to it? Could you maybe give a sample command-line to test it? I doubt that it's possible to see any difference with -benchmark option, however, it's probably possible to bench with HW timers.
BTW, what did you test your patch with, and what speed-up were you getting?
lavc now contains an SSE version, which should be more than slightly faster... I can adapt it for the other bps values if needed. --Loren Merritt
On Tue, Apr 11, 2006 at 11:46:32AM +0200, Reimar Döffinger wrote:
Hi, please comment and if possible benchmark as well. Not sure if it's worth changing, but this rots in my tree...
Greetings, Reimar Döffinger
Index: libaf/af_format.c =================================================================== RCS file: /cvsroot/mplayer/main/libaf/af_format.c,v retrieving revision 1.31 diff -u -r1.31 af_format.c --- libaf/af_format.c 13 Nov 2005 18:28:44 -0000 1.31 +++ libaf/af_format.c 11 Apr 2006 09:45:18 -0000 @@ -467,23 +467,31 @@
static void float2int(float* in, void* out, int len, int bps) { - register int i; + register long i = -len; + if (len <= 0) + return; + in = &in[len];
Why not in += len; ??
+ out += bps * len;
This line is not valid C. You cannot perform arithmetic on void pointers. Instead: out = (char *)out + bps*len; Rich
participants (4)
-
Guillaume POIRIER -
Loren Merritt -
Reimar Döffinger -
Rich Felker