Wednesday, April 29, 2009

exponents

I've been thinking about how to improve the quality of Aften. The first thing, which I vow to get finished soon, is channel coupling, but there are other things I want to try out too.

The exponent strategy decision in Aften is somewhat simple. In AC-3, exponents can take up anywhere from about 100 to 2500 bits per channel, per frame. In Aften, the set of 6 exponent strategies for each channel are chosen from a list that usually gives somewhere around 400-500 bits/channel. In some cases bits are clearly wasted on the mantissas and could be put to better use increasing accuracy of the exponents. My first thought is to create separate exponent strategy set tables to group together sets that use about the same number of bits. The table corresponding to approximately the current choices would be the default, but Aften could choose other tables in response to the results of bit allocation.

For high bitrate encoding, average quality of 280 to 300 is fairly common, with values in some sections averaging 340 to 350. I would experiment with various thresholds for switching from adding bits to mantissas to adding bits to exponents. My first inclination would be to make it around 280. It could even be done incrementally, with certain quality levels triggering a switch to the next highest exponent table.

For low bitrate encoding, I would have to be very careful about taking away bits from exponents. I'll need to do some listening tests and some other types of objective measurements to determine how reducing exponent accuracy affects percieved quality. The numerical "quality" setting in Aften is only directly related to mantissa accuracy.

I have also briefly experimented with weighting the error measurement used to select exponent strategies. I tried weighting the error values by frequency bin based on the hearing threshold table. This gave more weight to error in the more important bandwidths. I have not been able to hear a difference though. Some PEAQ tests have shown about a 0.02 increase in the objective difference grade (OGD) across several samples, so it at least is likely not to hurt quality... But it's slower, so I'm holding off on committing it until I can do more tests.