Help - Search - Members - Calendar
Full Version: Reservoir bits in cbr
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
ominiran
Help,

Lame 3.96.1 version
I set the ResvSize = 0 in the ResvMaxBits routine with the hope of seeing a significant change in the size of an encoded file.
Unfortunately, the size of the file remain the same with the ResvSize = 0 and when the program is allowed to run using bits from the bit reservoir. I mean the size of the file in bytes was still the same regardless of the default program or the changes I introduced.

void ResvMaxBits(...)
{....

int ResvSize = gfc->ResvSize;

int totframes;
int frames;

totframes = lame_get_totalframes(gfp);
totframes /=5;

frames = lame_get_frameNum(gfp);
if (frames > 2 *totframes && frames < 4 * totframes)
ResvSize = 0;

....

}

Can anyone explain this.

How does the ResvSize affect the size of a file.

Thanks, I appreciate .
robert
if you encode at constant bitrate, you'll always get same sized mp3s.

btw, lame already has a switch to disable the use of the bitreservoire: --nores
Garf
The bitreservoir only affects the *distribution* of bits.
ominiran
QUOTE (Garf @ Jun 15 2005, 04:23 AM)
The bitreservoir only affects the *distribution* of bits.
*



Can you please explain what you mean by distibution of bits,

Also, for the same file size, is it due to padding?.
robert
the bitreservoir is some back pointer indicating how many bits from previous frames can be used together with the actual frame.

you get constant file size because of constant bitrate.
ChiGung
iirc the bitreservior helps distribute the contanst bit flow, by providing a way to store extra bits needed for later frames, in earlier frames which didnt use as much.
If the reservior mechanism is turned off, any unused bits in frames are left empty in each frame, resulting in the same size of file but much wasted space inside the file. Turned on, the unused bits are packed with extra bits to be added to later frames.
If you turn off the bitreservior in vbr, the filesize will be larger, because although vbr gets to choose the 'packaging' framesize it wants eachtime, the exact framesize can be slighlty smaller and the bitreservior is needed to save those differences.
VBR can deal with no bitreservior, with just some ~10% wasted space,
but CBR will get a very big quality hit without it.

hth
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.