Hi all!
I made a new subblock gain and scalefactor_scale implementation.
Here's it. Any comment welccomed.
The test code is available at my snapshot.
http://www.isoternet.org/~tominagag/lame-beta/lame-0116.tar.bz2
1. scalefactor scale
The current LAME can treat with scalefactor_scale with -Y option.
With this option, when one of scalefactors will be too large while
searching the all scalefactors with scalefactor_scale=0, it will
search the all scalefactors with scalefactor_scale=1. But it is too
wastefull, I think.
I made some short cut to the nearest even number and halves it. like this
new code old code
scalefactor_scale 0 1 1
scalefactor_1 1 1 0
scalefactor_2 17 => 9 0
scalefactor_3 11 6 0
scalefactor_4 4 2 0
This method speed-ups -Y option with the almost same quality.
2. subblock gain
The current LAME can treat with scalefactor_scale with -Z option. It
calculate the subblock gain from the mean energy of each subblock.
It may be a aproximated method, but I'm afraid it is not best.
My implementation is like this.
When one of scalefactors will be too large even with scalefactor_scale
is 1, it will increase the subblock_gain and re-calculate the
scalefactor.
This method would be the best subblock gain selection as far as the
psychoacoustic model is right.
---
Takehiro TOMINAGA // May the source be with you!
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )