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