Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: speed optimizations for WavPack 4.4x (Read 6229 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

speed optimizations for WavPack 4.4x

Yesterday I experimented a little bit with the upcoming WavPack 4.40 (svn revision 33) and my MMX patch for the extra modes. Running a few speed tests in the new high mode (switch -hx3) on a Pentium III Coppermine with Linux and GCC 4.1.1 showed, that the encoding time decreases by about 18%. So maybe some testers here will find that useful.

If you're interested in x86 binaries for GNU/Linux or Mac OS X, you can download the archive 'wp-4.40s33-bin.tar.bz2' from http://base91.sourceforge.net/download/wavpack/ - there you also find the patch 'wp-4.40s33-jh_mmx.diff.gz'. This patch is nothing really new; beside small adjustments to the new version, it also contains some modifications to the update_weight macros, which can lead to a very minor speedup in all modes.

Next target for me is to write something similar with Altivec on PowerPC, but please don't expect that too soon. Unfortunately, I do not have very much spare time recently. *sigh*

Kind regards,
Jo.

speed optimizations for WavPack 4.4x

Reply #1
Not bad, not bad...  Thank you very much.


OS: WinXP SP2 AMD 64 3200+ / 2 Go RAM
Sample : wav - 44100 Hz - 2 ch - 0:48:26.45
Compiler: gcc 4.1.1 + CFLAGS (-march=k8 -O3 -mmmx -pipe -fomit-frame-pointer -DOPT_MMX)
Values: encoding time (in seconds)


speed optimizations for WavPack 4.4x

Reply #3
ok, I stand corrected. Previous post updated. I thought it was automatic...

speed optimizations for WavPack 4.4x

Reply #4
It's a pity that you removed the old chart, because it showed the effect of the modified update_weight macros. I'm sorry, but your new test results appear to be a little bit strange  - my patch should not affect the normal mode that much, but should have a higher impact on the extra modes. How did you measure the encoding time?


speed optimizations for WavPack 4.4x

Reply #6
My measures on Athlon XP 2200+ under Ubuntu 6.10 Linux.
Wavpack 4.40.0 r37 compiled by GCC 4.1.1.
First column is patched version w/o -DOPT_MMX, second - with.
Code: [Select]
        |       Time, sec
  Mode  |-----------------------
        |   NO_MMX  |     MMX
--------+-----------+-----------
-f      |    4.01   |    3.75
-f -x   |    7.73   |    7.24
-f -x1  |    7.56   |    7.19
-f -x2  |   10.73   |   10.00
-f -x3  |   18.38   |   16.86
default |    6.07   |    4.77
-x      |   10.58   |    9.29
-x1     |   10.42   |    9.27
-x2     |   16.44   |   14.34
-x3     |   31.93   |   27.02
-h      |    6.85   |    6.73
-h -x   |   15.20   |   13.02
-h -x1  |   15.02   |   13.02
-h -x2  |   25.38   |   21.30
-h -x3  |   51.47   |   42.51
-hh     |    9.29   |    8.73
-hh -x  |   20.51   |   16.99
-hh -x1 |   20.42   |   17.07
-hh -x2 |   36.19   |   29.39
-hh -x3 |   76.38   |   60.92

speed optimizations for WavPack 4.4x

Reply #7
by using values from the wavpack encoder...
Ok 
But according to my experience, these values are not very exact and vary quite a lot between several runs. With Windows it would probably be the best to use the commandline tool timer, with Unix the command 'time' - like
Code: [Select]
timer wavpack -hx3 music.wav
time wavpack -hx3 music.wav

 

speed optimizations for WavPack 4.4x

Reply #8
Some Altivec modifications for the extra stereo modes are available now. I was just able to test on a G5. Unfortunately they don't give a real speed up there, when encoding 16 bit files. But I measured a speedup of ~16% when encoding 24 bit and 32 bit tracks. I would really appreciate it, if someone would run some tests on a G4.

Get the patch in wp-4.40beta-jh_altivec.diff.gz and binaries for Mac OS X in wp-4.40beta-ppc.tar.bz2 from http://base91.sourceforge.net/download/wavpack/.

Many thanks in advance,
Jo.