Difference between revisions of "WavPack"

From Hydrogenaudio Knowledgebase
Jump to: navigation, search
(Add Category: Codec)
(Added file extention and magic number)
 
(45 intermediate revisions by 20 users not shown)
Line 1: Line 1:
'''WavPack''' is a free, open source [[lossless]] audio compression format developed by David Bryant.
+
{{Software Infobox
 +
| name = WavPack
 +
| logo = [[Image:Wavpacklogo.png|280px|Official WavPack logo]]
 +
| screenshot =
 +
| caption = Hybrid Lossless Audio Compression
 +
| maintainer = David Bryant
 +
| stable_release = 5.1.0 (20-01-2017)
 +
| preview_release = None
 +
| operating_system = Windows, Mac OS/X, Linux/BSD/Unix
 +
| use = Encoder/Decoder
 +
| license = BSD license
 +
| website = http://www.wavpack.com/
 +
}}
  
 +
'''WavPack''' is a royalty-free, open source and [[lossless]] or high-quality lossy audio compression format developed by David Bryant.
  
==Description==
+
== Description ==
 
+
WavPack (pronounced "wave-pack") allows users to compress (and restore) all [[PCM]] audio formats including 8, 16, 24 and 32-bit ints; 32-bit floats; DSD audio; [[mono]], [[stereo]], and [[multichannel]]; [[sampling rate]]s from 6 to 192 kHz. Like other lossless compression schemes the data reduction varies with the source, but it is generally between 30 % and 70 % for typical popular music and somewhat better than that for classical music and other sources with greater dynamic range.
WavPack (pronounced "wave-pack") allows users to compress (and restore) all [[PCM]] audio formats including 8, 16, and 24-bit ints; 32-bit floats; [[mono]], [[stereo]], and [[multichannel]]; [[sampling rate]]s from 6 to 192 kHz. Like other lossless compression schemes the data reduction varies with the source, but it is generally between 25% and 50% for typical popular music and somewhat better than that for classical music and other sources with greater dynamic range.
+
  
 
WavPack also incorporates a unique "hybrid" mode that provides all the advantages of lossless compression with an additional bonus. Instead of creating a single file, this mode creates both a relatively small, high-quality lossy file that can be used all by itself, and a "correction" file that (when combined with the lossy file) provides full lossless restoration. For some users this means never having to choose between lossless and lossy compression!
 
WavPack also incorporates a unique "hybrid" mode that provides all the advantages of lossless compression with an additional bonus. Instead of creating a single file, this mode creates both a relatively small, high-quality lossy file that can be used all by itself, and a "correction" file that (when combined with the lossy file) provides full lossless restoration. For some users this means never having to choose between lossless and lossy compression!
  
==Feature Summary==
+
* Default file extentsion: <code>.wv</code>
 +
* Magic number: <code>wvpk</code> (4 bytes)
  
 +
== Feature Summary ==
 
* Fast and efficient encoding and decoding
 
* Fast and efficient encoding and decoding
 
* [[Open source]], released under a BSDish license
 
* [[Open source]], released under a BSDish license
 +
* Audio files > 4GB
 
* Multiplatform
 
* Multiplatform
 
* Hardware support
 
* Hardware support
Line 17: Line 32:
 
* Streaming support
 
* Streaming support
 
* Supports multichannel audio and high resolutions
 
* Supports multichannel audio and high resolutions
 +
* DSD compression
 
* Hybrid/lossy mode
 
* Hybrid/lossy mode
* Tagging support ([[ID3v1]], [[APE]])
+
* Tagging support ([[ID3v1]], [[APE tags]])
 
* Supports [[RIFF]] chunks
 
* Supports [[RIFF]] chunks
 
* Supports embedded CUE sheets
 
* Supports embedded CUE sheets
Line 25: Line 41:
 
* [[ReplayGain]] compatible
 
* [[ReplayGain]] compatible
  
 +
== History ==
 +
David Bryant started development on WavPack in mid-1998, with the release of version 1.0. This first version compressed and decompressed audio losslessly, nothing else, but by then it already featured one of the best efficiency versus speed ratio among lossless encoders.
  
==History==
+
Very soon after the release of version 1.0, Bryant released v. 2.0, which featured lossy encoding (using only quantization for data reduction no psychoacoustic process was applied to the stream).
 
+
David Bryant started development on WavPack in mid-1998, with the release of version 1.0. This first version compressed and decompressed audio losslessly, nothing else, but by then it already featured one of the best efficiency vs. speed ratio among lossless encoders.
+
 
+
Very soon after the release of version 1.0, Bryant released v. 2.0, which featured lossy encoding (using only quantization for data reduction - no psychoacoustic process was applied to the stream).
+
  
 
In 1999, the developer released version 3.0, which featured novelties such as a fast mode (with reduced compression ratio), compression of RAW files and error detection using CRC checksums.
 
In 1999, the developer released version 3.0, which featured novelties such as a fast mode (with reduced compression ratio), compression of RAW files and error detection using CRC checksums.
Line 36: Line 50:
 
WavPack development is still going on, and a major feature added in late 3.x versions is the hybrid mode, where the encoder generates a lossy file + a correction file, so that both can be decompressed back to the original PCM stream.
 
WavPack development is still going on, and a major feature added in late 3.x versions is the hybrid mode, where the encoder generates a lossy file + a correction file, so that both can be decompressed back to the original PCM stream.
  
WavPack 4 has been recently released. It included important changes, such as fast seeking, multichannel support, high resolution audio support, etc. turning it into one of the most full featured and modern lossless audio compressors.
+
WavPack 4 has been released in 2004. It included important changes, such as fast seeking, multichannel support, high resolution audio support, etc. turning it into one of the most full featured and modern lossless audio compressors.
  
 +
WavPack 5 finally released on 6th December, 2016.
 +
Now it accepts audio files bigger than 4 GB and can compress the Direct-Stream Digital (DSD) audio recording format.
 +
Including handling with many new file formats like Sony Wave64 or Philips DSDIFF makes WavPack to an "universal audio archiving solution".
  
==Software support==
+
== Software support ==
 
+
=== Players ===
===Players===
+
* NullSoft [[Winamp]] (plugin with ReplayGain & Media Library support) and Winamp-compatible players
* NullSoft [[Winamp]] (plugin w/ ReplayGain & Media Library support) and Winamp-compatible players
+
* [[foobar2000]] Advanced Audio Player (official encoding/decoding addon, with ReplayGain & Cuesheets support)
* [[foobar2000]] Advanced Audio Player (official encoding/decoding addon, w/ ReplayGain & Cuesheets support)
+
* [http://www.vuplayer.com/vuplayer.php VUPlayer] (official plugin, supports encoding)
* [http://www.vuplayer.com/vuplayer.htm VUPlayer] (official plugin, supports encoding)
+
* [[Windows Media Player]] and other directshow-based players (MPC, TCMP, RadLight) (with [http://www.hydrogenaudio.org/forums/index.php?showtopic=103693 CoreWavPack] directshow filter)
* [[Windows Media Player]] and other directshow-based players (MPC, TCMP, RadLight) (with [http://corewavpack.corecodec.org/ CoreWavPack] directshow filter)
+
* [http://koti.welho.com/hylinen/apollo/ Apollo] Audio Player (plugin w/ ReplayGain  support)
+
* [http://www.un4seen.com/xmplay.html XMplay] (official plugin)
+
 
* [http://cogosx.sourceforge.net/ Cog] Audio player for MacOS X.
 
* [http://cogosx.sourceforge.net/ Cog] Audio player for MacOS X.
 
* [[XMMS]] (with Kuniklo's plugin)
 
* [[XMMS]] (with Kuniklo's plugin)
 
* [http://fondriest.frederic.free.fr/realisations/lamip/ LAMIP] (official plugin)
 
* [http://fondriest.frederic.free.fr/realisations/lamip/ LAMIP] (official plugin)
* [http://mpxplay.net/ MPXplay] for DOS!
+
* [http://mpxplay.sourceforge.net/ MPXplay] for DOS!
 +
* [http://aqualung.sourceforge.net/ Aqualung] for GNU/Linux
 +
* [http://www.videolan.org/vlc/download-windows.html VLC Player]
 +
* Cowon [http://www.jetaudio.com/ JetAudio Player]
 +
* Konvertor [http://www.logipole.com/index.html Konvertor]
 +
*[http://www.un4seen.com/ XMPlay] Plugin required (WavPack input plugin) and (bass library) to play 'wv' files
  
 +
=== Frontends ===
 +
* Custom Windows [http://www.wavpack.com/WavPack_frontend.zip WavPack frontend] (by Speekenbrink)
  
===Frontends===
+
=== Converters ===
* Custom [http://members.home.nl/w.speek/wavpack.htm Windows Frontend] (by Speek)
+
'''Note:''' ''Several players, like Cowon JetAudio, foobar2000 and VUplayer, can also convert from other formats to WavPack!''
* [http://www.unifront.boereck.de/ UniversalFront] by Böreck
+
* [http://home.vxu.se/mdati00/frontah/ Frontah] by Madah
+
* [http://www.webearce.com.ar/ MAREO] by Kwambis
+
  
===Converters===
 
'''Note:''' ''Several players, like foobar2000 and VUplayer, can also convert from other formats to WavPack)''
 
 
* [http://www.dbpoweramp.com/ dBpowerAMP] Music Converter / Audio Player / CD Writer (official addon)
 
* [http://www.dbpoweramp.com/ dBpowerAMP] Music Converter / Audio Player / CD Writer (official addon)
* [http://www.board-24.de/ GX:Transcoder] Music converter
+
* [http://www.easeaudioconverter.com/wavpack.htm Ease Audio Converter] (Shareware / NOT Freeware)
 +
* [http://media.io/ Online Audio Converter]
 +
* Konvertor [http://www.logipole.com/index.html Konvertor]
  
 +
=== Editors ===
 +
* [[Adobe Audition]] and Cool Edit (filter with 32-bit floats & extra info save support)
  
===Editors===
+
=== CD writers/rippers ===
* [[Adobe Audition]] and Cool Edit (filter w/ 32-bit floats & extra info save support)
+
* [http://www.nero.com/eng/ Nero]
 
+
 
+
===CD writers/rippers===
+
* [http://www.ahead.de Ahead Nero Burning Rom]
+
* [http://www.burrrn.net Burrrn] Audio CD burner
+
 
* [[Exact Audio Copy]] CD Ripper
 
* [[Exact Audio Copy]] CD Ripper
 
* [http://cdexos.sourceforge.net CDex] CD ripper
 
* [http://cdexos.sourceforge.net CDex] CD ripper
 +
* Cowon [http://www.jetaudio.com/ JetAudio Player]
  
 
+
=== Taggers ===
===Taggers===
+
 
* [http://www.mp3tag.de/en/index.html Mp3tag] Universal Tag Editor
 
* [http://www.mp3tag.de/en/index.html Mp3tag] Universal Tag Editor
* [http://users.otenet.gr/~jtcliper/tgf/ The GodFather] Tagger / Music manager
+
* [http://www.jtclipper.eu/thegodfather/ The GodFather] Tagger / Music manager
 
* [[Tag.exe|Case's Tag]] command line tagger
 
* [[Tag.exe|Case's Tag]] command line tagger
  
 +
=== Other tools ===
 +
* [http://mr-questionman.en.uptodown.com/windows Mr. QuestionMan]
 +
* [http://www.bunkus.org/videotools/mkvtoolnix/ mkvtoolnix] – tool to multiplex WavPack streams inside the Matroska container
 +
''It's worth mentioning the [[Matroska]] guys decided to concentrate on WavPack as the lossless compressor of choice for their container. Quite an honor... :-)''
  
===Other tools===
+
->[http://www.wavpack.com/#Software WavPack Software Section]
* [http://www.burrrn.net/mrq/ Mr. QuestionMan]
+
* [http://www.bitattack.ro/ai/ Audio Identifier]
+
* [http://www.bunkus.org/videotools/mkvtoolnix/ mkvtoolnix] - tool to multiplex WavPack streams inside the Matroska container
+
  It's worth mentioning the [[Matroska]] guys decided to concentrate on WavPack as the
+
  lossless compressor of choice for their container. Quite an honor... :-)
+
 
+
 
+
==Hardware Support==
+
  
 +
== Hardware Support ==
 
* iRiver iHP-120/iHP-140 with the open source [http://www.rockbox.org Rockbox firmware]
 
* iRiver iHP-120/iHP-140 with the open source [http://www.rockbox.org Rockbox firmware]
* [http://www.rokulabs.com/products/photobridge/features.php Roku PhotoBridge HD] (w/ [http://www.wavpack.com/downloads.html plugin])
+
* Roku PhotoBridge HD (with [http://www.wavpack.com/downloads.html#binaries plugin])
 +
->[http://www.wavpack.com/index.html#Hardware WavPack Hardware Section]
  
==Technology description==
+
== Technology description ==
 +
To ensure high-speed operation, WavPack uses a very simple predictor that is implemented entirely in integer math. In its "fast" mode the prediction is simply the arithmetic extrapolation of the previous two samples. For example, if the previous two samples were -10 and 20, then the prediction would be 50. For the default mode a simple adaptive factor is added to weigh the influence of the earlier sample on the prediction. In our example the resulting prediction could then vary between 20 for no influence to 50 for full influence. This weight factor is constantly updated based on the audio data's changing spectral characteristics, which is why it is called "adaptive".
  
To ensure high-speed operation, WavPack uses a very simple predictor that is implemented entirely in integer math. In its "fast" mode the prediction is simply the arithmetic extrapolation of the previous two samples. For example, if the previous two samples were -10 and 20, then the prediction would be 50. For the default mode a simple adaptive factor is added to weigh the influence of the earlier sample on the prediction. In our example the resulting prediction could then vary between 20 for no influence to 50 for full influence. This weight factor is constantly updated based on the audio data's changing spectral characteristics, which is why it is called "adaptive".  
+
The prediction generated is then subtracted from the actual sample to be encoded to generate the error value. In mono mode this value is sent directly to the coder. However, stereo signals tend to have some correlation between the two channels that can be further exploited. Therefore, two error values are calculated that represent the difference and average of the left and right error values. In the "fast" mode of operation these two new values are simply sent to the coder instead of the left and right values. In the default mode, the difference value is always sent to the coder along with one of the other three values (average, left, or right). An adaptive algorithm continuously determines the most efficient of the three to send based on the changing balance of the channels.
  
The prediction generated is then subtracted from the actual sample to be encoded to generate the error value. In mono mode this value is sent directly to the coder. However, stereo signals tend to have some correlation between the two channels that can be further exploited. Therefore, two error values are calculated that represent the difference and average of the left and right error values.  In the "fast" mode of operation these two new values are simply sent to the coder instead of the left and right values. In the default mode, the difference value is always sent to the coder along with one of the other three values (average, left, or right). An adaptive algorithm continuously determines the most efficient of the three to send based on the changing balance of the channels.
+
The developer has developed a unique data encoder for WavPack that he believes is better than Rice coding in two different areas. It is impossible to encode more efficiently than Rice coding because it represents the optimal bit coding (sometimes known as the Huffman code) for this type of data. WavPack's encoder is slightly less efficient than this, but only by about 0.15 bits/sample (or less than 1% for 16-bit data). The first advantage of WavPack's coder is that it does not require the data to be buffered ahead of encoding, instead it converts each sample directly to bitcodes. This is more computationally efficient and it is better in some applications where coding delay is critical. The second advantage is that it is easily adaptable to lossy encoding because all significant bits (except the implied "one" MSB) are transmitted directly. In this way it is possible to only transmit, for example, the 3 most significant bits (with sign) of each sample. In fact, it is possible to transmit only the sign and implied MSB for each sample with an average of only 3.65 bits/sample.
 
+
The developer has developed a unique data encoder for WavPack that he believes is better than Rice coding in two different areas. It is impossible to encode more efficiently than Rice coding because it represents the optimal bit coding (sometimes known as the Huffman code) for this type of data. WavPack's encoder is slightly less efficient than this, but only by about 0.15 bits/sample (or less than 1% for 16-bit data). The first advantage of WavPack's coder is that it does not require the data to be buffered ahead of encoding, instead it converts each sample directly to bitcodes. This is more computationally efficient and it is better in some applications where coding delay is critical. The second advantage is that it is easily adaptable to lossy encoding because all significant bits (except the implied "one" MSB) are transmitted directly. In this way it is possible to only transmit, for example, the 3 most significant bits (with sign) of each sample. In fact, it is possible to transmit only the sign and implied MSB for each sample with an average of only 3.65 bits/sample.  
+
  
 
This coding scheme is used to implement the "lossy" mode of WavPack. In the "fast" mode the output of the non-adaptive decorrelator is simply rounded to the nearest codable value for the specified number of bits. In the default mode the adaptive decorrelator is used (which reduces the average noise about 1 dB) and also both the current and the next sample are considered in choosing the better of the two available codes (which reduces noise another 1 dB).
 
This coding scheme is used to implement the "lossy" mode of WavPack. In the "fast" mode the output of the non-adaptive decorrelator is simply rounded to the nearest codable value for the specified number of bits. In the default mode the adaptive decorrelator is used (which reduces the average noise about 1 dB) and also both the current and the next sample are considered in choosing the better of the two available codes (which reduces noise another 1 dB).
  
 
The developer has decided to not use any floating-point arithmetic in WavPack's data path because he believes that integer operations are less susceptible to subtle chip to chip variations that could corrupt the lossless nature of the compression, the Pentium floating point bug being a blatant example of this. It is possible that a lossless compressor that used floating-point math could generate different output when running on that faulty Pentium. Even disregarding actual bugs, floating-point math is complicated enough that there could be subtle differences between "correct" implementations that could cause trouble for this type of application. To further ensure confidence in the integrity of WavPack's compression, the encoder includes a 32-bit error detection code to the generated streams.
 
The developer has decided to not use any floating-point arithmetic in WavPack's data path because he believes that integer operations are less susceptible to subtle chip to chip variations that could corrupt the lossless nature of the compression, the Pentium floating point bug being a blatant example of this. It is possible that a lossless compressor that used floating-point math could generate different output when running on that faulty Pentium. Even disregarding actual bugs, floating-point math is complicated enough that there could be subtle differences between "correct" implementations that could cause trouble for this type of application. To further ensure confidence in the integrity of WavPack's compression, the encoder includes a 32-bit error detection code to the generated streams.
 
  
 
WavPack source code is very portable. It has been compiled on several Unices (Linux, Mac OS X, Solaris, FreeBSD, OpenBSD, NetBSD, Compaq Tru64, HP-UX...) as well as Windows, DOS and OpenVMS. It works on architectures such as x86, ARM, PowerPC, SPARC, DEC Alpha, PA-RISC, MIPS, Motorola 68k...
 
WavPack source code is very portable. It has been compiled on several Unices (Linux, Mac OS X, Solaris, FreeBSD, OpenBSD, NetBSD, Compaq Tru64, HP-UX...) as well as Windows, DOS and OpenVMS. It works on architectures such as x86, ARM, PowerPC, SPARC, DEC Alpha, PA-RISC, MIPS, Motorola 68k...
  
==Further reading==
+
== External links ==
 
+
 
* [http://www.wavpack.com/ Official website]
 
* [http://www.wavpack.com/ Official website]
 
* [http://www.rarewares.org/lossless.html Unofficial multiplatform versions] at RareWares
 
* [http://www.rarewares.org/lossless.html Unofficial multiplatform versions] at RareWares
* [http://www.rjamorim.com/rrw/wavpack.html Historical versions] at ReallyRareWares
+
* [[Lossless_comparison|Lossless Codec Comparison]]
* [[Lossless_comparison|Lossless Codec Comparison]] by Rjamorim
+
* [[EAC_and_WavPack | Configuring EAC and WavPack]]
* [[EAC_and_WavPack | Configuring EAC and Wavpack]]
+
  
[[Category: Codec]]
+
[[Category:Codecs]]
 +
[[Category:Lossless]]

Latest revision as of 02:31, 23 September 2017

WavPack
Official WavPack logo

Hybrid Lossless Audio Compression
Developer(s) David Bryant
Release information
Initial release Unknown
Stable release 5.1.0 (20-01-2017)
Preview release None
Compatibility
Operating system Windows, Mac OS/X, Linux/BSD/Unix
Additional information
Use Encoder/Decoder
License BSD license
Website http://www.wavpack.com/

WavPack is a royalty-free, open source and lossless or high-quality lossy audio compression format developed by David Bryant.

Description[edit]

WavPack (pronounced "wave-pack") allows users to compress (and restore) all PCM audio formats including 8, 16, 24 and 32-bit ints; 32-bit floats; DSD audio; mono, stereo, and multichannel; sampling rates from 6 to 192 kHz. Like other lossless compression schemes the data reduction varies with the source, but it is generally between 30 % and 70 % for typical popular music and somewhat better than that for classical music and other sources with greater dynamic range.

WavPack also incorporates a unique "hybrid" mode that provides all the advantages of lossless compression with an additional bonus. Instead of creating a single file, this mode creates both a relatively small, high-quality lossy file that can be used all by itself, and a "correction" file that (when combined with the lossy file) provides full lossless restoration. For some users this means never having to choose between lossless and lossy compression!

  • Default file extentsion: .wv
  • Magic number: wvpk (4 bytes)

Feature Summary[edit]

  • Fast and efficient encoding and decoding
  • Open source, released under a BSDish license
  • Audio files > 4GB
  • Multiplatform
  • Hardware support
  • Error robustness
  • Streaming support
  • Supports multichannel audio and high resolutions
  • DSD compression
  • Hybrid/lossy mode
  • Tagging support (ID3v1, APE tags)
  • Supports RIFF chunks
  • Supports embedded CUE sheets
  • Includes MD5 hashes for quick integrity checking
  • Ability to create self extracting files for Win32 platform
  • ReplayGain compatible

History[edit]

David Bryant started development on WavPack in mid-1998, with the release of version 1.0. This first version compressed and decompressed audio losslessly, nothing else, but by then it already featured one of the best efficiency versus speed ratio among lossless encoders.

Very soon after the release of version 1.0, Bryant released v. 2.0, which featured lossy encoding (using only quantization for data reduction – no psychoacoustic process was applied to the stream).

In 1999, the developer released version 3.0, which featured novelties such as a fast mode (with reduced compression ratio), compression of RAW files and error detection using CRC checksums.

WavPack development is still going on, and a major feature added in late 3.x versions is the hybrid mode, where the encoder generates a lossy file + a correction file, so that both can be decompressed back to the original PCM stream.

WavPack 4 has been released in 2004. It included important changes, such as fast seeking, multichannel support, high resolution audio support, etc. turning it into one of the most full featured and modern lossless audio compressors.

WavPack 5 finally released on 6th December, 2016. Now it accepts audio files bigger than 4 GB and can compress the Direct-Stream Digital (DSD) audio recording format. Including handling with many new file formats like Sony Wave64 or Philips DSDIFF makes WavPack to an "universal audio archiving solution".

Software support[edit]

Players[edit]

  • NullSoft Winamp (plugin with ReplayGain & Media Library support) and Winamp-compatible players
  • foobar2000 Advanced Audio Player (official encoding/decoding addon, with ReplayGain & Cuesheets support)
  • VUPlayer (official plugin, supports encoding)
  • Windows Media Player and other directshow-based players (MPC, TCMP, RadLight) (with CoreWavPack directshow filter)
  • Cog Audio player for MacOS X.
  • XMMS (with Kuniklo's plugin)
  • LAMIP (official plugin)
  • MPXplay for DOS!
  • Aqualung for GNU/Linux
  • VLC Player
  • Cowon JetAudio Player
  • Konvertor Konvertor
  • XMPlay Plugin required (WavPack input plugin) and (bass library) to play 'wv' files

Frontends[edit]

Converters[edit]

Note: Several players, like Cowon JetAudio, foobar2000 and VUplayer, can also convert from other formats to WavPack!

Editors[edit]

  • Adobe Audition and Cool Edit (filter with 32-bit floats & extra info save support)

CD writers/rippers[edit]

Taggers[edit]

Other tools[edit]

It's worth mentioning the Matroska guys decided to concentrate on WavPack as the lossless compressor of choice for their container. Quite an honor... :-)

->WavPack Software Section

Hardware Support[edit]

->WavPack Hardware Section

Technology description[edit]

To ensure high-speed operation, WavPack uses a very simple predictor that is implemented entirely in integer math. In its "fast" mode the prediction is simply the arithmetic extrapolation of the previous two samples. For example, if the previous two samples were -10 and 20, then the prediction would be 50. For the default mode a simple adaptive factor is added to weigh the influence of the earlier sample on the prediction. In our example the resulting prediction could then vary between 20 for no influence to 50 for full influence. This weight factor is constantly updated based on the audio data's changing spectral characteristics, which is why it is called "adaptive".

The prediction generated is then subtracted from the actual sample to be encoded to generate the error value. In mono mode this value is sent directly to the coder. However, stereo signals tend to have some correlation between the two channels that can be further exploited. Therefore, two error values are calculated that represent the difference and average of the left and right error values. In the "fast" mode of operation these two new values are simply sent to the coder instead of the left and right values. In the default mode, the difference value is always sent to the coder along with one of the other three values (average, left, or right). An adaptive algorithm continuously determines the most efficient of the three to send based on the changing balance of the channels.

The developer has developed a unique data encoder for WavPack that he believes is better than Rice coding in two different areas. It is impossible to encode more efficiently than Rice coding because it represents the optimal bit coding (sometimes known as the Huffman code) for this type of data. WavPack's encoder is slightly less efficient than this, but only by about 0.15 bits/sample (or less than 1% for 16-bit data). The first advantage of WavPack's coder is that it does not require the data to be buffered ahead of encoding, instead it converts each sample directly to bitcodes. This is more computationally efficient and it is better in some applications where coding delay is critical. The second advantage is that it is easily adaptable to lossy encoding because all significant bits (except the implied "one" MSB) are transmitted directly. In this way it is possible to only transmit, for example, the 3 most significant bits (with sign) of each sample. In fact, it is possible to transmit only the sign and implied MSB for each sample with an average of only 3.65 bits/sample.

This coding scheme is used to implement the "lossy" mode of WavPack. In the "fast" mode the output of the non-adaptive decorrelator is simply rounded to the nearest codable value for the specified number of bits. In the default mode the adaptive decorrelator is used (which reduces the average noise about 1 dB) and also both the current and the next sample are considered in choosing the better of the two available codes (which reduces noise another 1 dB).

The developer has decided to not use any floating-point arithmetic in WavPack's data path because he believes that integer operations are less susceptible to subtle chip to chip variations that could corrupt the lossless nature of the compression, the Pentium floating point bug being a blatant example of this. It is possible that a lossless compressor that used floating-point math could generate different output when running on that faulty Pentium. Even disregarding actual bugs, floating-point math is complicated enough that there could be subtle differences between "correct" implementations that could cause trouble for this type of application. To further ensure confidence in the integrity of WavPack's compression, the encoder includes a 32-bit error detection code to the generated streams.

WavPack source code is very portable. It has been compiled on several Unices (Linux, Mac OS X, Solaris, FreeBSD, OpenBSD, NetBSD, Compaq Tru64, HP-UX...) as well as Windows, DOS and OpenVMS. It works on architectures such as x86, ARM, PowerPC, SPARC, DEC Alpha, PA-RISC, MIPS, Motorola 68k...

External links[edit]