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

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #125
Using this kind of compression on higher-than-necessary sampling rates (like 96k) makes little sense to me.
Pretty sure it will be more efficient to downsample to something closer to (2 * max audible frequency) before any lossy compression.
Otherwise the result has to waste space on stuff that can't be heard, while adding some distortion to the useful frequency range, and providing no way to discard the unneeded info without more distortion to the useful range.
a fan of AutoEq + Meier Crossfeed

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #126
Lossy audio at high sample rates actually has its place, unlike the case of active noise cancelling headphones where the distortion performance of the amplifier is more important than the high-resolution encoding.

Quite a few mastering, the Hi-Res version retains more dynamic range than the CD/WEB version (especially in Japan), and this is why directly lossy compressing the Hi-Res version makes more sense than compressing CD/WEB 16/44.1.

If a minimum phase 44.1K resampler is used for the 96K version, the sample point at the -0.1dB level may be grossly out of peak, causing clipping in 16Bit int. It's not as lossless when it has to be limited after resampling.

Another reason is that LossyFLAC 96KHz is also acceptable at around 570Kbps bitrate in some setting, and there is no significant bitrate increase over LossyFLAC 44.1KHz at around 480Kbps (-q 2.0 to 5.0).

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #127
I tested the theoretical performance of LossyWAV 1.4.3b (44.1KHz & 96KHz) with different noise shaping modes with parameter: -q -5/-2/0/2/4/5/6/7/8/9/10.

For 44.1KHz,  common parameters: -a 4 -l 15848 --maxclips 2.



For 96KHz,  common parameters: -a 3 -l 16000 --maxclips 2.



And different noise shaping behaves differently at the two sample rates, with 88.2K/96K having more room for noise shaping, and 44.1K/48K not so much.
But my initial feeling is that Weighted 2 sounds great even in -q 0 (44.1KHz).
I will try to audition various music genres using studio speakers, wired headphones, mobile bluetooth amplifier + wired in-ear headphones (LDAC/aptx HD codec).
The performance of the lossy encoding after lossy Bluetooth transmission is also a part to be examined now.
Some noise shaping may have excellent SNR, but after the distortion of the playback system, it may become worse.

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #128
Lossy audio at high sample rates actually has its place, unlike the case of active noise cancelling headphones where the distortion performance of the amplifier is more important than the high-resolution encoding.
Amplifier is almost always more important.

Quite a few mastering, the Hi-Res version retains more dynamic range than the CD/WEB version (especially in Japan), and this is why directly lossy compressing the Hi-Res version makes more sense than compressing CD/WEB 16/44.1.
Is it so high as to make 16/44.1 unsuitable?

If a minimum phase 44.1K resampler is used for the 96K version, the sample point at the -0.1dB level may be grossly out of peak, causing clipping in 16Bit int. It's not as lossless when it has to be limited after resampling.
1. The gold standard is linear phase.
2. It doesn't have to be limited, just apply negative gain so that the total peak is under 0 dB FS.

Another reason is that LossyFLAC 96KHz is also acceptable at around 570Kbps bitrate in some setting, and there is no significant bitrate increase over LossyFLAC 44.1KHz at around 480Kbps (-q 2.0 to 5.0).
18% additional bitrate bloat looks pretty significant.
a fan of AutoEq + Meier Crossfeed

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #129
Is it so high as to make 16/44.1 unsuitable?
Not really, 24Bit 96KHz down-conversion to 16Bit 44.1KHz with dither is still a useful mainstream approach.
For my personal workflow, I generally end up with 48KHz/44.1KHz for the final mastering output, even if the project is 96KHz.
I just think 96KHz lossy is an interesting experimental direction to go in.

1. The gold standard is linear phase.
2. It doesn't have to be limited, just apply negative gain so that the total peak is under 0 dB FS.
Yes, linear phase is the gold standard. But the actual use is more flexible. When downsampling, I choose minimum phase, linear phase or adjust their ratios to get a good match according the type of music.
For personal use, I certainly apply negative gain after downsampling. But for commercial needs, negative gain is sometimes unappealing and some workers want the peak sample point to be around 0dB.

18% additional bitrate bloat looks pretty significant.
According to LossyWAV 1.4.2's hybrid mode, I would say that 96KHz would require 15%-25% more bitrate than 44.1KHz to achieve a good approximation, which is coincidentally a bit close to the A-weighted SNR measurements.

But in a detailed LossyWAV 1.4.3b comparison, A-weighted SNR of LossyFLAC at 96KHz and 44.1KHz at the same bitrate behaved similarly in some of the newer noise shaping modes.

Arbitrarily, the sampling rate did not significantly affect the coding efficiency? I don't think conclusions likes it can be drawn easily.
I'm skeptical of pure SNR evaluations, and I'd like to hear what all the noise-shaping modes actually sound like at different bitrates before I jump to conclusions.

Meanwhile, LossyWAV 1.4.3b's new noise shaping mode has some auditory enhancement & SNR improvement in lossy compression at 300 to 500Kbps in 44.1K, and it even feels like it surpasses the wavpack lossy & Opus.
I'm interested in it.

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #130
My preliminary evaluation:

1. --shaping weighted is efficient, with slightly difference in listening to --shaping hybrid for the same or slightly lower parameters (e.g. -q 5 -s W 1 & -q 6 -s h).

2. The difference between shaping weighted 0/1/2/3 is small, but -s W 1/3 had fewer aliasing for the mouth-ess sound on a quiet background than -s W 0/2, which is slightly noticeable on lossy compressed Bluetooth channels and low performance DACs/amps.
I personal prefered -s W 1 for its lower bitrate, but sometimes -s W 3 sounds great by its lower noise level in noticeable frequency range.

3. Blue or violet noise shaping (-s f 0.5 / 1.0) works well in 88.2K/96K for high quality parameters (-q 6 to 10).
Violet noise shaping makes it sound like wavpack lossy 96K, but inappropriately increases the amount of audible high-frequency energy in low quality preset and increases the cost of bitrate.
And for 44.1K and 48K audio, violet noise shaping wasted too much bitrate and fall into bad listening when comparing other shape at the same low bitrate.
White noise (-s f 0) is another -s o (disable noise shaping) with minimum difference but cost more process time.

4. The high frequency noise level of fixed shaping (-s f) can be changed by the -f scale 0<n<=2, but the frequency is fixed?
I try to mark a 96K file as a 88.2K file to process (96K playback). The noticeable high frequency noise became slightly less at similar low playback bitrate.

5. I tested the same music files about LossyFLAC 96K -q 5 (totally 656Kbps) and LossyFLAC 48K -q 10 (totally 642Kbps).
Although the 96K error files were louder. In playback systems with normal high-frequency response, they come close.
But 44.1K/48K can still lower the bitrate, and bring less risk of system IMD in some Bluetooth in-ear headphones. It's true that resampled 44.1K LossyFLAC is the safer option. Low bitrate lossy 96K remains an experimental option.

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #131
4. The high frequency noise level of fixed shaping (-s f) can be changed by the -f scale 0<n<=2, but the frequency is fixed?
I try to mark a 96K file as a 88.2K file to process (96K playback). The noticeable high frequency noise became slightly less at similar low playback bitrate.
The shape of the gain curve used in fixed noise shaping is as below, with the scale parameter changing the amplitude (using a power relationship, i.e. scale 0.5 = root; scale 2.0 = square).
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)

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #132
4. The high frequency noise level of fixed shaping (-s f) can be changed by the -f scale 0<n<=2, but the frequency is fixed?
I try to mark a 96K file as a 88.2K file to process (96K playback). The noticeable high frequency noise became slightly less at similar low playback bitrate.
The shape of the gain curve used in fixed noise shaping is as below, with the scale parameter changing the amplitude (using a power relationship, i.e. scale 0.5 = root; scale 2.0 = square).


Oh, it seems to be fine.
The level creep from 4KHz to 10KHz doesn't actually sound bad, but above 10KHz it can sometimes sound a bit noticeable.

However, the high frequency noise spectrum of my test weighted and hybrid modes doesn't quite match that of the fixed mode, so isn't the fixed noise used in the fixed mode a subset of them?

Fixed Mode Scale 1.0:


Weighted Mode 3:


I also recently tested for sample peak interference.
I think keeping the audio file with sample peaks around -0.5dB provides enough room for LossyWAV to operate. It looks like keeping the peaks at -0dB is also not very suitable to utilize the full performance of LossyWAV, a mistake I made earlier.

Here is Alexey Lukin's article on Noise Shaping Dithering: Comparison of Word Length Reduction Systems for Digital Audio

Regarding fixed noise shaping, I think it's possible to make the high frequency noise a bit similar to ExtraBit.
ExtraBit is still interesting to listen to at 8Bit, and behaves somewhat transparently at loud volumes, with 44.1K getting FLAC 8Bit 380Kbps and 96K getting FLAC 8Bit 717Kbps.
Here's what it roughly looks like with noise shaping, with the 44.1/48K and 88.2/96K using inconsistent models.

For 44.1/48KHz:



For 88.2/96KHz:


Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #133
However, the high frequency noise spectrum of my test weighted and hybrid modes doesn't quite match that of the fixed mode, so isn't the fixed noise used in the fixed mode a subset of them?
Weighted and hybrid shaping are both adaptive shaping methods, i.e. they shape the noise to the shape of the signal, with a bit of added noise at the top end of the frequency range.

The "widening" of the spikes in the Weighted Mode 3 image is (at least in part) due to linear interpolation between FFT results for, if the default 3 analyses were used, the 32 sample & 64 sample FFT lengths when defining the shape of the adaptive noise shaping curve for that codec block for each channel.
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)

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #134
Err…

Code: [Select]
$ lossyWAV.exe ...
lossyWAV beta 1.4.3b, Copyright (C) 2007-2023 Nick Currie. Copyleft.
lossyWAV beta version has reached expiry date (30th September 2023).
Please contact Nick.C for a new version.

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #135
Err…

Code: [Select]
$ lossyWAV.exe ...
lossyWAV beta 1.4.3b, Copyright (C) 2007-2023 Nick Currie. Copyleft.
lossyWAV beta version has reached expiry date (30th September 2023).
Please contact Nick.C for a new version.
Hi,

As there was no interaction in the six weeks between my last post and the expiry of the beta version, and has been none in the over four months since, it didn't seem that there was any interest in the changes in the beta version.

The last release version, version 1.4.2, is still there to download.
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)

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #136
@Nick.C, what kind of feedback do you expect to receive to roll out version 1.4.3 final? Noise-shaping performance, right? I am, however, interested in the fixed bugs that you described as minor.

Well, to give this topic a boost, let me tell you about the last scenario where I tried to use LossyFLAC.

There is a music album consisting of ~20 gothic rock compositions. The preview generation feature of Foobar2000 helped me to create a demo (number of tracks × 15 seconds). Next, I planned to merge the cuts into a file with the embedded cuesheet or chapters. I tried various lossy encoders and settled on Qaac with -V109 setting, which is slightly above the default -V91. What did I achieve with your solution? lossywav -q H -s h -A | flac -5 produced a file twice as big (7.5 vs 15 MB). I still have the source material, and I'm ready to try again if you can advise me on more appropriate settings to reduce the size.


Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #138
@Nick.C, what kind of feedback do you expect to receive to roll out version 1.4.3 final? Noise-shaping performance, right? I am, however, interested in the fixed bugs that you described as minor.
Some feedback relating to how useful, or not, the additions were considered to be. Fair point about the minor bug fixes - I should put out a 1.4.2b with those at the very least.
There is a music album consisting of ~20 gothic rock compositions. The preview generation feature of Foobar2000 helped me to create a demo (number of tracks × 15 seconds). Next, I planned to merge the cuts into a file with the embedded cuesheet or chapters. I tried various lossy encoders and settled on Qaac with -V109 setting, which is slightly above the default -V91. What did I achieve with your solution? lossywav -q H -s h -A | flac -5 produced a file twice as big (7.5 vs 15 MB). I still have the source material, and I'm ready to try again if you can advise me on more appropriate settings to reduce the size.
Using "-q H" there's not really a way to reduce the size - a lower quality setting would need to be selected, as detailed in the link shadowking posted.
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)

 

Re: lossyWAV 1.4.2 Development (was 1.5.0)

Reply #139
I am glad to see LossyWAV still being developed. I have used it a lot and still use it every now and then.