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: lossyWAV 1.4.0 Released (Read 78597 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

lossyWAV 1.4.0 Released

lossyWAV 1.4.0 is released.

lossyWAV is a near lossless audio processor which dynamically reduces the bitdepth of the signal on a block-by-block basis. Bitdepth reduction adds noise to the processed output. The added noise is adaptively shaped by default and can alternatively be fixed noise shaped or white noise depending on command line parameters. When lossyWAV processed output is compressed with certain lossless codecs (FLAC, Wavpack, Tak, LPAC, MPEG-4 ALS and WMA-Lossless) the bitrate of the output file is significantly* reduced compared to the lossless original.

Changes from 1.3.0b:
  • Code converted from Delphi to C++; Huge thanks to Tycho for kicking off the transcode;
  • WAVE64 and RF64 compatibility introduced for large audio files;
  • "--feedback" parameter introduced to allow noise introduced by bit-depth reduction to influence number of bits removed;
  • Optional "altfilter" noise-shaping filter creation method added to adaptive noise shaping method;
  • Optional curvilinear interpolation routine available in adaptive noise shaping method in addition to previous linear interpolation.
Download* on average, depending on content.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.4.0 Released

Reply #1
Code: [Select]
lossyWAV 1.4.0, Copyright (C) 2007-2014 Nick Currie. Copyleft.

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program.  If not, see <http://www.gnu.org/licenses/>.

Process Description:

lossyWAV is a near lossless audio processor which dynamically reduces the
bitdepth of the signal on a block-by-block basis. Bitdepth reduction adds noise
to the processed output. The amount of permissible added noise is based on
analysis of the signal levels in the default frequency range 20Hz to 16kHz.

If signals above the upper limiting frequency are at an even lower level, they
can be swamped by the added noise. This is usually inaudible, but the behaviour
can be changed by specifying a different --limit (in the range 10kHz to 20kHz).

For many audio signals there is little content at very high frequencies and
forcing lossyWAV to keep the added noise level lower than the content at these
frequencies can increase the bitrate dramatically for no perceptible benefit.

The noise added by the process is shaped using an adaptive method provided by
Sebastian Gesemann. This method, as implemented in lossyWAV, aims to use the
signal itself as the basis of the filter used for noise shaping. Adaptive noise
shaping is enabled by default.

Usage   : lossyWAV <input wav file> <options>

Example : lossyWAV musicfile.wav

Quality Options:

-q, --quality <t>    where t is one of the following (default = standard):
    I, insane        highest quality output, suitable for transcoding;
    E, extreme       higher quality output, suitable for transcoding;
    H, high          high quality output, suitable for transcoding;
    S, standard      default quality output, considered to be transparent;
    C, economic      intermediate quality output, likely to be transparent;
    P, portable      good quality output for DAP use, may not be transparent;
    X, extraportable lowest quality output, probably not transparent.

Standard Options:

-C, --correction     write correction file for processed WAV file; default=off.
-f, --force          forcibly over-write output file if it exists; default=off.
-h, --help           display help.
-L, --longhelp       display extended help.
-M, --merge          merge existing lossy.wav and lwcdf.wav files.
-o, --outdir <t>     destination directory for the output file(s).
-v, --version        display the lossyWAV version number.
-w, --writetolog     create (or add to) lossyWAV.log in the output directory.

Advanced Options:

-                    take WAV input from STDIN.
-c, --check          check if WAV file has already been processed; default=off.
                     errorlevel=16 if already processed, 0 if not.
-q, --quality <n>    quality preset (-5.0<=n<=10.0); (-5=lowest, 10=highest;
                     default=2.5; I=10.0; E=7.5; H=5.0; S=2.5; C=0.0; P=-2.5;
                     X=-5.0.
--, --stdout         write WAV output to STDOUT.
    --stdinname <t>  pseudo filename to use when input from STDIN.

Advanced Quality Options:

-a, --analyses <n>   set number of FFT analysis lengths, (2<=n<=7; default=3,
                     i.e. 32, 64 & 1024 samples. n = 2, remove 32 sample FFT;
                     n > 3 add 16; n > 4, add 128; n > 5, add 256, n > 6, add
                     512) n.b. FFT lengths stated are for 44.1/48kHz audio,
                     higher sample rates will automatically increase all FFT
                     lengths as required.
    --feedback [n]   enable experimental bit removal / adaptive noise shaping
                     noise limiter. Tuning has been carried out at -q X and
                     should have a negligible effect at -q S. Optional setting
                     (0.0 <= n <= 10.0, default = 0.0) automatically selects
                     the following parameters (0 = least effect, 10 = most):
       r, round <n>  limit deviation from expected added noise due to rounding
                     (-2.0 <= n <= 2.0, default = 0.0).
       n, noise <n>  limit added noise due to adaptive noise shaping
                     (-2.5 <= n <= 2.5, default = 0.0).
       a, aclips <n> number of permissible exceedences of adaptive noise
                     shaping level limit (0 <= n <= 64, default = 32).
       A, alevel <n> adaptive noise shaping level limit (-2.0 <= n <= 2.5,
                     default = 0.0).
       V, verbose    enable more detailed feedback information in output.
-I, --ignore-chunk-sizes.
                     ignore 'RIFF' and 'data' chunk sizes in input.
-l, --limit <n>      set upper frequency limit to be used in analyses to n Hz;
                     (12500 <= n <= 20000; default=16000).
    --linkchannels   revert to original single bits-to-remove value for all
                     channels rather than channel dependent bits-to-remove.
    --maxclips <n>   set max. number of acceptable clips per channel per block;
                     (0 <= n <= 16; default = 3,3,3,3,3,2,2,2,2,2,1,1,1,0,0,0).
-m, --midside        analyse 2 channel audio for mid/side content.
    --nodccorrect    disable DC correction of audio data prior to FFT analysis,
                     default=on; (DC offset calculated per FFT data set).
-n, --noskew         disable application of low frequency level reduction prior
                     to determination of bits-to-remove.
    --scale <n>      factor to scale audio by; (0.03125 < n <= 8.0; default=1).
-s, --shaping        modify settings for noise shaping used in bit-removal:
       a, altfilter  enable alternative adaptive shaping filter method.
       c, cubic      enable cubic interpolation when defining filter shape
       e, extra      additional white noise to add during creation of filter
       f, fixed      disable adaptive noise shaping (use fixed shaping)
       n, nowarp     disable warped noise shaping (use linear frequency shaping)
       o, off        disable noise shaping altogether (use simple rounding)
       s, scale <n>  change effectiveness of noise shaping (0 < n <= 2; default
                     = 1.0)
       t, taps <n>   select number of taps to use in FIR filter (32 <= n <= 256;
                     default = 64)
       w, warp       enable cubic interpolation when creating warped filter
-U, --underlap <n>   enable underlap mode to increase number of FFT analyses
                     performed at each FFT length, (n = 2, 4 or 8, default=2).

Output Options:

    --bitdist        show distrubution of bits to remove.
    --blockdist      show distribution of lowest / highest significant bit of
                     input codec-blocks and bit-removed codec-blocks.
-d, --detail         enable per block per channel bits-to-remove data display.
-F, --freqdist       enable frequency analysis display of input data.
-H, --histogram      show sample value histogram (input, lossy and correction).
    --longdist       show long frequency distribution data (input/lossy/lwcdf).
    --perchannel     show selected distribution data per channel.
-p, --postanalyse    enable frequency analysis display of output and
                     correction data in addition to input data.
    --sampledist     show distribution of lowest / highest significant bit of
                     input samples and bit-removed samples.
    --spread [full]  show detailed [more detailed] results from the spreading/
                     averaging algorithm.
-W, --width <n>      select width of output options (79<=n<=255).

System Options:

-B, --below          set process priority to below normal.
    --low            set process priority to low.
-N, --nowarnings     suppress lossyWAV warnings.
-Q, --quiet          significantly reduce screen output.
-S, --silent         no screen output.

Special thanks go to:

David Robinson       for the publication of his lossyFLAC method, guidance, and
                     the motivation to implement his method as lossyWAV.

Horst Albrecht       for ABX testing, valuable support in tuning the internal
                     presets, constructive criticism and all the feedback.

Sebastian Gesemann   for the adaptive noise shaping method and the amount of
                     help received in implementing it and also for the basis of
                     the fixed noise shaping method.

Tyge Lovset          for the C++ translation initiative.

Matteo Frigo and     for libfftw3-3.dll contained in the FFTW distribution
Steven G Johnson     (v3.2.1 or v3.2.2).

Mark G Beckett       for the Delphi unit that provides an interface to the
(Univ. of Edinburgh) relevant fftw routines in libfftw3-3.dll.

Don Cross            for the Complex-FFT algorithm originally used.
[/size]
Link to the hydrogenaudio wiki article

Suggested foobar2000 converter setup:

lossyFLAC:
Code: [Select]
Encoder: c:\windows\system32\cmd.exe
Extension: lossy.flac
Parameters: /d /c c:\"program files"\bin\lossywav - --quality standard --silent --stdout|c:\"program files"\bin\flac - -b 512 -5 -f -o%d --ignore-chunk-sizes
Format is: lossless or hybrid
Highest BPS mode supported: 24
lossyTAK:
Code: [Select]
Encoder: c:\windows\system32\cmd.exe
Extension: lossy.tak
Parameters: /d /c c:\"program files"\bin\lossywav - --quality standard --silent --stdout|c:\"program files"\bin\takc -e -p2m -fsl512 -ihs - %d
Format is: lossless or hybrid
Highest BPS mode supported: 24
lossyWV:
Code: [Select]
Encoder: c:\windows\system32\cmd.exe
Extension: lossy.wv
Parameters: /d /c c:\"program files"\bin\lossywav - --quality standard --silent --stdout|c:\"program files"\bin\wavpack -hm --blocksize=512 --merge-blocks -i - %d
Format is: lossless or hybrid
Highest BPS mode supported: 24
lossyWMALSL*:
Code: [Select]
Encoder: c:\windows\system32\cmd.exe
Extension: lossy.wma
Parameters: /d /c c:\"program files"\bin\lossywav - --quality standard --silent --stdout|c:\"program files"\bin\wmaencode.exe - %d --codec lsl --ignorelength
Format is: lossless or hybrid
Highest BPS mode supported: 24

Enclose the element of the path containing spaces within double quotation marks ("), e.g. C:\"Program Files"\directory_where_executable_is\executable_name. This is a Windows limitation.

*: Uses the wmaencoder executable written by lvqcl. Found here.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.4.0 Released

Reply #2
Looking good, thanks!


lossyWAV 1.4.0 Released

Reply #4
My error. I have requested that a moderator change it as I do not have access to it at the moment.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.4.0 Released

Reply #5
Amazing stuff Nick, thank you. The shaping is getting very clever.

I think I've spotted what might be a bug. I think that when the size of the "fact" chunk is odd, you pad the chunk to be an even length, but you write the original odd length as the size of the chunk.

Beyond that, there's something in files created with a non-default command line which Cool Edit Pro (yes I still use that!) doesn't like, but I haven't figured out what yet.

Cheers,
David.

lossyWAV 1.4.0 Released

Reply #6
@2Bdecided: This is one of those things that it's not always followed (especially in windows), but blocks are expected to start in even positions. That was more strict in the older IFF format (The old motorola 68000 couldn't seek to odd positions, or something like that) and, i think, in AIFF.

Edit: Just to be clear... The chunk size was specified as the real size (so the extra byte would not be read as data), but the position to seek/skip was always expected to be even, and so there's the skip(1).

lossyWAV 1.4.0 Released

Reply #7
Ah yes, you're right. I remembered the padding to align words, but had forgotten that it's not counted.

I'll try and figure out why CEP doesn't like it then. Not that it really matters, it's just strange.

Cheers,
David.

lossyWAV 1.4.0 Released

Reply #8
The suggestions for fb2k setup need updating, because using those examples on an WinXP SP3 system gave me nothing but problems until I went (using TAK setup as an example) from this...

/d /c C:\"Program Files"\Encoders\LossyWAV\lossywav - --quality extreme --silent --stdout|C:\"Program Files"\Encoders\TAK\Applications\takc -e -p2m -fsl512 -ihs -v -md5 - %d


...to this.


/d /c C:\LossyWAV\lossywav - --quality extreme --silent --stdout|C:\LossyWAV\takc -e -p2m -fsl512 -ihs -v -md5 - %d


I also, with LossyWAV 1.4.0 installation, found that I had to put all the encoders I wanted into the folder itself for anything to work at all, unlike before.

Ah, upgrading! Love that process! 
ghostman

lossyWAV 1.4.0 Released

Reply #9
It should not have made any difference - although during development of 1.4.0 at least one user had issues getting the command line to work - from memory it was a Windows issue.

Glad that you found a remedy.

If the encoders are placed in a directory that is contained in the "PATH" variable, they should be picked up without any need to specify their path.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.4.0 Released

Reply #10
I also had problems with the command line but under Wine/Linux. First I had
Code: [Select]
C:\"Program Files"\lossywav\lossywav and C:\"Program Files"\flac\flac
but I had to move the files and instead use
Code: [Select]
C:\lossywav\lossywav and C:\lossywav\flac
to get it to work.

I tried altfilter last night and the bitrate went down a couple of kbps but I am interested in if this is noise shaping in alpha stage or do you consider it too maybe replace the default one in the future?

lossyWAV 1.4.0 Released

Reply #11
If you put the .exe files in ~/.wine/drive_c/windows/ then you don't have to specify the full path.

lossyWAV 1.4.0 Released

Reply #12
If you put the .exe files in ~/.wine/drive_c/windows/ then you don't have to specify the full path.
Thank you for the suggestion, Skamp. I 'll keep it in mind next time I have any issues.

lossyWAV 1.4.0 Released

Reply #13
I tried altfilter last night and the bitrate went down a couple of kbps but I am interested in if this is noise shaping in alpha stage or do you consider it too maybe replace the default one in the future?


It is optional as it has not received much (if any) independent listening - I have left it up to users to determine whether they want to use it. If it is well received then it may indeed end up as the default shaping filter creation method.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.4.0 Released

Reply #14
I am listening to a couple of samples I have encoded with altfilter and I have problems finding noise issues. I remember I could hear it using earlier versions about a year or two ago but now I hear no issues what so ever so far. Do you know of samples that extraportable usually has problem with? I also remember that classical pieces could end up having increased bitrate compared to lossless but now it does not seem to happen as far I have tested it. I am really impressed. I am strongly thinking about using LossyWAV instead of a lossy codec I use now.

 

lossyWAV 1.4.0 Released

Reply #15
I believe that halb27 used "eig" and "furious" samples for testing purposes.

My 55 sample test set comprises:

Code: [Select]
01 - Ginnungagap - The Black Hole.flac
04 - Black Sabbath - Iron Man.flac
06_florida_seq.flac
10 - Dungeon - The Birth- The Trauma Begins.flac
14_Track03beginning.flac
16_Track03entreaty.flac
18_Track04cakewithtea.flac
34_Gabriela_Robin___Cats_on_Mars.flac
41_30sec.flac
A02_metamorphose.flac
A03_emese.flac
Angelic.flac
annoyingloudsong.flac
aps_Killer_sample.flac
Atem_lied.flac
ATrain.flac
Bachpsichord.flac
badvilbel.flac
bibilolo.flac
BigYellow.flac
birds.flac
bruhns.flac
cricket__insect___edit_.flac
dither_noise_test.flac
E50_PERIOD_ORCHESTRAL_E_trombone_strings.flac
eig.flac
Furious.flac
glass_short.flac
harp40_1.flac
herding_calls.flac
jump_long.flac
keys_1644ds.flac
ladidada_10s.flac
Liebe_so_gut_es_ging.flac
Moon_short.flac
Poets_of_the_fall___Shallow.flac
rach_original.flac
rawhide.flac
Rush___Hold_Your_Fire___Turn_the_Page.flac
S13_KEYBOARD_Harpsichord_C.flac
S30_OTHERS_Accordion_A.flac
S34_OTHERS_GlassHarmonica_A.flac
S35_OTHERS_Maracas_A.flac
S53_WIND_Saxophone_A.flac
SeriousTrouble.flac
swarm_of_wasps__edit_.flac
thewayitis.flac
the_product.flac
triangle.flac
triangle_2_1644ds.flac
trumpet.flac
udial.flac
utb.flac
VELVET.flac
wait.flac
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.4.0 Released

Reply #16
Do you know of samples that extraportable usually has problem with?

I think halb27 said he heard something with extraportable and herding_calls, iirc. Can't find his post.

lossyWAV 1.4.0 Released

Reply #17
Thank you Nick.C and Hex144. I will try to find some of these samples to try out which setting that suits me. Regards.

lossyWAV 1.4.0 Released

Reply #18
Do you know of samples that extraportable usually has problem with?

I think halb27 said he heard something with extraportable and herding_calls, iirc. Can't find his post.

I'm on holidays ATM, will look it up when I'll be back home.  But I also think it was herding_calls which gave audible deviations from the original for all quality levels below standard.
lame3995o -Q1.7 --lowpass 17

lossyWAV 1.4.0 Released

Reply #19
FWIW, I've uploaded the sources to github: https://github.com/rtollert/lossywav

Nick, feel free to set up an acct on github, and we can figure out how to transfer the repo over to you.

Somewhere in my copious free time I want to get this building on Linux.

EDIT: O, I see there's already a Sourceforge project with SVN, but it dates back to 2008. Hmm.

lossyWAV 1.4.0 Released

Reply #20
Thanks, Axon.

The Sourceforge project was created quite some time ago as you correctly point out.

I have no preference (or experience, really) of online source management so am happy to have the latest code wherever it is easier to manage.

Nick.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

lossyWAV 1.4.0 Released

Reply #21
Do you know of samples that extraportable usually has problem with?

I think halb27 said he heard something with extraportable and herding_calls, iirc. Can't find his post.

I'm on holidays ATM, will look it up when I'll be back home.  But I also think it was herding_calls which gave audible deviations from the original for all quality levels below standard.

I'm back home, and I've looked it up.
It was herding_calls which brought an audible deviation from the original for the extraportable and portable quality. With the economic quality it's still audible but it's not a real issue - quality is very close to being perfect.
lame3995o -Q1.7 --lowpass 17

lossyWAV 1.4.0 Released

Reply #22
Quote
I'm back home, and I've looked it up.
It was herding_calls which brought an audible deviation from the original for the extraportable and portable quality. With the economic quality it's still audible but it's not a real issue - quality is very close to being perfect.
I am also extremely impressed too with LossyWAV. I use ogg vorbis with a lot of extra parameters to satisfy my ears but LossyWAV results in lower bitrates  than my ogg encodings and I hear no difference between them. I tried to find that sample you talked about but couldn't find it. Do you maybe have it and are willing to upload it, please? Regards.

lossyWAV 1.4.0 Released

Reply #23
herding_calls for download.
lame3995o -Q1.7 --lowpass 17