Main Page | Class List | Directories | File List | File Members | Related Pages

musepack.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "musepack/config_types.h"
#include "musepack/decoder.h"
#include "musepack/reader.h"
#include "musepack/streaminfo.h"

Go to the source code of this file.

Defines

#define ERROR_CODE_OK   0
#define ERROR_CODE_FILE   -1
#define ERROR_CODE_SV7BETA   1
#define ERROR_CODE_CBR   2
#define ERROR_CODE_IS   3
#define ERROR_CODE_BLOCKSIZE   4
#define ERROR_CODE_INVALIDSV   5

Enumerations

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

Functions

void mpc_streaminfo_init (mpc_streaminfo *si)
mpc_int32_t mpc_streaminfo_read (mpc_streaminfo *si, mpc_reader *r)
double mpc_streaminfo_get_length (mpc_streaminfo *si)
mpc_int64_t mpc_streaminfo_get_length_samples (mpc_streaminfo *si)
void mpc_decoder_setup (mpc_decoder *d, mpc_reader *r)
BOOL mpc_decoder_initialize (mpc_decoder *d, mpc_streaminfo *si)
void mpc_decoder_scale_output (mpc_decoder *d, double scale_factor)
mpc_uint32_t mpc_decoder_decode (mpc_decoder *d, MPC_SAMPLE_FORMAT *buffer, mpc_uint32_t *vbr_update_acc, mpc_uint32_t *vbr_update_bits)
BOOL mpc_decoder_seek_sample (mpc_decoder *d, mpc_int64_t destsample)
 Seeks to the specified sample in the source stream.
BOOL mpc_decoder_seek_seconds (mpc_decoder *d, double seconds)
 Seeks to specified position in seconds in the source stream.


Detailed Description

Top level include file for libmusepack.

Definition in file musepack.h.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
MPC_DECODER_BUFFER_LENGTH  samples per mpc frame

Definition at line 56 of file musepack.h.


Function Documentation

mpc_uint32_t mpc_decoder_decode mpc_decoder *  d,
MPC_SAMPLE_FORMAT *  buffer,
mpc_uint32_t *  vbr_update_acc,
mpc_uint32_t *  vbr_update_bits
 

Actually reads data from previously initialized stream. Call this iteratively to decode the mpc stream.

Parameters:
buffer destination buffer for decoded samples
vbr_update_acc 
Todo:
document me
Parameters:
vbr_update_bits 
Todo:
document me
Returns:
-1 if an error is encountered

0 if the stream has been completely decoded successfully and there are no more samples

> 0 to indicate the number of bytes that were actually read from the stream.

Definition at line 422 of file mpc_decoder.c.

BOOL mpc_decoder_initialize mpc_decoder *  d,
mpc_streaminfo *  si
 

Initializes mpc decoder with the supplied stream info parameters. Call this next after calling mpc_decoder_setup.

Parameters:
si streaminfo structure indicating format of source stream
Returns:
TRUE if decoder was initalized successfully, FALSE otherwise

Definition at line 1194 of file mpc_decoder.c.

void mpc_decoder_scale_output mpc_decoder *  d,
double  scale_factor
 

Sets decoder sample scaling factor. All decoded samples will be multiplied by this factor.

Parameters:
scale_factor multiplicative scaling factor

Definition at line 89 of file requant.c.

void mpc_decoder_setup mpc_decoder *  d,
mpc_reader *  r
 

Sets up decoder library. Call this first when preparing to decode an mpc stream.

Parameters:
r reader that will supply raw data to the decoder

Definition at line 1108 of file mpc_decoder.c.

double mpc_streaminfo_get_length mpc_streaminfo *  si  ) 
 

Gets length of stream si, in seconds.

Returns:
length of stream in seconds

Definition at line 263 of file streaminfo.c.

References mpc_streaminfo_get_length_samples().

mpc_int64_t mpc_streaminfo_get_length_samples mpc_streaminfo *  si  ) 
 

Returns length of stream si, in samples.

Returns:
length of stream in samples

Definition at line 270 of file streaminfo.c.

Referenced by mpc_streaminfo_get_length().

void mpc_streaminfo_init mpc_streaminfo *  si  ) 
 

Initializes a streaminfo structure.

Parameters:
si streaminfo structure to initialize

Definition at line 56 of file streaminfo.c.

mpc_int32_t mpc_streaminfo_read mpc_streaminfo *  si,
mpc_reader *  r
 

Reads streaminfo header from the mpc stream supplied by r.

Parameters:
si streaminfo pointer to which info will be written
r stream reader to supply raw data
Returns:
error code

Definition at line 202 of file streaminfo.c.


Generated on Sat Jan 22 09:34:07 2005 for libmusepack by  doxygen 1.4.1