/* * mp3play defines * used source: musicout.h from mpegaudio package * */ #include #include #include #include #include #include "glxf.h" #include "interface.h" #define MPG123_REMOTE #define SHUFFLESUPPORT #define FRONTEND_SAJBER 1 #define FRONTEND_TK3PLAY 2 #include #define real float #ifdef __GNUC__ #define INLINE inline #else #define INLINE #endif #include "audio.h" /* AUDIOBUFSIZE = n*64 with n=1,2,3 ... */ #define AUDIOBUFSIZE 16384 #define FALSE 0 #define TRUE 1 #define MAX_NAME_SIZE 81 #define SBLIMIT 32 #define SCALE_BLOCK 12 #define SSLIMIT 18 #define MPG_MD_STEREO 0 #define MPG_MD_JOINT_STEREO 1 #define MPG_MD_DUAL_CHANNEL 2 #define MPG_MD_MONO 3 #define MAXOUTBURST 32768 struct al_table { short bits; short d; }; /* This is the * structure of the actual audio frame */ struct frame { struct al_table *alloc; int (*synth)(real *,int,unsigned char *); int (*synth_mono)(real *,unsigned char *); int stereo; int jsbound; int single; int II_sblimit; int lsf; int mpeg25; int down_sample; int header_change; int block_size; int lay; int (*do_layer)(struct frame *fr,int,struct audio_info_struct *); int error_protection; int bitrate_index; int sampling_frequency; int padding; int extension; int mode; int mode_ext; int copyright; int original; int emphasis; }; extern int outmode; extern int tryresync; extern char *prgName, *prgVersion; /* ------ Declarations from "common.c" ------ */ extern void audio_flush(int, struct audio_info_struct *); extern void print_header(struct frame *); extern void print_header_compact(struct frame *); extern char *strndup(const char *src, int num); extern unsigned int getbits(int); extern unsigned int getbits_fast(int); extern void set_pointer(long); extern unsigned char *pcm_sample; extern int pcm_point; extern int audiobufsize; /* Extra stuff in Layer III that we have to keep track of */ struct III_sideinfo { unsigned main_data_begin; unsigned private_bits; struct { struct gr_info_s { int scfsi; unsigned part2_3_length; unsigned big_values; unsigned scalefac_compress; unsigned block_type; unsigned mixed_block_flag; unsigned table_select[3]; unsigned subblock_gain[3]; unsigned maxband[3]; unsigned maxbandl; unsigned maxb; unsigned region1start; unsigned region2start; unsigned preflag; unsigned scalefac_scale; unsigned count1table_select; real *full_gain[3]; real *pow2gain; } gr[2]; } ch[2]; }; extern int open_stream(const char *,int fd); extern void close_stream(void); extern void read_frame_init (void); extern int read_frame(struct frame *fr); extern void play_frame(int init,struct frame *fr); extern int do_layer3(struct frame *fr,int,struct audio_info_struct *); extern int synth_1to1 (real *,int,unsigned char *); extern int synth_1to1_8bit (real *,int,unsigned char *); extern int synth_1to1_mono (real *,unsigned char *); extern int synth_1to1_8bit_mono (real *,unsigned char *); extern void set_pointer(long); extern void init_layer3(int); extern void make_decode_tables(long scale); extern void make_conv16to8_table(int); extern void dct64(real *,real *,real *); extern unsigned char *conv16to8; extern long freqs[7]; /*extern real muls[27][64];*/ extern real decwin[512+32]; extern real *pnts[5];