Help - Search - Members - Calendar
Full Version: JavaLayer decoding quality
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
Piligrim
Hi,

I'm not sure whether this is a tech question or not. I'm writing a player with cue sheet support and i'm using JavaLayer for mp3 playback. I've posted my question on their web-site, but didn't get an answer.

I've spent a lot of time debugging my code for sample accurate seek before i've found the real problem.

When i feed the first frame to the decoder (does not matter first frame in the file, or first frame after seek), the output starts with zeroes, then some junk bytes, and, if I check the output after the seek against reference output, at the end of the frame it gradually starts to give correct samples. Rest of frames seem to be decoded correctly.

Maybe someone can guess a possible source of such behavior (Synthesis filter, or some initial values in the decoder)?

Thanks
Piligrim
Hmm, if I decode same file with jmpg123, java decoder written by first creator of mpg123 a long time ago, it gives similar pattern. Am I doing something wrong?

PS. To answer probable questions about enc_delay, I do read lame tag and discard the delay.
Piligrim
I have found this at http://www.mp3-tech.org/programmer/frame_header.html:

QUOTE
in the case of Layer III, frames are not always independant. Due to the possible use of the "byte reservoir", wich is a kind of internal buffer, frames are often dependent of each other. In the worst case, 9 input frames may be needed before beeing able to decode one single frame.


Might this be the cause? The I should decode 9 frames after seek?

Updated: hmm, very "elegant" solution but it works. Thanks for your cooperation. Topic closed.
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.