Help - Search - Members - Calendar
Full Version: analyze stereo() and -x mode questions
Hydrogenaudio Forums > Lossless Audio Compression > WavPack
wukongo
I am a wavpack freshman, have some questions.
In default mode, why Encoder call analyze stereo() only when first block or terms_num == 0, can this ensure all blocks will be encoded with ideal mode (joint_stereo or not) and ideal weights, samples, medians?
Then, what's the purpose of the extra mode (0 - 6) respectively?

The version of Codec i read is 4.32.
Thank you!
shadowking
In normal mode everything is encoded in forced joint stereo. x modes can increase compression without affecting decoding speed (mode 2-6) and also do adaptive joint stereo (mode 1-6). That is all I know.


bryant
QUOTE(wukongo @ Dec 4 2006, 04:23) *

I am a wavpack freshman, have some questions.
In default mode, why Encoder call analyze stereo() only when first block or terms_num == 0, can this ensure all blocks will be encoded with ideal mode (joint_stereo or not) and ideal weights, samples, medians?
Then, what's the purpose of the extra mode (0 - 6) respectively?

The version of Codec i read is 4.32.
Thank you!

In the cases where the "extra" mode is being used, analyze_stereo() is called for every block to compute the best filter for that block. When "extra" mode is not being used (the default) then the decorrelation state (and the entropy stuff as well) is simply used directly from where the previous block left off (since all the parameters are adaptive).

However, there are two cases where we call analyze_stereo() even in the default (non-extra) mode. The first is for the first block of the file, and the other is for a case where something dramatic changes that would cause a discontinuity in the data (like changing the amount the data is right shifted). In these cases we call analyze_stereo() to simply setup the default decorrelation terms and do a scan to determine the optimum starting values for the weights and the entropy parameters. There is no check for optimum joint stereo setting in this case (because it would not apply for the whole file).

Note that this could be skipped altogether and simply have the encoder start from scratch in these cases, or continue where it left off. There would be an insignificant degradation in compression at that point (and in lossy mode there might be a discontinuity in noise). However, you would have to supply some other way of copying in the default terms for the given mode (I used to do this in pack_init()).

To find out what the extra levels do explicitly, you need to look at the bitmask values in the xtable[] arrays in wputils.c and look them up in wavpack.h where I define the masks like EXTRA_SCAN_ONLY, etc.

Hope this makes sense. If you have more questions you can e-mail me directly at the address on the WavPack website. I can't imagine this discussion would be of interest to anybody else... smile.gif

David
wukongo
QUOTE(shadowking @ Dec 4 2006, 20:50) *

In normal mode everything is encoded in forced joint stereo. x modes can increase compression without affecting decoding speed (mode 2-6) and also do adaptive joint stereo (mode 1-6). That is all I know.



QUOTE(bryant @ Dec 5 2006, 04:46) *

In the cases where the "extra" mode is being used, analyze_stereo() is called for every block to compute the best filter for that block. ……


Thank you a lot!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.