File: mpglib.h

package info (click to toggle)
asterisk 1:13.14.1~dfsg-2+deb9u4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 50,572 kB
  • sloc: ansic: 675,986; sh: 11,363; python: 3,925; sql: 3,634; makefile: 3,153; perl: 3,103; yacc: 2,164; cpp: 2,093; xml: 786; tcl: 113; php: 62
file content (75 lines) | stat: -rw-r--r-- 2,347 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75

struct buf {
        unsigned char *pnt;
	long size;
	long pos;
        struct buf *next;
        struct buf *prev;
};

struct framebuf {
	struct buf *buf;
	long pos;
	struct frame *next;
	struct frame *prev;
};

struct mpstr {
	struct buf *head,*tail;
	int bsize;
	int framesize;
        int fsizeold;
	struct frame fr;
        unsigned char bsspace[2][MAXFRAMESIZE+512]; /* MAXFRAMESIZE */
	real hybrid_block[2][2][SBLIMIT*SSLIMIT];
	int hybrid_blc[2];
	unsigned long header;
	int bsnum;
	real synth_buffs[2][2][0x110];
        int  synth_bo;
	long outscale; /* volume control default value 32768 */
	long outsamplerate; /* raw output rate default same as mp3 sample rate*/
	struct pcm_workingsample worksample; /* keep the state of the working sample for threads */
	int initmp3; /* flag for first initialisation */
	int longLimit[9][23]; /*sample limits re setting volume */
	int shortLimit[9][14];
	real decwin[512+32]; /* scale table */
	
	};

#define BOOL int

#define MP3_ERR -1
#define MP3_OK  0
#define MP3_NEED_MORE 1


void InitMP3Constants(void);
BOOL InitMP3(struct mpstr *mp, long outscale);
int decodeMP3(struct mpstr *mp,char *inmemory,int inmemsize,
     char *outmemory,int outmemsize,int *done);
void ExitMP3(struct mpstr *mp);

extern int synth_ntom_set_step(long,long);
extern int synth_ntom(struct mpstr *mp, real *bandPtr,int channel,unsigned char *out,int *pnt);
extern int synth_ntom_mono (struct mpstr *mp, real *bandPtr,unsigned char *samples,int *pnt);
extern int synth_ntom_8bit (real *,int,unsigned char *,int *);
extern int synth_ntom_mono2stereo (real *,unsigned char *,int *);
extern int synth_ntom_8bit_mono (real *,unsigned char *,int *);
extern int synth_ntom_8bit_mono2stereo (real *,unsigned char *,int *);

extern void init_layer3_sample_limits(struct mpstr *mp, int down_sample_sblimit);
extern void init_layer3_const(void);
extern int do_layer3(struct mpstr *mp,unsigned char *,int *);

extern void make_decode_tables_scale(struct mpstr *mp, long scaleval);
extern void make_decode_tables_const(void);
extern void make_conv16to8_table(int);

extern void dct64(real *,real *,real *);

extern unsigned int   get1bit(struct mpstr *mp);
extern unsigned int   getbits(struct mpstr *mp, int);
extern unsigned int   getbits_fast(struct mpstr *mp, int);
extern int set_pointer(struct mpstr *mp, long backstep);