View Single Post
Old 07 November 2004, 04:38 pm   #8
DEATH
foobar2000 developer
 
Join Date: Jul 2004
Posts: 4
Default

Quote:
* MPC_decoder:ecode() takes a int32 as argument (ok, so it's MPC_SAMPLE_FORMAT but that's the same thing). Howlarge should I allocate this buffer? FrameLength*samplesize*channels?
MPC_SAMPLE_FORMAT is either int32 (signed) or float, depending on MPC_FIXED_POINT #define in mpc_math.h. Floating-point mode is faster on about anything that has an FPU. As indicated by comments in headers, nominal range of fixed-point mode output is -MPC_FIXED_POINT_SCALE .. MPC_FIXED_POINT_SCALE, while nominal output range for floating-point decoding is -1 .. 1. Results may exceed nominal range, calling code is responsible for clipping them. Output buffer for Decode() should be MPC_decocder:ecodeBufferLength items long.
Quote:
* am I supposed to keep track of timestamps myself or are there timestamps embedded in the stream? If not, how do I know the exact timestamp after a seek (given that it's VBR)? Or doesn't that matter?
Library is responsible for seeking by itself. You only call the SeekSeconds() or SeekSamples() function. There are no timestamps in the stream, and seeking is very inefficient because of cross-frame dependencies.
Quote:
* can I reuse a MPC_decoder object between streams?
No.
Quote:
* who takes ownership (and thus takes care of dereferencing) the MPC_reader that I provide to MPC_decoder?
Caller has to create/destroy the MPC_reader callback object.

On a side note, it seems someone axed sample.cpp from the archive instead of updating it to compile it with new library changes. I've fixed it and temporarily mirrored here.
DEATH is offline   Reply With Quote