lossyWAV

From Wikipedia, the free encyclopedia

lossyWAV
Developed by Nick Currie
Latest release 1.0.0b / May 13, 2008
Preview release 1.0.1q / May 30, 2008
OS Microsoft Windows
Genre Digital signal processing
License GNU GPLv3+
lossyWAV
File name extension .lossy.wav / .lwcdf.wav
Developed by Nick Currie
Type of format Audio

lossyWAV is a free, lossy, audio pre-processor. It is designed to be used on PCM audio contained in the WAV file format in conjunction with certain lossless audio codecs to which it adds a lossy / hybrid variant. It reduces the bit depth of the input signal on a block by block basis by rounding lower significant bits (lsbs) to zero which adds a predetermined level of noise to the output, at or below the pre-existing noise floor. When the processed file is losslessly encoded using one of the aforementioned lossless audio codecs, the resulting bitrate of the encoded file is significantly reduced compared to encoding the unpreprocessed original audio data. The option is available to the user to create a correction file which can be utilised to revert the .lossy.wav file to lossless.

lossyWAV's primary goal is to maintain transparency with a high degree of confidence when processing any audio data.

Contents

[edit] Codec compatibility

Codec Supported Encoder parameters Combination name
Apple Lossless No
FLAC Yes -5 -b 512 --keep-foreign-metadata lossyFLAC
LA No
LPAC Yes -b512 lossyLPAC
Monkey's Audio No
MPEG-4 ALS Yes -l -n512 lossyALS
OptimFROG No
TAK Yes -fsl512 lossyTAK
TTA No
WavPack Yes --blocksize=512 lossyWV
WMA Lossless Yes lossyWMALSL
  • ^  Combinations of lossyWAV with each specific encoder are referred to as lossyX, where X is an abbreviation of the lossless codec name.

[edit] History

lossyFLAC is an idea started by 2Bdecided at Hydrogenaudio, utilising the wasted bits feature of the FLAC lossless codec. Its aim is to transparently reduce audio bit depth by zeroing lsb's by rounding (which adds noise at a pre-determined level, at or below the noise floor of the existing audio), consequently taking advantage of FLAC's detection of consistently zeroed lower significant bits within each single frame. In this way the processed audio, when encoded in FLAC, enjoys significantly increased coding efficiency [1] and the user can enjoy audio encoded using the same codec (which may be all important from a hardware compatibility perspective) at a reduced bitrate compared to the lossless version which should also be indistinguishable from the lossless original.

Nick.C ported the original MATLAB implementation to Delphi with core functions written in IA-32 and x87 Assembly language for speed.

Subsequently, the lossyFLAC method proved itself to work with other lossless codecs, so the application name was changed to lossyWAV.

Since then, Nick has heavily developed and built upon lossyWAV, with valuable tuning performed by halb27 at Hydrogenaudio.

[edit] Indicative bitrate reduction

It must be stressed that lossyWAV is a pure variable bitrate pre-processor, achieved by varying the bit depth used per sample on a block by block basis. Bits-to-remove from the audio data are calculated on a block by block basis (codec-block length = 512 samples, 11.6msec @ 44.1kHz) using overlapping fast Fourier transform (FFT) analyses of at least two lengths (default quality preset (-q 5) = 32, 64 & 1024 samples). After some manipulation, the results of each FFT analysis for a specific codec-block are then grouped and the minimum value used to determine bits-to-remove for the whole codec-block. Bit removal adds noise to the output, however the level of the added noise has been pre-calculated and will be at or below the noise floor of the codec-block in question (subject to quality preset and other user selectable options). Each sample in the codec-block is then rounded such that the first <bits-to-remove> lsbs are zero. In this way the wasted bits feature of FLAC et al. is exploited.[2]

lossyWAV Test Set Version FLAC -8 -q 10 -q 9 -q 8 -q 7 -q 6 -q 5 -q 4 -q 3 -q 2 -q 1 -q 0
53 sample "problem" set 1.0.0b 784 kbit/s 654 kbit/s 626 kbit/s 596 kbit/s 565 kbit/s 534 kbit/s 501 kbit/s 470 kbit/s 447 kbit/s 408 kbit/s 366 kbit/s 329 kbit/s

[edit] File identification

lossyWAV-processed WAV files are named with a double filename extension, .lossy.wav, to make them instantly identifiable. e.g. ".lossy.flac" would indicate an audio file which was processed using lossyWAV, and subsequently encoded using FLAC.[3]

The --correction parameter is used when processing to create a correction file which is named with the .lwcdf.wav double filename extension. When recombined with the corresponding .lossy.wav, using the -merge parameter, the original file will be reconstituted.

lossyWAV inserts a variable-length FACT chunk into the output WAV file immediately after the FMT chunk. This takes the form:

fact/<size>/lossyWAV <version> @ dd/mm/yyyy hh:mm:ss, -q 5

Where the version, date & time and user settings are copied. Additionally, if a lossyWAV FACT chunk is found in the WAV file to be processed, the processing will be halted (exit code = 16) to prevent re-processing of an already processed file.

The --check parameter can be used to determine whether a file has previously been processed without trying to process it, exit code = 16 if already processed; exit code = 0 if not.

[edit] Quality presets

  • -q 10 to -q 8: Highest quality presets, disc space-saving alternative to lossless archiving for large audio collections, considered to be suitable for transcoding to other lossy formats;
  • -q 7 to -q 6: High quality presets for space saving alternative to lossless archiving;
  • -q 5: Default preset, generally accepted to be transparent;
  • -q 4 to -q 0: DAP quality presets of reducing bitrate with reducing preset number, for use on a compatible digital audio player (DAP).

[edit] Supported input formats

  • WAV: 9-bit to 32-bit integer samples; sample rate ≥ 32 kHz; 1 to 8 channel PCM. Very high sample rates (>48kHz) have not been extensively tested. Tunings have been focused on 16-bit, 44.1 kHz samples (i.e. Red Book PCM).

[edit] References

There are no references other than the original method proposal and initial development thread at the hydrogenaudio.org forums (which is not considered by wikipedia to be an adequate reference). This project has been initiated, progressed and completed to the release of lossyWAV 1.0.0b purely through the use of the hydrogenaudio forums by the developers to communicate ideas.

[edit] External links