00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AC3_H
00021 #define AC3_H
00022
00023 #include "mpeg3real.h"
00024
00025 #define MAX_AC3_FRAMESIZE 1920 * 2 + 512
00026
00027 extern int mpeg3_ac3_samplerates[3];
00028
00029
00030 #define MPEG3_EXP_REUSE (0)
00031 #define MPEG3_EXP_D15 (1)
00032 #define MPEG3_EXP_D25 (2)
00033 #define MPEG3_EXP_D45 (3)
00034
00035
00036 #define DELTA_BIT_REUSE (0)
00037 #define DELTA_BIT_NEW (1)
00038 #define DELTA_BIT_NONE (2)
00039 #define DELTA_BIT_RESERVED (3)
00040
00041
00042 typedef mpeg3_real_t mpeg3ac3_stream_samples_t[6][256];
00043
00044 typedef struct
00045 {
00046
00047 int bsid;
00048
00049 int bsmod;
00050
00051 int acmod;
00052
00053
00054 int cmixlev;
00055
00056
00057 int surmixlev;
00058
00059
00060 int dsurmod;
00061
00062 int lfeon;
00063
00064 int dialnorm;
00065
00066 int compre;
00067
00068 int compr;
00069
00070 int langcode;
00071
00072 int langcod;
00073
00074 unsigned int audprodie;
00075 int mixlevel;
00076 int roomtyp;
00077
00078 int dialnorm2;
00079 int compr2e;
00080 int compr2;
00081 int langcod2e;
00082 int langcod2;
00083 int audprodi2e;
00084 int mixlevel2;
00085 int roomtyp2;
00086
00087 int copyrightb;
00088
00089 int origbs;
00090
00091 int timecod1e;
00092
00093 unsigned int timecod1;
00094
00095 int timecod2e;
00096
00097 unsigned int timecod2;
00098
00099 int addbsie;
00100
00101 int addbsil;
00102
00103 unsigned char addbsi[64];
00104
00105
00106
00107
00108 int nfchans;
00109 } mpeg3_ac3bsi_t;
00110
00111 typedef struct
00112 {
00113
00114 unsigned short blksw[5];
00115
00116 unsigned short dithflag[5];
00117
00118 int dynrnge;
00119
00120 int dynrng;
00121
00122
00123 int dynrng2e;
00124
00125 int dynrng2;
00126
00127 int cplstre;
00128
00129 int cplinu;
00130
00131 unsigned short chincpl[5];
00132
00133
00134 int phsflginu;
00135
00136 int cplbegf;
00137
00138 int cplendf;
00139
00140 unsigned short cplbndstrc[18];
00141
00142 unsigned short cplcoe[5];
00143
00144 unsigned short mstrcplco[5];
00145
00146 unsigned short cplcoexp[5][18];
00147 unsigned short cplcomant[5][18];
00148
00149 unsigned short phsflg[18];
00150
00151 unsigned int rematstr;
00152
00153 unsigned short rematflg[4];
00154
00155 int cplexpstr;
00156
00157 unsigned short chexpstr[5];
00158
00159 int lfeexpstr;
00160
00161 unsigned short chbwcod[5];
00162
00163 int cplabsexp;
00164
00165 unsigned short cplexps[18 * 12 / 3];
00166
00167 unsigned short exps[5][252 / 3];
00168
00169 unsigned short gainrng[5];
00170
00171 unsigned short lfeexps[3];
00172
00173
00174 int baie;
00175
00176 int sdcycod;
00177
00178 int fdcycod;
00179
00180 int sgaincod;
00181
00182 int dbpbcod;
00183
00184 int floorcod;
00185
00186
00187 int snroffste;
00188
00189 int csnroffst;
00190
00191 int cplfsnroffst;
00192
00193 int cplfgaincod;
00194
00195 unsigned short fsnroffst[5];
00196
00197 unsigned short fgaincod[5];
00198
00199 int lfefsnroffst;
00200
00201 int lfefgaincod;
00202
00203
00204 int cplleake;
00205
00206 int cplfleak;
00207
00208 int cplsleak;
00209
00210
00211 int deltbaie;
00212
00213 int cpldeltbae;
00214
00215 unsigned short deltbae[5];
00216
00217 int cpldeltnseg;
00218
00219 short cpldeltoffst[8];
00220
00221 short cpldeltlen[8];
00222
00223 short cpldeltba[8];
00224
00225 unsigned short deltnseg[5];
00226
00227 short deltoffst[5][8];
00228
00229 short deltlen[5][8];
00230
00231 short deltba[5][8];
00232
00233
00234 int skiple;
00235
00236 int skipl;
00237
00238
00239 short chmant[5][256];
00240
00241
00242 unsigned short cplmant[256];
00243
00244
00245 unsigned short lfemant[7];
00246
00247
00248
00249
00250 int ncplsubnd;
00251
00252
00253
00254 int ncplbnd;
00255
00256
00257
00258 int nchgrps[5];
00259
00260
00261
00262 int ncplgrps;
00263
00264
00265 unsigned short endmant[5];
00266
00267
00268 int cplstrtmant;
00269 int cplendmant;
00270
00271
00272 unsigned short fbw_exp[5][256];
00273 unsigned short cpl_exp[256];
00274 unsigned short lfe_exp[7];
00275
00276
00277 short fbw_bap[5][256];
00278
00279 short cpl_bap[256];
00280 short lfe_bap[7];
00281 } mpeg3_ac3audblk_t;
00282
00283
00284 typedef struct
00285 {
00286 int sdecay;
00287 int fdecay;
00288 int sgain;
00289 int dbknee;
00290 int floor;
00291 short psd[256];
00292 short bndpsd[256];
00293 short excite[256];
00294 short mask[256];
00295 } mpeg3_ac3_bitallocation_t;
00296
00297
00298 typedef struct
00299 {
00300 unsigned short m_1[3];
00301 unsigned short m_2[3];
00302 unsigned short m_4[2];
00303 unsigned short m_1_pointer;
00304 unsigned short m_2_pointer;
00305 unsigned short m_4_pointer;
00306 } mpeg3_ac3_mantissa_t;
00307
00308 #endif