Skip to main content
Topic: analyze stereo() and -x mode questions (Read 3679 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

analyze stereo() and -x mode questions

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!

analyze stereo() and -x mode questions

Reply #1
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.
wavpack 4.8 -b256hx6c

analyze stereo() and -x mode questions

Reply #2
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... 

David

analyze stereo() and -x mode questions

Reply #3
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.



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!

 
SimplePortal 1.0.0 RC1 © 2008-2019