> From: "Mathew Hendry" <[EMAIL PROTECTED]>
> Date: Sat, 8 Jan 2000 00:14:21 -0000
>
> Hi all,
>
> I've noticed that some MP3 encoders (notably some versions of FhG) offer
> "non-standard" bitrates without the use of free format. They do this by
> alternating between the two closest bitrates. e.g. I can use
>
> mp3enc -if foo.wav -of foo.mp3 -br 110000 -qual 6
>
> producing an MP3 that uses 112kbps most of the time, dropping to 96kbps
> regularly to reduce the average bitrate to 110kbps. It would seem that this
> could be done without too much discontinuity in bits-per-frame by using the
> bit reservoir to absorb the changes.
>
> Would this feature be quite easy to add to LAME? I've found it quite useful
> in making MP3s "just fit" a particular medium, e.g. compressing 14 60 minute
> CDs at 110kbps to almost exactly fill a single CDR. (The BBC dramatization
> of Lord of the Rings, for those wondering :)
>
> -- Mat.
>
This should be pretty easy. The CBR routines in LAME can handle a changing
bitrate, so before calling iteration_loop() you just need a little
logic to set the correct bitrate.
To get the average bits per frame to be about the same should
not be that hard. Right now, it works like this:
ResvMaxBits2(): computes targ_bits and extra_bits
on_pe(): allocate extra bits based on PE.
I would just add a step at the end of ResvMaxBits2() which
shuffles bits between targ_bits and extra_bits so that targ_bits is
always what you want. The only thing to watch out for is that if
the bit reservoir is nearly full, dont reduce targ_bits because in
this case any bits which are not used by the frame will be wasted.
Mark
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )