View Single Post
Old 24 March 2006, 10:28 am   #1
Join Date: Mar 2006
Posts: 12
Default Improved seeking for mpc files

Does anyone have any thoughts on the seeking implemented in libmpcdec (or in_mpc, etc.)?

I'm thinking of testing an improvement to the seeking in mpc files on Rockbox. The key features of this "improvement" are:

1. Use a/the seek table as much as possible
2. Don't use fseek when jumping forward to the required frame (when the seek table is empty), just fill the buffer as normal (I'm not sure my assumption that a few "large" freads are faster than lots of small fseeks and small freads will hold up in Rockbox). Does anyone know?
3. Only decode the scale factors in the n previous frames (I found n=64 is good) and skip over the rest of the frame - this will be faster than decoding all of the frame
4. Set any scale factors that haven't been reset to -128 which avoids any loud artifacts (if using a smaller n).

I've tested all this in (yikes!) C# and it seeks to work ok, and will eventually go ahead and test it in Rockbox (if I can find a MS version of cygwin so I can compile it ;-)).

Any thoughts appreciated.
snowgoon is offline   Reply With Quote