📄 common.h
字号:
int mode_ext; int copyright; int original; int emphasis;} layer, *the_layer;/* Parent Structure Interpreting some Frame Parameters in Header */typedef struct { layer *header; /* raw header information */ int actual_mode; /* when writing IS, may forget if 0 chs */ al_table *alloc; /* bit allocation table read in */ int tab_num; /* number of table as loaded */ int stereo; /* 1 for mono, 2 for stereo */ int jsbound; /* first band of joint stereo coding */ int sblimit; /* total number of sub bands */} frame_params;/* Double and SANE Floating Point Type Definitions */typedef struct IEEE_DBL_struct { unsigned long hi; unsigned long lo;} IEEE_DBL;typedef struct SANE_EXT_struct { unsigned long l1; unsigned long l2; unsigned short s1;} SANE_EXT;/* AIFF Type Definitions */typedef char ID[4];typedef struct ChunkHeader_struct { ID ckID; long ckSize;} ChunkHeader;typedef struct Chunk_struct { ID ckID; long ckSize; ID formType;} Chunk;typedef struct CommonChunk_struct { ID ckID; long ckSize; short numChannels; unsigned long numSampleFrames; short sampleSize; char sampleRate[10];} CommonChunk;typedef struct SoundDataChunk_struct { ID ckID; long ckSize; unsigned long offset; unsigned long blockSize;} SoundDataChunk;typedef struct blockAlign_struct { unsigned long offset; unsigned long blockSize;} blockAlign;typedef struct IFF_AIFF_struct { short numChannels; unsigned long numSampleFrames; short sampleSize; double sampleRate; unsigned long sampleType; blockAlign blkAlgn;} IFF_AIFF;/* "bit_stream.h" Type Definitions */typedef struct bit_stream_struc { FILE *pt; /* pointer to bit stream device */ unsigned char *buf; /* bit stream buffer */ int buf_size; /* size of buffer (in number of bytes) */ long totbit; /* bit counter of bit stream */ int buf_byte_idx; /* pointer to top byte in buffer */ int buf_bit_idx; /* pointer to top bit of top byte in buffer */ int mode; /* bit stream open in read or write mode */ int eob; /* end of buffer index */ int eobs; /* end of bit stream flag */ char format; /* format of file in rd mode (BINARY/ASCII) */} Bit_stream_struc;/* Layer III side information. */typedef struct { unsigned main_data_begin; unsigned private_bits; struct { unsigned scfsi[4]; struct gr_info_s { unsigned part2_3_length; unsigned big_values; unsigned global_gain; unsigned scalefac_compress; unsigned window_switching_flag; unsigned block_type; unsigned mixed_block_flag; unsigned table_select[3]; unsigned subblock_gain[3]; unsigned region0_count; unsigned region1_count; unsigned preflag; unsigned scalefac_scale; unsigned count1table_select; } gr[2]; } ch[2]; } III_side_info_t;/* Layer III scale factors. */typedef struct { int l[23]; /* [cb] */ int s[3][13]; /* [window][cb] */ } III_scalefac_t[2]; /* [ch] *//************************************************************************* Global Variable External Declarations************************************************************************/extern char *mode_names[4];extern char *layer_names[3];extern double s_freq[4];extern int bitrate[3][15];extern double FAR multiple[64];/************************************************************************* Global Function Prototype Declarations************************************************************************//* The following functions are in the file "common.c" */#ifdef PROTO_ARGSextern FILE *OpenTableFile(char*);extern int read_bit_alloc(int, al_table*);extern int pick_table(frame_params*);extern int js_bound(int, int);extern void hdr_to_frps(frame_params*);extern void WriteHdr(frame_params*, FILE*);extern void WriteBitAlloc(unsigned int[2][SBLIMIT], frame_params*, FILE*);extern void WriteScale(unsigned int[2][SBLIMIT], unsigned int[2][SBLIMIT], unsigned int[2][3][SBLIMIT], frame_params*, FILE*);extern void WriteSamples(int, unsigned int FAR [SBLIMIT], unsigned int[SBLIMIT], frame_params*, FILE*);extern int NumericQ(char*);extern int BitrateIndex(int, int);extern int SmpFrqIndex(long);extern int memcheck(char*, int, int);extern void FAR *mem_alloc(unsigned long, char*);extern void mem_free(void**);extern void double_to_extended(double*, char[10]);extern void extended_to_double(char[10], double*);extern int aiff_read_headers(FILE*, IFF_AIFF*);extern int aiff_seek_to_sound_data(FILE*);extern int aiff_write_headers(FILE*, IFF_AIFF*);extern int refill_buffer(Bit_stream_struc*);extern void empty_buffer(Bit_stream_struc*, int);extern void open_bit_stream_w(Bit_stream_struc*, char*, int);extern void open_bit_stream_r(Bit_stream_struc*, char*, int);extern void close_bit_stream_r(Bit_stream_struc*);extern void close_bit_stream_w(Bit_stream_struc*);extern void alloc_buffer(Bit_stream_struc*, int);extern void desalloc_buffer(Bit_stream_struc*);extern void back_track_buffer(Bit_stream_struc*, int);extern unsigned int get1bit(Bit_stream_struc*);extern void put1bit(Bit_stream_struc*, int);extern unsigned long look_ahead(Bit_stream_struc*, int);extern unsigned long getbits(Bit_stream_struc*, int);extern void putbits(Bit_stream_struc*, unsigned int, int);extern void byte_ali_putbits(Bit_stream_struc*, unsigned int, int);extern unsigned long byte_ali_getbits(Bit_stream_struc*, int);extern unsigned long sstell(Bit_stream_struc*);extern int end_bs(Bit_stream_struc*);extern int seek_sync(Bit_stream_struc*, long, int);extern void I_CRC_calc(frame_params*, unsigned int[2][SBLIMIT], unsigned int*);extern void II_CRC_calc(frame_params*, unsigned int[2][SBLIMIT], unsigned int[2][SBLIMIT], unsigned int*);extern void update_CRC(unsigned int, unsigned int, unsigned int*);extern void read_absthr(FLOAT*, int);extern unsigned int hget1bit(); /* MI */extern unsigned long hgetbits(int);extern unsigned long hsstell();extern void hputbuf(unsigned int,int);#ifdef MACINTOSHextern void set_mac_file_attr(char[MAX_NAME_SIZE], short, OsType, OsType);#endif#ifdef MS_DOSextern char *new_ext(char *filename, char *extname); #endif#elseextern FILE *OpenTableFile();extern int read_bit_alloc();extern int pick_table();extern int js_bound();extern void hdr_to_frps();extern void WriteHdr();extern void WriteBitAlloc();extern void WriteScale();extern void WriteSamples();extern int NumericQ();extern int BitrateIndex();extern int SmpFrqIndex();extern int memcheck();extern void FAR *mem_alloc();extern void mem_free();extern void double_to_extended();extern void extended_to_double();extern int aiff_read_headers();extern int aiff_seek_to_sound_data();extern int aiff_write_headers();extern int refill_buffer();extern void empty_buffer();extern void open_bit_stream_w();extern void open_bit_stream_r();extern void close_bit_stream_r();extern void close_bit_stream_w();extern void alloc_buffer();extern void desalloc_buffer();extern void back_track_buffer();extern unsigned int get1bit();extern void put1bit();extern unsigned long look_ahead();extern unsigned long getbits();extern void putbits();extern void byte_ali_putbits();extern unsigned long byte_ali_getbits();extern unsigned long sstell();extern int end_bs();extern int seek_sync();extern void I_CRC_calc();extern void II_CRC_calc();extern void update_CRC();extern void read_absthr();extern unsigned int hget1bit();extern unsigned long hgetbits();extern unsigned long hsstell();extern void hputbuf();#ifdef MS_DOSextern char *new_ext(); #endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -