> 
> Ah, well, I dont believe that I want each coefficient set seperated, that
> is against the iso definition of the mpeg standard, right?  
> 
No, it is one of the main features of the standard!  Most documents on
MP3 explain this, in the section on the bit reservoir.  The
coefficient set is not physically seperated, but it can span several
frames.  To produce an mp3 frame which is completely self contained
would mean you never use the bitreservoir, and you waste bits every
frame.  (you end up wasting the difference between the bits used by
the huffman encoding and the total available bits per frame)



> anyway, I just need to figure out where in the code is the frame ready to
> be outputted as one frame.  does the buffer that is written contain only
> one frame at a time?  is that what formatbitstream does?  maybe i should
> study the code a lil harder b4 coming for help.  
> -kali
> 

You should read through lame.h.  lame is not completely modular, but
we have made some attempts to make what you want easy.  lame_encode()
is what you want.  It takes as input one frame of PCM data, and
outputs usually one MP3 frame (if l3bitstream/formatbitstream produced
a frame).  A couple things to watch out for:

1.
lame_encode() may sometimes return 0 bytes.  Give it one or two more
input frames and it will eventually return one mp3 frame. l3bitstream and
formatbitstream are doing a lot of internal buffering, and only when
a frame is complete (i.e. it gets all needed data from the following frames 
which will be stored in this frame) is the frame written to the
bitstream and output.  

2.
As stated before, the mp3 frame may not contain all data needed to decode
it.  for that, you need 2 or sometimes more previous frames.

--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to