Help - Search - Members - Calendar
Full Version: speed optimizations for WavPack 4.4x
Hydrogenaudio Forums > Lossless Audio Compression > WavPack
he-jo
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.
kurtnoise
Not bad, not bad... smile.gif Thank you very much.

IPB Image
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)
he-jo
QUOTE(kurtnoise @ Nov 13 2006, 12:01) *

Compiler: gcc 4.1.1 + CFLAGS (-march=k8 -O3 -pipe -fomit-frame-pointer)


This doesn't enable the MMX optimizations. You should build with
CODE
make CFLAGS='-pipe -march=k8 -mmmx -O3 -fomit-frame-pointer -DOPT_MMX'


Sorry, I forgot to mention that again.
kurtnoise
ok, I stand corrected. Previous post updated. I thought it was automatic...
he-jo
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 unsure.gif - 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?
kurtnoise
QUOTE(he-jo @ Nov 13 2006, 16:46) *

It's a pity that you removed the old chart, because it showed the effect of the modified update_weight macros.

The old one...

IPB Image

QUOTE(he-jo @ Nov 13 2006, 16:46) *
How did you measure the encoding time?

by using values from the wavpack encoder...
iGold
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
        |       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
he-jo
QUOTE(kurtnoise) *
by using values from the wavpack encoder...
Ok wink.gif
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
timer wavpack -hx3 music.wav
time wavpack -hx3 music.wav
he-jo
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.