Saturday, September 02, 2006

new cbr search method

I implemented a new search method for CBR bit allocation which gives about 6% 10% faster encoding than with the old method.

old method:
  1. estimate snr based on last frame
  2. decrement snr in large steps until data fits in frame
  3. increment snr in medium steps while data still fits in frame
  4. increment snr in small steps while data still fits in frame
new method:
  1. estimate snr based on last frame
  2. narrow the search range by doing a weighted increment or decrement of snr based on how close it is to optimal sliding a 16-wide window up or down until it overlaps the optimal value.
  3. do a binary search for the optimal snr value

4 comments:

libra said...

Dear Justin,

Optimization is an tradeoff
between quality and speed. When you modify the algorithm, how do
you estimate the quality. In my
method, the EAQUAL, ODG, is used.
After using the new cbr search method, how about the quality.

Best Regards

Justin said...

The goal of the cbr bit allocation is to maximize the snroffset without exceeding the allowed bits for the frame. Right now snroffset is the only bit allocation parameter which is variable. Future improvements will use a secondary psychoacoustic model and approximate the results by modifying other parameters in the model defined in the spec.

The quality is theoretically affected with the new method, but only very slightly so it's well worth the speed gain for now. I could try to produce some objective tests, but that still wouldn't tell how much "quality" is affected, only how many bits are wasted.

I don't exactly understand what you mean by "In my method, the EAQUAL, ODG, is used."

libra said...

When i modify the algorithm, i will use the ODG score to test the quality. The ODG is an objective test. The scores range from -4 to 0. The -4 means annoying impairment, and 0 means imperceptible impairment. Through the score, it is known the difference between the reference signal(the "input" signal to a codec) and the test signal (the "output" signal of a codec).
It is the common objective analysis. Therefore, i use this score to test how much "quality" is affected. Maybe, this method is not good.

Gabriel said...

One "quality" value that can be used to compare both versions is the SMR values from Aften.
This is clearly not a "definitive" quality value, but usually when you change a bit allocation process it is a good idea to check it using the SMR values from your own model.
It allows to have a numerical value that is independant from potential flaws in your psy model. Using ODG or similar values, scores would be impacted by side effects coming from current psy model weakness, mixing both psymodel and bit allocation problems.

(note: sMr, not sNr)