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.2.0 Development Thread (Read 305546 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

lossyWAV 1.2.0 Development Thread

Reply #650
... I wonder what's the theoretical probability of appearing of such file(s)? ...

It can happen with higher lossyWAV quality levels when music contains only relatively 'simple' tones, that is, music originating from one or few instruments (including voice) only, or when the music is pretty quiet on average.
With music of that kind it may be worth trying whether FLAC alone isn't sufficiently efficient or even more efficient than lossyWAV preprocessed FLAC because of lossyWAV's blocksize restriction. Just in case this situation bothers you. But as efficiency difference in this case usually is small it's not necessary to do so, and bits removed by lossyWAV are next to nothing in this situation (otherwise it would be the lossyWAV version which is more efficient).

BTW with the --portable quality level such a situation happens next to never.
lame3995o -Q1.7 --lowpass 17

lossyWAV 1.2.0 Development Thread

Reply #651
Thanks. I wonder what's the theoretical probability of appearing of such file(s)?

I'd say, as a rule of thumb: if FLAC -8 gives you already close to the bit rate you'd expect of lossyFlac, then don't apply lossyWav at all. Those are the potential cases for size increase.
In theory, there is no difference between theory and practice. In practice there is.

 

lossyWAV 1.2.0 Development Thread

Reply #652
I just tested v1.1.5c -P --altpreset with my usual problem samples Atem-lied, badvilbel, bibilolo, bruhns, dither_noise_test, furious, herding_calls, keys_1644ds, S37_Others_MartenotWaves_A_Essential, triange-2_1644ds, Under The Boardwalk (critical snippet of it), and everything was fine.
lame3995o -Q1.7 --lowpass 17

lossyWAV 1.2.0 Development Thread

Reply #653
Thanks for that.

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.2.0 Development Thread

Reply #654
Sorry for asking a noobish question but how is lossywav different from wavpack hybrid lossy w/o correction file. And is lossywav more sofisticated/higher quality for in between lossy and lossless bitrates?

lossyWAV 1.2.0 Development Thread

Reply #655
lossyWAV pros:

a) lossyWAV is a preprocessor before using an appropriate lossless encoder. This way you have a choice for the final codec, with FLAC, TAK and wavPack lossless as the most prominent ones.
a1) As you can use FLAC you get good hardware support so that you can play your music even on a series of mobile DAPs.
a2) If some day in the future you may want to use another favorite lossless .xxx-codec instead of say FLAC, you can losslessly reencode your .lossy.flac files to .lossy.xxx files.
b) lossyWAV has an explicit error control. It controls the number of least significant bits removed (that is the amount of added noise). The energy of the music is checked in a frequency dependent way, and the number of bits to remove are chosen in such a way that the added noise stays more or less (depending on quality level) below the signal in all of the frequency ranges controlled (which are pretty narrow) up to roughly 16 kHz.
This way for the --portable quality setting (yielding ~ 380 kbps on average) or better we can have a high degree of confidence that the results are transparent.
wavPack lossy/hybrid in contrary doesn't have a real error control. wavPack lossy essentially controls the precision with which the predictor values are encoded and choses this precision according to quality setting. Predictor error and total error are not necessarily close to each other, and audibility of these errors is another story.

wavPack lossy/hybrid pros:

a) wavPack lossy has the better quality when using relatively low quality settings (yielding ~ 300kbps on average or less). A dynamic noise shaping process has its part in this property.
b) wavPack lossy can also have the better quality with higher quality settings. The fact that there is no control of audible error gets less significant the higher the quality setting. At a quality setting yielding ~500 kbps or more on average wavPack lossy can be considered transparent even with problematic samples. With quality settings yielding say between 300 and 500 kbps quality usually is still great especially when above 300 kbps for quite an amount, but there is some uncertainty the higher the lower the bitrate.
lame3995o -Q1.7 --lowpass 17

lossyWAV 1.2.0 Development Thread

Reply #656
Has there been any thought of adding correction file capability to lossy wav? I realize there are no lossless decoders that would directly make use of this file, but perhaps a post-processor to do the correction when you wanted to generate the original wav file?


lossyWAV 1.2.0 Development Thread

Reply #657
The capability to create correction files / merge lossy and correction files has been incorporated in lossyWAV since the initial release.
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.2.0 Development Thread

Reply #658
Thanks for the thorough explanation halb27. So I guess once noise shaping is implemented into lossyWAV it will have all quality benefits plus compatibility with many lossless codecs? Can't wait!

EDIT:I reread your post. Didnt really understand how the explicit error control worked. Do I understand correctly that there will be more noise in loud frequency ranges than soft frequency ranges? For example a section with a solo bass notes will have most noise added in the bass frequencies, and solo cymbals will have most noise added in treble frequencies? Assuming I've understood correctly this seems better in a scenario where eq and other processing would be applied post decode compared to ATH type noise shaping.

lossyWAV 1.2.0 Development Thread

Reply #659
Nick will be able to tell better, but I'm afraid dynamic noise shaping is something that doesn't go too well with lossyWAV.
I guess it would require the implementation of a rather sophisticated psy model (taking account of masking etc. - things like done by mp3 encoders) in order to have noise still under control.
With such a machinery more refined considerations about frequency dependent noise allowed can make lossyWAV more efficient in its own right.

Even with such a more sophisticated machinery we can't expect to get close to the bitrates of high quality mp3 settings (~250 kbps).

I think everybody who likes the lossyWAV way of a very-close-to-lossless procedure can be content with the bitrate of ~380 kbps on average we have with the extremely high quality --portable setting of lossyWAV.

Let's see what the future will bring, but I wouldn't expect too much.
lame3995o -Q1.7 --lowpass 17

lossyWAV 1.2.0 Development Thread

Reply #660
I reread your post. Didnt really understand how the explicit error control worked. Do I understand correctly that there will be more noise in loud frequency ranges than soft frequency ranges? ...

Roughly speaking error control is looking for the frequency range with lowest signal energy and takes care that added noise (by zeroing least significant bits) remains more or less below the signal energy in this range.
It works well with loud complex music (like most of popular music) having high energy in the entire spectrum (as added noise can be pretty high).
The procedure is (necessarily) inefficient for a sine wave, that is just one frequency in the whole spectrum. In this case there are a lot of frequency ranges without signal energy driving lossyWAV to keep added noise as zero or nearly zero, that is no or very few bits can be removed.
With simple tonal music originating from one or few instruments it's similar as probabilty for having a frequency range without signal energy is high.
Apart from energy spectrum of the music the absolute energy is relevant as well. Even when having a full spectrum for low energy music added noise must be low driving lossyWAV to keep all or nearly all of the bits.
Luckily these situations where lossyWAV can remove (nearly) no bits are more or less those situations where the final lossless codec works very efficiently. So in an overall sense the procedure lossyWAV + lossless codec remains more or less in the usual bitrate range.

The added noise comes directly from zeroing least significant bits. Without noise shaping there is no preference for specific frequency ranges of the noise.
With lossyWAV's noise shaping you can shift (part of) the noise to the 13+ kHz range. This has nothing to do with the frequency analysis of the signal. It just adresses the fact that we are less sensitive to noise in the very high frequency range.
With adaptive noise shaping at least in theory noise can be shifted to the frequency areas with high energy so that it is masked.
Apart from implementation difficulties there may be legal issues with this approach (it's not quite clear if such a noise shaping would touch a patent).
lame3995o -Q1.7 --lowpass 17

lossyWAV 1.2.0 Development Thread

Reply #661
lossyWAV 1.2.0 attached to post #1 in this thread.
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)