WavPack

Not to be confused with WAV.

WavPack file format

Filename extension| `.wv (for both lossless and hybrid files), .wvc (correction file for hybrid files only)`
Internet media type| `audio/x-wavpack (.wv), audio/x-wavpack-correction (.wvc)`
Magic number| wvpk
Type of format| Lossless audio
Contained by| Matroska (not required)
Open format?| Yes
WavPack software

Screenshot of `wvunpack` showing information of a .wv file

Developer(s)| David Bryant
Operating system| Cross-platform
Type| Audio codec Container
License| BSD license
Website| wavpack.com

WavPack is a free and open-source lossless audio compression format and application implementing the format. It is unique in the way that it supports hybrid audio compression alongside normal compression which is similar to how FLAC works. It also supports compressing a wide variety of lossless formats, including various variants of PCM and also DSD as used in SACDs, together with its support for surround audio.

## Contents

* 1 Features
* 1.1 Hybrid mode
* 1.2 Summary
* 2 History
* 3 Support
* 3.1 Software
* 3.2 Hardware
* 4 Technology
* 5 See also
* 6 References
* 7 External links

## Features

WavPack compression can compress (and losslessly restore) 8, 16, 24, and 32-bit fixed-point, and 32-bit floating-point PCM audio files in the .WAV file format. It can also handle DSD input in DSDIFF or DSF format.[1] It also supports surround sound streams and high sampling rates. Like other lossless compression schemes, the data reduction rate 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.[2]

### Hybrid mode

WavPack also incorporates a "hybrid" mode, which still provides the features of lossless compression, but creates two files: a relatively small, high-quality, lossy file (.wv) that can be used by itself; and a "correction" file (.wvc) that, when combined with the lossy file, provides full lossless restoration. This allows the use of lossy and lossless codecs together. The lossy algorithm is similar to ADPCM.[3]

Hybrid mode can handle floating-point data, but only when "exception" values like infinities or NaNs are not present. It cannot handle DSD because there is no lossy algorithm for DSD.[1]

A similar "hybrid" feature is also offered by OptimFROG DualStream, MPEG-4 SLS and DTS-HD Master Audio.

### Summary

* Open-source, released under a BSD-like license
* Multiplatform
* Error robustness
* Fast encoding
* Higher compression ratios than other widely used (FLAC/ALAC) open-source lossless audio codecs
* Streaming support
* Supports multichannel audio and high resolutions
* Native support in WavPack 5.x for compressing Direct Stream Digital without converting the source file to PCM.
* Hybrid/lossy mode
* Hardware support (provided by Rockbox firmware)
* Metadata support (ID3, APE tags; APE tag is the preferred format)
* Supports RIFF chunks
* Compatible with ReplayGain
* Ability to create self-extracting files for the Win32 platform
* Supports 32-bit floating-point streams
* Supports embedded CUE sheets
* Includes MD5 hashes for quick integrity checking
* Can encode in both symmetrical and asymmetrical (slower encoding to speed up decoding) modes

## History

David Bryant started development on WavPack in mid-1998 with the release of version 1.0 (1998-08-15). This first version compressed and decompressed audio losslessly, and it already featured one of the best efficiency vs. speed ratios among lossless encoders.[4]

Very soon after the release of version 1.0, v. 2.0 (2 September 1998) was released, featuring lossy encoding (using only quantization of prediction residue for data reduction - no psychoacoustic masking model was applied to the stream).

In 1999, version 3.0 (12 September 1999) was released, with a new "fast mode" (albeit with reduced compression ratio), compression of raw (headerless) PCM audio files, and error detection using a 32-bit cyclic redundancy check.

A feature added in late 3.x versions is the "hybrid" mode where the encoder generates a lossy file and a correction file such that both can be decompressed back to a PCM stream that has same quality as the original.[5]

In WavPack 4, a new file format structure is introduced. A "roadmap" is also published by the author with 4.40, containing possible hints on future development.[6] WavPack 5 introduced support for compressing DSD.

## Support

### Software

Some software supports the format natively (like DeaDBeeF, foobar2000,[7] and Jack! The Knife), while others require plugins. The official WavPack website offers plugins for Winamp, Nero Burning ROM, MediaChest 2.1, and several other applications, as well as a DirectShow filter.[8] dBpoweramp CD-Ripper,[9] by the author of foobar2000, as well as foobar2000[10] itself, and Asunder allow ripping Audio CDs directly into Wavpack files.

Linux support is available with a native port.

FFmpeg has a native WavPack encoder, which may be combined with software like GNU parallel to use multiple CPU cores to quickly transcode other lossless formats into WavPack, and from WavPack to any format that FFmpeg supports, without the need for additional software. However, FFMpeg's encoder is somewhat limited.

As of 2023, FFmpeg's WavPack encoder has some considerable limitations. It can only produce version 4 bitstreams, which do not support fast verification for file integrity checks, or more than 16 channels. It will also discard RIFF chunks and may not behave predictably with 24-bit input. It also defaults to less than optimal compression to achieve faster encoding. Due to lack of support for Hybrid mode, FFmpeg-based playback software will fail to consider the .wvc correction file if there is one present, and will play or transcode only the lossy section. (However, this is not the usual mode of operation for WavPack.) As native Wavpack support for Direct Stream Digital was added in version 5 of the reference encoder, FFmpeg WavPack also is limited to encoding PCM input.[11]

### Hardware

Native support:

Non-native support:

* Apple iPod range of music players do not support WavPack out of the box, but can through open-source Rockbox firmware.
* iRiver H100 series, through open-source Rockbox firmware.
* iRiver H300 series, through open-source Rockbox firmware.[12]
* Android smartphones and tablets with the installation of third-party media-player software.
* ChromeOS devices using media-player software installed in the Linux subsystem or the Android Play Store.

The WavPack website also includes a plugin that allows support for the format on the Roku PhotoBridge HD .[8]

## Technology

To ensure high-speed operation, WavPack uses a predictor that is implemented entirely in integer math.[13] 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 the example above 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.

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.

Instead of Rice coding, a special data encoder for WavPack is used. Rice coding is the optimal bit coding for this type of data, and WavPack's encoder is less efficient, but only by about 0.15 bits per sample (or less than 1% for 16-bit data). However, there are some advantages in exchange. The first one is that WavPack's encoder 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 is better in some applications where coding delay is critical. The second advantage is that it is easily adaptable to lossy encoding, since 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 per 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 both the current and the next sample are considered in choosing the better of the two available codes (which reduces noise another 1 dB).

No floating-point arithmetic is used in WavPack's data path because, according to the author, 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 an example). 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.[14] A 32-bit error detection code to the generated streams is included to maintain user confidence in the integrity of WavPack's compression.

WavPack source code is portable and has been compiled on several Unix and Unix-like operating systems (Linux, Mac OS X, Solaris, FreeBSD, OpenBSD, NetBSD, Compaq Tru64, HP-UX...) as well as Windows, DOS, Palm OS, and OpenVMS. It works on many architectures, including x86, ARM, PowerPC, AMD64, IA-64, SPARC, Alpha, PA-RISC, MIPS and Motorola 68k.

A cut-down version of WavPack was developed for the Texas Instruments TMS320 series Digital Signal Processor. This was aimed predominantly at encouraging manufacturers to incorporate WavPack compression (and de-compression) into portable memory audio recorders. This version supported features that were applicable only to embedded applications (stream compression in real-time, selectable compression rate) and dropped off features that only applied to full computer systems (self extraction, high compression modes, 32-bit floats). The TMS320 series DSPs are native integer devices, and support WavPack well. Some "special" features of the full WavPack software were included (ability to generate a correction "file" (stream), for example), and others were excluded. The port was based on version 4\.

WavPack support was added to WinZip starting with version 11.0 beta, released in October 2006.[15] This extension to the ZIP file format was included by PKWARE, the maintainers of the format, in the official APPNOTE.TXT description file starting with version 6.3.2, released on 28 September 2007.[16]

## See also

* Comparison of audio formats
* MPEG-4 SLS
* FLAC
* TTA
* Monkey's Audio
* ALAC
* Meridian Lossless Packing

## References

1. ↑ 1.0 1.1 "WavPack User Documentation". https://www.wavpack.com/wavpack_doc.html.
2. ↑ Heijden, Hans (11 July 2006). "Compression and speed of lossless audio formats". http://web.inter.nl.net/users/hvdh/lossless/lossless.htm.
3. ↑ Bryant, David. "7.11 WavPack". in Solomon, David. Data Compression: The Complete Reference. p. 773. https://www.wavpack.com/WavPack.pdf.
4. ↑ Speek (7 February 2005). "Performance comparison of lossless audio compressors". http://members.home.nl/w.speek/comparison.htm.
5. ↑ "WavPack Audio Compression". https://www.wavpack.com/#About.
6. ↑ "WavPack 4.40 released". http://www.hydrogenaud.io/forums/index.php?s=&showtopic=50911&view=findpost&p=456571.
7. ↑ "foobar2000". http://foobar2000.org/.
8. ↑ 8.0 8.1 "WavPack downloads". https://www.wavpack.com/downloads.html.
9. ↑ "dBpoweramp Codec Central". https://www.dbpoweramp.com/codec-central.htm.
10. ↑ "foobar2000: Free Encoder Pack". http://www.foobar2000.org/encoderpack.
11. ↑ "WavPack - Hydrogenaudio Knowledgebase". https://wiki.hydrogenaud.io/index.php?title=WavPack#FFmpeg.27s_WavPack_implementation:_differences_and_quirks.
12. ↑ "SoundCodecs < Main < Wiki". https://www.rockbox.org/wiki/SoundCodecs.
13. ↑ Bryant, David (21 March 2007). "Forum comment by developer". http://www.hydrogenaud.io/forums/index.php?showtopic=52576&st=50&p=479913&hl=integer&#entry479913.
14. ↑ Goldberg, David (March 1991). "What Every Computer Scientist Should Know About Floating-Point Arithmetic". ACM Computing Surveys 23 (1): 5–48. doi:10.1145/103162.103163. http://perso.ens-lyon.fr/jean-michel.muller/goldberg.pdf. Retrieved 2016-01-20. ([1] , [2] ).
15. ↑ "WinZip – Additional Compression Methods Specification". WinZip International LLC. 15 November 2006. http://www.winzip.com/comp_info.htm.
16. ↑ "APPNOTE.TXT – .ZIP File Format Specification". PKWARE Inc. 28 September 2007. http://www.pkware.com/documents/casestudies/APPNOTE.TXT.

## External links

* Official website
* WavPack forum at Hydrogenaudio Forums
* Historical versions at ReallyRareWares
* A comparison of several Lossless Audio encoders at Hydrogenaudio Wiki.
* WavPack on MultimediaWiki
* WavPack frontend
* Flash WavPack player

* v
* t
* e

Multimedia compression and container formats

Video
compression|

| ISO, IEC, MPEG|

* MJPEG
* Motion JPEG 2000
* MPEG-1
* MPEG-2
* Part 2
* MPEG-4
* Part 2 / ASP
* Part 10 / AVC
* MPEG-H
* Part 2 / HEVC
* MPEG-I
* Part 3 / VVC

|

ITU-T, VCEG|

* H.120
* DCT
* H.261
* H.262
* H.263
* H.264 / AVC
* H.265 / HEVC
* H.266 / VVC
* DV

SMPTE|

* VC-1
* VC-2
* VC-3
* VC-5

TrueMotion|

* TrueMotion S
* DCT
* VP3
* VP6
* VP7
* VP8
* VP9
* AV1

Others|

* Apple Video
* AVS
* Bink
* Cinepak
* Daala
* DVI
* EVC
* FFV1
* Huffyuv
* Indeo
* Lagarith
* Microsoft Video 1
* MSU Lossless
* OMS Video
* Pixlet
* ProRes 422
* ProRes 4444
* QuickTime
* Animation
* Graphics
* RealVideo
* RTVideo
* SheerVideo
* Smacker
* Sorenson Video/Spark
* Theora
* Thor
* WMV
* XEB
* YULS

Audio
compression|

| ISO, IEC, MPEG|

* MPEG-1 Layer II
* Multichannel
* MPEG-1 Layer I
* MPEG-1 Layer III (MP3)
* AAC
* HE-AAC
* AAC-LD
* MPEG Surround
* MPEG-4 ALS
* MPEG-4 SLS
* MPEG-4 DST
* MPEG-4 HVXC
* MPEG-4 CELP
* MPEG-D USAC
* MPEG-H 3D Audio

|

ITU-T|

* G.711
* A-law
* µ-law
* G.718
* G.719
* G.722
* G.722.1
* G.722.2
* G.723
* G.723.1
* G.726
* G.728
* G.729
* G.729.1

IETF|

* Opus
* iLBC
* Speex
* Vorbis

3GPP|

* AMR
* AMR-WB
* AMR-WB+
* EVRC
* EVRC-B
* EVS
* GSM-HR
* GSM-FR
* GSM-EFR

ETSI|

* AC-3
* AC-4
* DTS

Others|

* ACELP
* ALAC
* Asao
* ATRAC
* AVS
* CELT
* Codec 2
* DRA
* FLAC
* iSAC
* Monkey's Audio
* TTA
* True Audio
* MT9
* Musepack
* OptimFROG
* OSQ
* QCELP
* RCELP
* RealAudio
* RTAudio
* SD2
* SHN
* SILK
* Siren
* SMV
* SVOPC
* TwinVQ
* VMR-WB
* VSELP
* WavPack
* WMA
* MQA
* aptX
* aptX HD
* aptX Low Latency
* aptX Adaptive
* LDAC
* LHDC
* LLAC

Image
compression|

| IEC, ISO,
IETF, W3C,
ITU-T, JPEG|

* CCITT Group 4
* DCT
* HEIF
* HEVC
* JPEG
* JPEG XR
* JPEG XT
* TIFF/EP
* Arithmetic
* JBIG
* JBIG2
* JPEG-LS
* JPEG 2000
* LZ
* GIF
* PNG
* TIFF
* TIFF/IT

|

Others|

* APNG
* BPG
* DjVu
* EXR
* FLIF
* ICER
* MNG
* PGF
* QTVR
* WBMP
* WebP

Containers|

| ISO, IEC|

* MPEG-ES
* MPEG-PES
* MPEG-PS
* MPEG-TS
* ISO base media file format
* MPEG-4 Part 14 (MP4)
* Motion JPEG 2000
* MPEG-21 Part 9
* MPEG media transport

|

ITU-T|

* H.222.0
* T.802

IETF|

* RTP
* Ogg

SMPTE|

* GXF
* MXF

Others|

* 3GP and 3G2
* AMV
* ASF
* AIFF
* AVI
* AU
* BPG
* Bink
* Smacker
* BMP
* DivX Media Format
* EVO
* Flash Video
* IFF
* M2TS
* Matroska
* WebM
* QuickTime File Format
* RatDVD
* RealMedia
* RIFF
* WAV
* MOD and TOD
* VOB, IFO and BUP

Collaborations|

* NETVC
* MPEG LA
* HEVC Advance

Methods|

* Discrete cosine transform
* DCT
* MDCT
* Entropy
* Arithmetic
* Huffman
* Modified
* FFT
* LPC
* ACELP
* CELP
* LSP
* WLPC
* Lossless
* Lossy
* LZ
* DEFLATE
* LZW
* PCM
* A-law
* µ-law
* ADPCM
* DPCM
* Transform
* Wavelet
* Daubechies
* DWT
* Transform

Lists|

* Comparison of audio coding formats
* Comparison of video codecs
* List of codecs

See Compression methods for techniques and Compression software for codecs

* v
* t
* e

Data compression software

Archivers with
compression
(comparison)|

| Free software|

* 7-Zip
* Archive Manager
* Ark
* Expander
* FreeArc
* Info-ZIP
* KGB Archiver
* PAQ
* PeaZip
* tar
* XAD (decompression only)
* Xarchiver
* Zipeg
* ZPAQ

|

Freeware|

* Filzip
* LHA
* StuffIt Expander (decompression only)
* The Unarchiver (decompression only)
* TUGZip
* ZipGenius

Commercial|

* ARC
* ALZip
* Archive Utility
* ARJ
* BetterZip
* JAR
* MacBinary
* PKZIP/SecureZIP
* PowerArchiver
* StuffIt
* WinAce
* WinRAR
* WinZip

Non-archiving
compressors|

| Generic|

* bzip2
* compress
* gzip
* lzip
* lzop
* pack
* rzip
* Snappy
* XZ Utils

|

For code|

UPX

Audio
compression
(comparison)|

| Lossy|

* Fraunhofer FDK AAC
* Nero AAC Codec
* Freeware Advanced Audio Coder (FAAC)
* Helix DNA Producer
* l3enc
* LAME
* TooLAME
* libavcodec
* libcelt
* libopus
* libspeex
* Musepack
* libvorbis
* Windows Media Encoder

|

Lossless|

* ALAC
* FLAC
* libavcodec
* Monkey's Audio
* mp4als
* OptimFROG
* Shorten
* TTA (True Audio)
* WavPack

Video
compression
(comparison)|

| Lossy|

| MPEG-4 ASP|

* 3ivx
* DivX
* Nero Digital
* FFmpeg
* HDX4
* Xvid

|

H.264 /
MPEG-4 AVC|

* CoreAVC
* Blu-code
* DivX
* FFmpeg
* Nero Digital
* OpenH264
* QuickTime
* x264

HEVC|

* DivX
* x265

Others|

* CineForm
* Cinepak
* Daala
* DNxHD
* Helix DNA Producer
* Indeo
* libavcodec
* Schrödinger (Dirac)
* SBC
* Sorenson
* VP7
* libtheora
* libvpx
* Windows Media Encoder

Lossless|

* FFV1
* Huffyuv
* Lagarith
* MSU Lossless
* YULS

* See also: compression methods and compression formats

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/WavPack. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:WavPack&oldid=3988871"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template