mpcdec.h File Reference

#include "reader.h"
#include "streaminfo.h"

Go to the source code of this file.

Classes

struct  mpc_bits_reader_t
struct  mpc_frame_info_t
struct  mpc_chap_info_t

Defines

#define MPC_OLD_GAIN_REF   64.82

Typedefs

typedef mpc_decoder_t mpc_decoder
typedef mpc_demux_t mpc_demux
typedef mpc_bits_reader_t mpc_bits_reader
typedef mpc_frame_info_t mpc_frame_info
typedef mpc_chap_info_t mpc_chap_info

Enumerations

enum  { MPC_FRAME_LENGTH = (36 * 32), MPC_DECODER_BUFFER_LENGTH = (MPC_FRAME_LENGTH * 4), MPC_DECODER_SYNTH_DELAY = 481 }

Functions

MPC_API mpc_decodermpc_decoder_init (mpc_streaminfo *si)
MPC_API void mpc_decoder_exit (mpc_decoder *p_dec)
 Releases input mpc decoder.
MPC_API void mpc_decoder_scale_output (mpc_decoder *p_dec, double scale_factor)
MPC_API void mpc_decoder_decode_frame (mpc_decoder *d, mpc_bits_reader *r, mpc_frame_info *i)
MPC_API mpc_demuxmpc_demux_init (mpc_reader *p_reader)
MPC_API void mpc_demux_exit (mpc_demux *d)
 free demuxer
MPC_API void mpc_set_replay_level (mpc_demux *d, float level, mpc_bool_t use_gain, mpc_bool_t use_title, mpc_bool_t clip_prevention)
MPC_API mpc_status mpc_demux_decode (mpc_demux *d, mpc_frame_info *i)
 decode frame
MPC_API void mpc_demux_get_info (mpc_demux *d, mpc_streaminfo *i)
 get streaminfo
MPC_API mpc_status mpc_demux_seek_sample (mpc_demux *d, mpc_uint64_t destsample)
 seeks to a given sample
MPC_API mpc_status mpc_demux_seek_second (mpc_demux *d, double seconds)
 seeks to a given second
MPC_API mpc_seek_t mpc_demux_pos (mpc_demux *d)
MPC_API mpc_int_t mpc_demux_chap_nb (mpc_demux *d)
 chapters : only for sv8 streams
MPC_API mpc_chap_info const * mpc_demux_chap (mpc_demux *d, int chap_nb)


Detailed Description

Top level include file for libmpcdec.

Definition in file mpcdec.h.


Enumeration Type Documentation

anonymous enum

Enumerator:
MPC_FRAME_LENGTH  Samples per mpc frame.
MPC_DECODER_BUFFER_LENGTH  Required buffer size for decoder.

Definition at line 49 of file mpcdec.h.


Function Documentation

MPC_API mpc_decoder* mpc_decoder_init ( mpc_streaminfo si  ) 

Initializes mpc decoder with the supplied stream info parameters.

Parameters:
si streaminfo structure indicating format of source stream
Returns:
pointer on the initialized decoder structure if successful, 0 if not

MPC_API void mpc_decoder_scale_output ( mpc_decoder p_dec,
double  scale_factor 
)

Sets decoder sample scaling factor. All decoded samples will be multiplied by this factor. Useful for applying replay gain.

Parameters:
scale_factor multiplicative scaling factor

MPC_API mpc_chap_info const* mpc_demux_chap ( mpc_demux d,
int  chap_nb 
)

Gets datas associated to a given chapter The chapter tag is an APEv2 tag without the preamble

Parameters:
d pointer to a musepack demuxer
chap_nb chapter number you want datas (from 0 to mpc_demux_chap_nb(d) - 1)
Returns:
the chapter information structure

MPC_API mpc_int_t mpc_demux_chap_nb ( mpc_demux d  ) 

chapters : only for sv8 streams

Gets the number of chapters in the stream

Parameters:
d pointer to a musepack demuxer
Returns:
the number of chapters found in the stream

MPC_API mpc_demux* mpc_demux_init ( mpc_reader p_reader  ) 

init demuxer

Parameters:
p_reader initialized mpc_reader pointer
Returns:
an initialized mpc_demux pointer

MPC_API mpc_seek_t mpc_demux_pos ( mpc_demux d  ) 

Returns:
the current position in the stream (in bits) from the beginning of the file

MPC_API void mpc_set_replay_level ( mpc_demux d,
float  level,
mpc_bool_t  use_gain,
mpc_bool_t  use_title,
mpc_bool_t  clip_prevention 
)

Calls mpc_decoder_scale_output to set the scaling factor according to the replay gain stream information and the supplied ouput level

Parameters:
d pointer to a musepack demuxer
level the desired ouput level (in db). Must be MPC_OLD_GAIN_REF (64.82 db) if you want to get the old replaygain behavior
use_gain set it to MPC_TRUE if you want to set the scaling factor according to the stream gain
use_title MPC_TRUE : uses the title gain, MPC_FALSE : uses the album gain
clip_prevention MPC_TRUE : uses cliping prevention


Generated on Sun Jan 16 05:02:42 2011 for libmpcdec by  doxygen 1.4.7