| 1 |
#ifndef MPG123_H_INCLUDED |
| 2 |
#define MPG123_H_INCLUDED |
| 3 |
|
| 4 |
#include <stdio.h> |
| 5 |
|
| 6 |
#define STDC_HEADERS |
| 7 |
|
| 8 |
#ifdef STDC_HEADERS |
| 9 |
# include <string.h> |
| 10 |
#else |
| 11 |
# ifndef HAVE_STRCHR |
| 12 |
# define strchr index |
| 13 |
# define strrchr rindex |
| 14 |
# endif |
| 15 |
char *strchr (), *strrchr (); |
| 16 |
# ifndef HAVE_MEMCPY |
| 17 |
# define memcpy(d, s, n) bcopy ((s), (d), (n)) |
| 18 |
# define memmove(d, s, n) bcopy ((s), (d), (n)) |
| 19 |
# endif |
| 20 |
#endif |
| 21 |
|
| 22 |
#include <signal.h> |
| 23 |
|
| 24 |
|
| 25 |
#if defined(__riscos__) && defined(FPA10) |
| 26 |
#include "ymath.h" |
| 27 |
#else |
| 28 |
#include <math.h> |
| 29 |
#endif |
| 30 |
|
| 31 |
#ifndef M_PI |
| 32 |
#define M_PI 3.14159265358979323846 |
| 33 |
#endif |
| 34 |
#ifndef M_SQRT2 |
| 35 |
#define M_SQRT2 1.41421356237309504880 |
| 36 |
#endif |
| 37 |
|
| 38 |
#ifndef FALSE |
| 39 |
#define FALSE 0 |
| 40 |
#endif |
| 41 |
#ifndef TRUE |
| 42 |
#define TRUE 1 |
| 43 |
#endif |
| 44 |
|
| 45 |
|
| 46 |
#ifdef REAL_IS_FLOAT |
| 47 |
# define real float |
| 48 |
#elif defined(REAL_IS_LONG_DOUBLE) |
| 49 |
# define real long double |
| 50 |
#else |
| 51 |
# define real double |
| 52 |
#endif |
| 53 |
|
| 54 |
#define FALSE 0 |
| 55 |
#define TRUE 1 |
| 56 |
|
| 57 |
#define SBLIMIT 32 |
| 58 |
#define SSLIMIT 18 |
| 59 |
|
| 60 |
#define MPG_MD_STEREO 0 |
| 61 |
#define MPG_MD_JOINT_STEREO 1 |
| 62 |
#define MPG_MD_DUAL_CHANNEL 2 |
| 63 |
#define MPG_MD_MONO 3 |
| 64 |
|
| 65 |
#define MAXFRAMESIZE 1792 |
| 66 |
|
| 67 |
|
| 68 |
#define SCALE_BLOCK 12 |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
#define AUSHIFT (3) |
| 73 |
|
| 74 |
struct frame { |
| 75 |
int stereo; |
| 76 |
int jsbound; |
| 77 |
int single; |
| 78 |
int lsf; |
| 79 |
int mpeg25; |
| 80 |
int header_change; |
| 81 |
int lay; |
| 82 |
int error_protection; |
| 83 |
int bitrate_index; |
| 84 |
int sampling_frequency; |
| 85 |
int padding; |
| 86 |
int extension; |
| 87 |
int mode; |
| 88 |
int mode_ext; |
| 89 |
int copyright; |
| 90 |
int original; |
| 91 |
int emphasis; |
| 92 |
int framesize; |
| 93 |
|
| 94 |
|
| 95 |
#if defined(USE_LAYER_2) || defined(USE_LAYER_1) |
| 96 |
int II_sblimit; |
| 97 |
struct al_table2 *alloc; |
| 98 |
int down_sample_sblimit; |
| 99 |
int down_sample; |
| 100 |
|
| 101 |
#endif |
| 102 |
|
| 103 |
}; |
| 104 |
|
| 105 |
struct gr_info_s { |
| 106 |
int scfsi; |
| 107 |
unsigned part2_3_length; |
| 108 |
unsigned big_values; |
| 109 |
unsigned scalefac_compress; |
| 110 |
unsigned block_type; |
| 111 |
unsigned mixed_block_flag; |
| 112 |
unsigned table_select[3]; |
| 113 |
unsigned subblock_gain[3]; |
| 114 |
unsigned maxband[3]; |
| 115 |
unsigned maxbandl; |
| 116 |
unsigned maxb; |
| 117 |
unsigned region1start; |
| 118 |
unsigned region2start; |
| 119 |
unsigned preflag; |
| 120 |
unsigned scalefac_scale; |
| 121 |
unsigned count1table_select; |
| 122 |
real *full_gain[3]; |
| 123 |
real *pow2gain; |
| 124 |
}; |
| 125 |
|
| 126 |
struct III_sideinfo |
| 127 |
{ |
| 128 |
unsigned main_data_begin; |
| 129 |
unsigned private_bits; |
| 130 |
struct { |
| 131 |
struct gr_info_s gr[2]; |
| 132 |
} ch[2]; |
| 133 |
}; |
| 134 |
|
| 135 |
|
| 136 |
#endif |