[vorbis-dev] Data smearing

Mark Taylor mt at sulaco.org
Thu Aug 19 19:48:19 PDT 1999



> 
> MP3 has this nasty habit of smearing data across many frames and
> seeking into an MP3 stream is a messy task. The developer of oolabola
> and myself are trying to get support for mp3 into his program, and one
> of the problems is that seeking into an MP3 stream often gives you
> artifacts because of the data smearing.
> 

I agree, the MP3 format is a mess, all because they wanted to gaurantee
a 128kbs stream could be processed at *exactly* 128kbs with a 8000 bit
buffer.  But in 1999, assuming your player has at most a 8000 bit
buffer seems a joke!

> 
> When you jump into the middle of an MP3 stream you may need to have a
> number of previous frames available in order to properly decode the
> current frame. That's not terrible if you can limit or predict how many
> frames you need to back up to in order to get a clean decode of your
> desired frame. But with MP3 there is no way to know how many frames you
> need -- its a trial and error situation.
> 

Actually, I think you can predict how many frames you need.  The
main_data_begin pointer is the offset into the previous frames where
the data for the current frame begins.  It is a small unsigned integer
which has a maximium (I think about 500 bytes).  If you know the
bitrate, you know how many bytes a frame takes, and you can easily
compute the maximum number of previous frames you could possibly need?
At 128kbs, I think it is only 2 extra frames.  

If it is a VBR stream, then it makes no sense to use the bitreservoir
and I think you could safely assume you never need more than two
previous frames?

Mark

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list