~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to mpg123.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Kobras
  • Date: 2004-09-07 15:57:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040907155757-pgypftl9bt2uqyyl
Tags: 0.59r-16
* layer2.c: Fix buffer overflow in layer2 decoder (CVE ID CAN-2004-0805).
* Makefile: Fix compiler options to build for generic targets on ARM,
  but optimise for xscale. Closes: #261255
* README.3DNOW, dct36_3dnow.s, dct64_3dnow.s, decode_3dnow.s,
  decode_i386.c, equalizer_3dnow.s, getcpuflags.s, layer3.c, mpg123.c,
  mpg123.h, tabinit.c, debian/rules: Apply patch by KIMURA Takuhiro and
  Syuuhei Kashiyama to fix errors in 3dnow-optimised decoding.
  Thanks to Alberto Garcia for the patch-merging. Closes: #242212
* debian/prerm: De-register mp3-decoder alternative. Closes: #222982
* debian/changelog: Convert to utf8.
* debian/control: Bump standards version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
#  define real float
57
57
#elif defined(REAL_IS_LONG_DOUBLE)
58
58
#  define real long double
 
59
#elif defined(REAL_IS_FIXED)
 
60
# define real long
 
61
 
 
62
# define REAL_RADIX            15
 
63
# define REAL_FACTOR           (32.0 * 1024.0)
 
64
 
 
65
# define REAL_PLUS_32767       ( 32767 << REAL_RADIX )
 
66
# define REAL_MINUS_32768      ( -32768 << REAL_RADIX )
 
67
 
 
68
# define DOUBLE_TO_REAL(x)     ((int)((x) * REAL_FACTOR))
 
69
# define REAL_TO_SHORT(x)      ((x) >> REAL_RADIX)
 
70
# define REAL_MUL(x, y)                (((long long)(x) * (long long)(y)) >> REAL_RADIX)
 
71
 
59
72
#else
60
73
#  define real double
61
74
#endif
62
75
 
 
76
#ifndef DOUBLE_TO_REAL
 
77
# define DOUBLE_TO_REAL(x)     (x)
 
78
#endif
 
79
#ifndef REAL_TO_SHORT
 
80
# define REAL_TO_SHORT(x)      (x)
 
81
#endif
 
82
#ifndef REAL_PLUS_32767
 
83
# define REAL_PLUS_32767       32767.0
 
84
#endif
 
85
#ifndef REAL_MINUS_32768
 
86
# define REAL_MINUS_32768      -32768.0
 
87
#endif
 
88
#ifndef REAL_MUL
 
89
# define REAL_MUL(x, y)                ((x) * (y))
 
90
#endif
 
91
 
63
92
#ifdef __GNUC__
64
93
#define INLINE inline
65
94
#else
100
129
    struct al_table *alloc;
101
130
    int (*synth)(real *,int,unsigned char *,int *);
102
131
    int (*synth_mono)(real *,unsigned char *,int *);
 
132
#ifdef USE_3DNOW
 
133
    void (*dct36)(real *,real *,real *,real *,real *);
 
134
#endif
103
135
    int stereo;
104
136
    int jsbound;
105
137
    int single;
130
162
  int remote;   /* remote operation */
131
163
  int outmode;  /* where to out the decoded sampels */
132
164
  int quiet;    /* shut up! */
 
165
  int xterm_title;      /* Change xterm title to song names? */
133
166
  long usebuffer;       /* second level buffer size */
134
167
  int tryresync;  /* resync stream after error */
135
168
  int verbose;    /* verbose level */
145
178
  long doublespeed;
146
179
  long halfspeed;
147
180
  int force_reopen;
 
181
#ifdef USE_3DNOW
 
182
  int stat_3dnow; /* automatic/force/force-off 3DNow! optimized code */
 
183
  int test_3dnow;
 
184
#endif
148
185
  long realtime;
149
186
  char filename[256];
150
187
};
255
292
  } ch[2];
256
293
};
257
294
 
258
 
extern void open_stream(char *,int fd);
 
295
extern int open_stream(char *,int fd);
259
296
extern void read_frame_init (void);
260
297
extern int read_frame(struct frame *fr);
261
298
extern void play_frame(int init,struct frame *fr);
267
304
#ifdef PENTIUM_OPT
268
305
extern int synth_1to1_pent (real *,int,unsigned char *);
269
306
#endif
270
 
#ifdef USE_3DNOW
271
 
extern int synth_1to1_3dnow (real *,int,unsigned char *);
272
 
#endif
273
307
extern int synth_1to1 (real *,int,unsigned char *,int *);
274
308
extern int synth_1to1_8bit (real *,int,unsigned char *,int *);
275
309
extern int synth_1to1_mono (real *,unsigned char *,int *);
335
369
extern unsigned char *conv16to8;
336
370
extern long freqs[9];
337
371
extern real muls[27][64];
338
 
#ifdef USE_3DNOW
339
 
extern real decwin[2*(512+32)];
340
 
#else
341
372
extern real decwin[512+32];
342
 
#endif
343
373
extern real *pnts[5];
344
374
 
345
375
extern real equalizer[2][32];
355
385
extern void dct64_486(int *a,int *b,real *c);
356
386
extern int synth_1to1_486(real *bandPtr,int channel,unsigned char *out,int nb_blocks);
357
387
 
358
 
 
359
 
 
 
388
/* 3DNow! optimizations */
 
389
#ifdef USE_3DNOW
 
390
extern int getcpuflags(void);
 
391
extern void dct36(real *,real *,real *,real *,real *);
 
392
extern void dct36_3dnow(real *,real *,real *,real *,real *);
 
393
extern int synth_1to1_3dnow(real *,int,unsigned char *,int *);
 
394
#endif