mpcdec.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00036 #ifndef _MPCDEC_H_
00037 #define _MPCDEC_H_
00038 #ifdef WIN32
00039 #pragma once
00040 #endif
00041
00042 #include "reader.h"
00043 #include "streaminfo.h"
00044
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048
00049 enum {
00050 MPC_FRAME_LENGTH = (36 * 32),
00051 MPC_DECODER_BUFFER_LENGTH = (MPC_FRAME_LENGTH * 4),
00052 MPC_DECODER_SYNTH_DELAY = 481
00053 };
00054
00055 typedef struct mpc_decoder_t mpc_decoder;
00056 typedef struct mpc_demux_t mpc_demux;
00057
00058 typedef struct mpc_bits_reader_t {
00059 unsigned char * buff;
00060 unsigned int count;
00061 } mpc_bits_reader;
00062
00063 typedef struct mpc_frame_info_t {
00064 mpc_uint32_t samples;
00065 mpc_int32_t bits;
00066 MPC_SAMPLE_FORMAT * buffer;
00067 mpc_bool_t is_key_frame;
00068 } mpc_frame_info;
00069
00070 typedef struct mpc_chap_info_t {
00071 mpc_uint64_t sample;
00072 mpc_uint16_t gain;
00073 mpc_uint16_t peak;
00074 mpc_uint_t tag_size;
00075 char * tag;
00076 } mpc_chap_info;
00077
00081 MPC_API mpc_decoder * mpc_decoder_init(mpc_streaminfo *si);
00082
00084 MPC_API void mpc_decoder_exit(mpc_decoder *p_dec);
00085
00091 MPC_API void mpc_decoder_scale_output(mpc_decoder *p_dec, double scale_factor);
00092
00093 MPC_API void mpc_decoder_decode_frame(mpc_decoder * d, mpc_bits_reader * r, mpc_frame_info * i);
00094
00095
00096 #define MPC_OLD_GAIN_REF 64.82
00097
00103 MPC_API mpc_demux * mpc_demux_init(mpc_reader * p_reader);
00105 MPC_API void mpc_demux_exit(mpc_demux * d);
00115 MPC_API void mpc_set_replay_level(mpc_demux * d, float level, mpc_bool_t use_gain,
00116 mpc_bool_t use_title, mpc_bool_t clip_prevention);
00118 MPC_API mpc_status mpc_demux_decode(mpc_demux * d, mpc_frame_info * i);
00120 MPC_API void mpc_demux_get_info(mpc_demux * d, mpc_streaminfo * i);
00122 MPC_API mpc_status mpc_demux_seek_sample(mpc_demux * d, mpc_uint64_t destsample);
00124 MPC_API mpc_status mpc_demux_seek_second(mpc_demux * d, double seconds);
00125
00127 MPC_API mpc_seek_t mpc_demux_pos(mpc_demux * d);
00128
00130
00135 MPC_API mpc_int_t mpc_demux_chap_nb(mpc_demux * d);
00143 MPC_API mpc_chap_info const * mpc_demux_chap(mpc_demux * d, int chap_nb);
00144
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148 #endif