Skip to main content


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: Wavpack Lossy Quality (Read 40920 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Wavpack Lossy Quality

Reply #75
LOL.. now bryant is dragged to the lossy quality business.. poor guy.. 
Juha Laaksonheimo

Wavpack Lossy Quality

Reply #76
Bryant, the -j1 switch you mention indeed gives much improvement at least on your 'Furious' sample, 'udial', and I suppose all (near) mono samples in general. Would you recommend to just always use it?

Wavpack Lossy Quality

Reply #77
It's a major difference, and the reason why I take him seriously and you not.

You're young, Garf (AFAIK), and so I forgive you... When you get into post-mid-age and be a bit more experienced man, then you will understand a lot more of things you don't understand today. Maybe... 

And the fallacies abide....

It's rather ironic that you mention "thinking" in your earlier post.  The statements you continue to make surely do not seem to be a product of critical thinking.

Wavpack Lossy Quality

Reply #78

I tried to find that sample but could only find one copy and it was compressed with something I couldn't figure out. Could you upload something for me (or point to where I might find it)?

I see what you are talking about, but it seems like it only occurs after the burst, right? This makes sense because there would be some trailing quantization noise there (which could sound like smearing), but there would not be anything before the burst (which is what I thought pre-echo was). I would still like to hear this sample, though.


Actually, Matt and I were in frequent contact during that time and traded ideas often. His lossy version was something that he put together in a couple hours IIRC and was really very simple. His lossless encoder was already dividing the audio into blocks, and so what he did was when he encoded each block he checked the level first and then made a decision as to how many LSBs to strip off all the raw samples before he compressed the whole block losslessly. The bits stripped off would obviously go into the "recovery" file (which I don't think he ever implemented). At around 400 kbps this was often transparent, and because his lossless compressor was so good it was very efficient.

The problem with this is that the quantization noise, while very low, can be jumping up and down 5 times per second in 6 dB steps. As long as it's completely inaudible that's fine, but as soon as it approaches the threshold of audibility you might start hearing those discontinuities and I suspect that they would be pretty obnoxious.

WavPack's lossy mode is implemented much later in the compression process and filters the quantization noise rate of change to prevent any audible jumps. I believe that this allows WavPack's lossy mode to be acceptable at lower bitrates because even when the noise approaches audibility it doesn't make itself too obvious. Matt and I discussed this and he decided that incorporating a similar scheme into Monkey's Audio would involve changing too much (and I think he didn't want to wander into the quagmire of lossy codecs).

There is room for improvement, however. For one thing, the lossy mode is currently strictly CBR. It would be possible to implement some simple psycho-acoustic algorithm to determine the relatve audibility of the quantization noise and adjust the bitrate accordingly (i.e. VBR).

Also, I have thought a little about some intelligent switching for joint stereo. As you point out, true stereo is the default and I did this because I found some samples where joint stereo generated some problems (loud sound in only one channel produces audible noise in the other quiet channel) even though most samples benefit from joint stereo. A simple algorithm could be devised to detect the problem cases and only switch to true stereo then.


To use a common American expression, I will try to avoid letting lossy compression become my Vietnam. 

Wavpack Lossy Quality

Reply #80
Thanks for making me aware of the lossy ape "beta", and the discussion around it a couple of years ago. I was very interested, and as I don't have Monkey's installed, I fired this one up and also checked out bryant's furious sample. I agree that it certainly gets the sample more "correct" than Wavpack. I could still ABX the Monkey's lossy version 10/10, but it was very close, and I was mainly sensing different levels of background noise, rather than artifacts in the "music" itself. I also tried Wavpack lossy at 400 kbit to more closely match bitrates, and it was much better than at 320, but not as close as Monkey's.

Thanks for your comments about wavpack's performance and the sample itself. It was good to check out a sample that does trip it up so that I can be aware of potential shortcomings in Wavpack lossy.

Until now, I've been sticking to true stereo for lossy encodes when I am not keeping the correction file, because I was under the impression that the joint stereo may cause the odd problem. (I use Speek's front end with the high quality option checked, but as far as I know, it is not using the joint stereo switch.) If there was an easy way to make the joint stereo a safe joint stereo, without huge effort on your behalf, it sounds like a good idea. Otherwise, I might start trying some joint stereo encodes and see what happens. I've been very happy with the results so far though as it is. It's just that after checking out your furious sample, I'm starting to wonder about using joint stereo. Can you elaborate more on how risky it is? 

You hit the nail on the head with regards to why I think Wavpack lossy has some potential. The additional noise, or lower S/N is still very reasonable, and I would much prefer a slight increase in background noise if the recording itself is still of "high quality" whatever that means, and less or no artifacts. When it's music you don't know intimately, the odd artifact is no big deal, but when you know the music shouldn't sound like what you are hearing, it get starts to get in the way of enjoying the music. 

The huge benefit to me has been it's transcoding into ATRAC3 performance. Wavpack kills the other perceptual codecs consistently for this, and Delirium's explanation makes sense.

I'm going to check out this other sample of guruboolez out of interest now.


PS: @bryant, Sorry to drag you into the world of lossy, but I can't seeing this being your Vietnam somehow. Even if you don't develop this any further, I suspect you don't have much to worry about 

Wavpack Lossy Quality

Reply #81
Just did a quick and dirty ABX test of wavpack lossy using the short block test 2 sample. Just used the high quality option, and didn't touch the joint stereo switch.

Went staight for Wavpack @ 400 kbits to see what it would be like. First tried to ABX the first third of the sample, hit 8/15. Then tried the middle section, and hit 12/15. Can't exactly describe what I was picking up, as they were very, very close, but the "tone" as it increases in pitch, did not quite sound/feel the same. I suspect that just as with the furious sample, wavpack lossy adds some extra high frequency artifacts, or something, and I was sensing this during the test. It was very hard to pick up though. 

I'd be interested to hear what you think about this bryant, as to whether it is a pre-echo/smearing effect as guruboolez suggested, or something else.


Wavpack Lossy Quality

Reply #82

Thanks for the sample. I didn't realize that it was an impulse test before and those are a very interesting case because they are extremely simple in the time domain (which is why it zips so well) but very complex when converted into the frequency domain (which is why conventional lossy codecs choke on them). I was able to losslessly compress it with WavPack to about 200 kbps, so I suggest that you use that if you listen to a lot of these. 

When this are compressed with the WavPack lossy mode, the impulse is perfectly reproduced but then there is a little bit of residual noise that trails off as the predictor "recovers", and it's the low frequency portion (< 1000 Hz) of this noise that is audible, I believe. Turning on noise shaping (-s1) eliminates the low frequency portion of the noise and made this transparent for me, although like you said it was pretty close before.

I also tried lossy Monkey on this and it looks like it is simply stored losslessly, which is what WavPack should do too since there's enough bits to do it. However, I also noticed that lossy monkey introduced a DC offset, so I think there might be a bug in there somewhere.


I wouldn't characterize joint stereo in lossy WavPack as "risky", in fact it was the default in early versions because it generally results in lower noise and better lossless compression ratio. However, I did run into a few samples with stuff panned hard to the sides (i.e. early Beatles) in which I could hear cross-channel noise in headphones. I decided that I would rather sacrifice a little average performance for improved "worst case" performance, although now we are seeing a few "worse case" samples that favor joint stereo.

You are correct that Speek's frontend does not use joint stereo by default, but you can always add either -j0 or -j1 to force it either way. You might also want to experiment with noise shaping (-s1). I find that at low sampling rates (< 50 kHz) this generally causes the noise to be more "hissy" and audible, but it definitely increases the S/N ratio in the midrange. I would be interested in how you hear the difference.

Unfortunately, the current WavPack format supports only a single stereo mode for an entire file, so there would not be any way to add a "smart" mode at this time. However, WavPack 4.0 will allow on-the-fly switching, so it will definitely be possible then.

BTW, did you receive the e-mail I sent you last week through HA?


Wavpack Lossy Quality

Reply #83
Thanks for the info bryant.

I concur that the joint stereo switch -j1 seems to benefit all of my everyday music samples at the moment. I was considering testing it using a early Beatles rip myself, because I have one of those early Beatles albums on CD with some instruments recorded only on the left or right channel. (Very early example of multitrack recording!)

Certainly with more modern stuff where there is a lot of hard stereo panning, eg New Order - Bizarre Love Triangle, -js1 still works well, I'm guessing because there is plenty of other audio still there to mask any potential increase in noise.

I'll check out the noise shaping switch as well but probably after the next two weeks. I'm about to head off on a holiday and do a heap of diving off Ningaloo reef north of here. I'm stoked to be escaping the stress of work emails, but also wondering about getting by for 2 weeks without keeping up with hydrogen audio. 

I just checked, and I did get your email, thanks for that. The email address I submitted to HA doubles as my spam email address for registering on web sites, so I don't check it as often as I should. I will do so more often now, because there were 1 or 2 other HA ones there as well!

I, and many others I'm sure are looking forward to Wavpack 4.0. Thanks again for this interesting codec.