Fabien A.P. Petitcolas wrote:
> Slightly off topic but someone might know...
>
> During the encoding process the "outer_loop" returns the number of bits
> needed for encoding ("part2_3_length"). This number is then modified using
> the bit stuffing routine.
>
> Now on the *decoder* side, I'd like to recover exactly the value of
> "part2_3_length" before this stuffing. The standard says that these stuffing
> bits are ignored during decoding so it should be possible. I used the
> Fraunhofer decoder: when looking closely the value it uses is different.
>
> Does anyone have an idea how to fix this?
>
> Thanks,
>
> Fabien.
>
> ---
> Fabien Petitcolas, Computer Laboratory, University of Cambridge
> <http://www.cl.cam.ac.uk/~fapp2/>
I am not sure I understand your question, but maybe I can clarify?
the Part 2 length is the number of bits required to encode the side information
for the current frame.
the part2_3 length is the side info + the coded data length. Sometimes the
data is padded out
with "stuffing bits" when the frame needs to be rounded to a byte boundary,
usually near or in the
vicinity of the sync word/frame header. The decoder, of course, ignores these
stuffing bits.
I'm not sure why you would need to know what the value of the original part 2_3
length is,but you can get it
from adding the size of the side info to the bits required to unpack the main
data for the frame. Of course, the
stuffing bits are ignored. During encoding when you "save" up too many bits the
bitstream formatter sucks up
some of these bits and uses this "stuffing". This is explained (poorly) in IS
11172-3 at C.1.5.4.2.2
R. Luebbert
--
Rafael W. Luebbert Author of: MPecker MPEG Audio Encoder
Sumter, SC MPecker MPEG Audio Player
email: [EMAIL PROTECTED] MPecker Drop Decoder
Get latest version(s) at: http://www.anime.net/~go/mpeckers.html