~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_libMad/fixed.h

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2007-12-18 13:53:04 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071218135304-cdqec2lg2bglyz15
Tags: 1:2.4~preview3-0.0ubuntu1
* Upload to Ubuntu. (LP: #163287, LP: #126572)
* debian/changelog: re-added Ubuntu releases.
* debian/control:
  - Require debhelper >= 5.0.51 (for dh_icons) and imagemagick.
  - Build-depend on libsdl1.2-dev instead of libsdl-dev.
  - Build against newer libx264-dev. (LP: #138854)
  - Removed libamrnb-dev, not in Ubuntu yet.
* debian/rules:
  - Install all icon sizes, using convert (upstream installs none).
  - Added missing calls to dh_installmenu, dh_installman, dh_icons and
    dh_desktop.
* debian/menu, debian/avidemux-qt.menu:
  - Corrected package and executable names.
* debian/avidemux-common.install: Install icons.
* debian/avidemux.common.manpages: Install man/avidemux.1.
* debian/links, debian/avidemux-cli.links, debian/avidemux-gtk.links:
  - Link manpages to avidemux.1.gz.
* debian/install, debian/avidemux-qt.install, debian/avidemux-gtk.desktop,
  debian/avidemux-qt.desktop: Install desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * libmad - MPEG audio decoder library
3
 
 * Copyright (C) 2000-2004 Underbit Technologies, Inc.
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 *
19
 
 * $Id: fixed.h,v 1.38 2004/02/17 02:02:03 rob Exp $
20
 
 */
21
 
 
22
 
# ifndef LIBMAD_FIXED_H
23
 
# define LIBMAD_FIXED_H
24
 
#include "../ADM_library/default.h"
25
 
#define mad_fixed_t     int32_t
26
 
#define mad_fixed64hi_t int32_t
27
 
#define mad_fixed64lo_t uint32_t
28
 
// MEANX
29
 
#if 0
30
 
# if SIZEOF_INT >= 4
31
 
typedef   signed int mad_fixed_t;
32
 
 
33
 
typedef   signed int mad_fixed64hi_t;
34
 
typedef unsigned int mad_fixed64lo_t;
35
 
# else
36
 
typedef   signed long mad_fixed_t;
37
 
 
38
 
typedef   signed long mad_fixed64hi_t;
39
 
typedef unsigned long mad_fixed64lo_t;
40
 
# endif
41
 
#endif
42
 
// /MEANX
43
 
# if defined(_MSC_VER)
44
 
#  define mad_fixed64_t  signed __int64
45
 
# elif 1 || defined(__GNUC__)
46
 
#  define mad_fixed64_t  signed long long
47
 
# endif
48
 
 
49
 
# if defined(FPM_FLOAT)
50
 
typedef double mad_sample_t;
51
 
# else
52
 
typedef mad_fixed_t mad_sample_t;
53
 
# endif
54
 
 
55
 
/*
56
 
 * Fixed-point format: 0xABBBBBBB
57
 
 * A == whole part      (sign + 3 bits)
58
 
 * B == fractional part (28 bits)
59
 
 *
60
 
 * Values are signed two's complement, so the effective range is:
61
 
 * 0x80000000 to 0x7fffffff
62
 
 *       -8.0 to +7.9999999962747097015380859375
63
 
 *
64
 
 * The smallest representable value is:
65
 
 * 0x00000001 == 0.0000000037252902984619140625 (i.e. about 3.725e-9)
66
 
 *
67
 
 * 28 bits of fractional accuracy represent about
68
 
 * 8.6 digits of decimal accuracy.
69
 
 *
70
 
 * Fixed-point numbers can be added or subtracted as normal
71
 
 * integers, but multiplication requires shifting the 64-bit result
72
 
 * from 56 fractional bits back to 28 (and rounding.)
73
 
 *
74
 
 * Changing the definition of MAD_F_FRACBITS is only partially
75
 
 * supported, and must be done with care.
76
 
 */
77
 
 
78
 
# define MAD_F_FRACBITS         28
79
 
 
80
 
# if MAD_F_FRACBITS == 28
81
 
#  define MAD_F(x)              ((mad_fixed_t) (x##L))
82
 
# else
83
 
#  if MAD_F_FRACBITS < 28
84
 
#   warning "MAD_F_FRACBITS < 28"
85
 
#   define MAD_F(x)             ((mad_fixed_t)  \
86
 
                                 (((x##L) +  \
87
 
                                   (1L << (28 - MAD_F_FRACBITS - 1))) >>  \
88
 
                                  (28 - MAD_F_FRACBITS)))
89
 
#  elif MAD_F_FRACBITS > 28
90
 
#   error "MAD_F_FRACBITS > 28 not currently supported"
91
 
#   define MAD_F(x)             ((mad_fixed_t)  \
92
 
                                 ((x##L) << (MAD_F_FRACBITS - 28)))
93
 
#  endif
94
 
# endif
95
 
 
96
 
# define MAD_F_MIN              ((mad_fixed_t) -0x80000000L)
97
 
# define MAD_F_MAX              ((mad_fixed_t) +0x7fffffffL)
98
 
 
99
 
# define MAD_F_ONE              MAD_F(0x10000000)
100
 
 
101
 
# define mad_f_tofixed(x)       ((mad_fixed_t)  \
102
 
                                 ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))
103
 
# define mad_f_todouble(x)      ((double)  \
104
 
                                 ((x) / (double) (1L << MAD_F_FRACBITS)))
105
 
 
106
 
# define mad_f_intpart(x)       ((x) >> MAD_F_FRACBITS)
107
 
# define mad_f_fracpart(x)      ((x) & ((1L << MAD_F_FRACBITS) - 1))
108
 
                                /* (x should be positive) */
109
 
 
110
 
# define mad_f_fromint(x)       ((x) << MAD_F_FRACBITS)
111
 
 
112
 
# define mad_f_add(x, y)        ((x) + (y))
113
 
# define mad_f_sub(x, y)        ((x) - (y))
114
 
 
115
 
# if defined(FPM_FLOAT)
116
 
#  error "FPM_FLOAT not yet supported"
117
 
 
118
 
#  undef MAD_F
119
 
#  define MAD_F(x)              mad_f_todouble(x)
120
 
 
121
 
#  define mad_f_mul(x, y)       ((x) * (y))
122
 
#  define mad_f_scale64
123
 
 
124
 
#  undef ASO_ZEROCHECK
125
 
 
126
 
# elif defined(FPM_64BIT)
127
 
 
128
 
/*
129
 
 * This version should be the most accurate if 64-bit types are supported by
130
 
 * the compiler, although it may not be the most efficient.
131
 
 */
132
 
#  if defined(OPT_ACCURACY)
133
 
#   define mad_f_mul(x, y)  \
134
 
    ((mad_fixed_t)  \
135
 
     ((((mad_fixed64_t) (x) * (y)) +  \
136
 
       (1L << (MAD_F_SCALEBITS - 1))) >> MAD_F_SCALEBITS))
137
 
#  else
138
 
#   define mad_f_mul(x, y)  \
139
 
    ((mad_fixed_t) (((mad_fixed64_t) (x) * (y)) >> MAD_F_SCALEBITS))
140
 
#  endif
141
 
 
142
 
#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
143
 
 
144
 
/* --- Intel --------------------------------------------------------------- */
145
 
 
146
 
# elif defined(FPM_INTEL)
147
 
 
148
 
#  if defined(_MSC_VER)
149
 
#   pragma warning(push)
150
 
#   pragma warning(disable: 4035)  /* no return value */
151
 
static __forceinline
152
 
mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
153
 
{
154
 
  enum {
155
 
    fracbits = MAD_F_FRACBITS
156
 
  };
157
 
 
158
 
  __asm {
159
 
    mov eax, x
160
 
    imul y
161
 
    shrd eax, edx, fracbits
162
 
  }
163
 
 
164
 
  /* implicit return of eax */
165
 
}
166
 
#   pragma warning(pop)
167
 
 
168
 
#   define mad_f_mul            mad_f_mul_inline
169
 
#   define mad_f_scale64
170
 
#  else
171
 
/*
172
 
 * This Intel version is fast and accurate; the disposition of the least
173
 
 * significant bit depends on OPT_ACCURACY via mad_f_scale64().
174
 
 */
175
 
#   define MAD_F_MLX(hi, lo, x, y)  \
176
 
    asm ("imull %3"  \
177
 
         : "=a" (lo), "=d" (hi)  \
178
 
         : "%a" (x), "rm" (y)  \
179
 
         : "cc")
180
 
 
181
 
#   if defined(OPT_ACCURACY)
182
 
/*
183
 
 * This gives best accuracy but is not very fast.
184
 
 */
185
 
#    define MAD_F_MLA(hi, lo, x, y)  \
186
 
    ({ mad_fixed64hi_t __hi;  \
187
 
       mad_fixed64lo_t __lo;  \
188
 
       MAD_F_MLX(__hi, __lo, (x), (y));  \
189
 
       asm ("addl %2,%0\n\t"  \
190
 
            "adcl %3,%1"  \
191
 
            : "=rm" (lo), "=rm" (hi)  \
192
 
            : "r" (__lo), "r" (__hi), "0" (lo), "1" (hi)  \
193
 
            : "cc");  \
194
 
    })
195
 
#   endif  /* OPT_ACCURACY */
196
 
 
197
 
#   if defined(OPT_ACCURACY)
198
 
/*
199
 
 * Surprisingly, this is faster than SHRD followed by ADC.
200
 
 */
201
 
#    define mad_f_scale64(hi, lo)  \
202
 
    ({ mad_fixed64hi_t __hi_;  \
203
 
       mad_fixed64lo_t __lo_;  \
204
 
       mad_fixed_t __result;  \
205
 
       asm ("addl %4,%2\n\t"  \
206
 
            "adcl %5,%3"  \
207
 
            : "=rm" (__lo_), "=rm" (__hi_)  \
208
 
            : "0" (lo), "1" (hi),  \
209
 
              "ir" (1L << (MAD_F_SCALEBITS - 1)), "ir" (0)  \
210
 
            : "cc");  \
211
 
       asm ("shrdl %3,%2,%1"  \
212
 
            : "=rm" (__result)  \
213
 
            : "0" (__lo_), "r" (__hi_), "I" (MAD_F_SCALEBITS)  \
214
 
            : "cc");  \
215
 
       __result;  \
216
 
    })
217
 
#   elif defined(OPT_INTEL)
218
 
/*
219
 
 * Alternate Intel scaling that may or may not perform better.
220
 
 */
221
 
#    define mad_f_scale64(hi, lo)  \
222
 
    ({ mad_fixed_t __result;  \
223
 
       asm ("shrl %3,%1\n\t"  \
224
 
            "shll %4,%2\n\t"  \
225
 
            "orl %2,%1"  \
226
 
            : "=rm" (__result)  \
227
 
            : "0" (lo), "r" (hi),  \
228
 
              "I" (MAD_F_SCALEBITS), "I" (32 - MAD_F_SCALEBITS)  \
229
 
            : "cc");  \
230
 
       __result;  \
231
 
    })
232
 
#   else
233
 
#    define mad_f_scale64(hi, lo)  \
234
 
    ({ mad_fixed_t __result;  \
235
 
       asm ("shrdl %3,%2,%1"  \
236
 
            : "=rm" (__result)  \
237
 
            : "0" (lo), "r" (hi), "I" (MAD_F_SCALEBITS)  \
238
 
            : "cc");  \
239
 
       __result;  \
240
 
    })
241
 
#   endif  /* OPT_ACCURACY */
242
 
 
243
 
#   define MAD_F_SCALEBITS  MAD_F_FRACBITS
244
 
#  endif
245
 
 
246
 
/* --- ARM ----------------------------------------------------------------- */
247
 
 
248
 
# elif defined(FPM_ARM)
249
 
 
250
 
/* 
251
 
 * This ARM V4 version is as accurate as FPM_64BIT but much faster. The
252
 
 * least significant bit is properly rounded at no CPU cycle cost!
253
 
 */
254
 
# if 1
255
 
/*
256
 
 * This is faster than the default implementation via MAD_F_MLX() and
257
 
 * mad_f_scale64().
258
 
 */
259
 
#  define mad_f_mul(x, y)  \
260
 
    ({ mad_fixed64hi_t __hi;  \
261
 
       mad_fixed64lo_t __lo;  \
262
 
       mad_fixed_t __result;  \
263
 
       asm ("smull      %0, %1, %3, %4\n\t"  \
264
 
            "movs       %0, %0, lsr %5\n\t"  \
265
 
            "adc        %2, %0, %1, lsl %6"  \
266
 
            : "=&r" (__lo), "=&r" (__hi), "=r" (__result)  \
267
 
            : "%r" (x), "r" (y),  \
268
 
              "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS)  \
269
 
            : "cc");  \
270
 
       __result;  \
271
 
    })
272
 
# endif
273
 
 
274
 
#  define MAD_F_MLX(hi, lo, x, y)  \
275
 
    asm ("smull %0, %1, %2, %3"  \
276
 
         : "=&r" (lo), "=&r" (hi)  \
277
 
         : "%r" (x), "r" (y))
278
 
 
279
 
#  define MAD_F_MLA(hi, lo, x, y)  \
280
 
    asm ("smlal %0, %1, %2, %3"  \
281
 
         : "+r" (lo), "+r" (hi)  \
282
 
         : "%r" (x), "r" (y))
283
 
 
284
 
#  define MAD_F_MLN(hi, lo)  \
285
 
    asm ("rsbs  %0, %2, #0\n\t"  \
286
 
         "rsc   %1, %3, #0"  \
287
 
         : "=r" (lo), "=r" (hi)  \
288
 
         : "0" (lo), "1" (hi)  \
289
 
         : "cc")
290
 
 
291
 
#  define mad_f_scale64(hi, lo)  \
292
 
    ({ mad_fixed_t __result;  \
293
 
       asm ("movs       %0, %1, lsr %3\n\t"  \
294
 
            "adc        %0, %0, %2, lsl %4"  \
295
 
            : "=&r" (__result)  \
296
 
            : "r" (lo), "r" (hi),  \
297
 
              "M" (MAD_F_SCALEBITS), "M" (32 - MAD_F_SCALEBITS)  \
298
 
            : "cc");  \
299
 
       __result;  \
300
 
    })
301
 
 
302
 
#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
303
 
 
304
 
/* --- MIPS ---------------------------------------------------------------- */
305
 
 
306
 
# elif defined(FPM_MIPS)
307
 
 
308
 
/*
309
 
 * This MIPS version is fast and accurate; the disposition of the least
310
 
 * significant bit depends on OPT_ACCURACY via mad_f_scale64().
311
 
 */
312
 
#  define MAD_F_MLX(hi, lo, x, y)  \
313
 
    asm ("mult  %2,%3"  \
314
 
         : "=l" (lo), "=h" (hi)  \
315
 
         : "%r" (x), "r" (y))
316
 
 
317
 
# if defined(HAVE_MADD_ASM)
318
 
#  define MAD_F_MLA(hi, lo, x, y)  \
319
 
    asm ("madd  %2,%3"  \
320
 
         : "+l" (lo), "+h" (hi)  \
321
 
         : "%r" (x), "r" (y))
322
 
# elif defined(HAVE_MADD16_ASM)
323
 
/*
324
 
 * This loses significant accuracy due to the 16-bit integer limit in the
325
 
 * multiply/accumulate instruction.
326
 
 */
327
 
#  define MAD_F_ML0(hi, lo, x, y)  \
328
 
    asm ("mult  %2,%3"  \
329
 
         : "=l" (lo), "=h" (hi)  \
330
 
         : "%r" ((x) >> 12), "r" ((y) >> 16))
331
 
#  define MAD_F_MLA(hi, lo, x, y)  \
332
 
    asm ("madd16        %2,%3"  \
333
 
         : "+l" (lo), "+h" (hi)  \
334
 
         : "%r" ((x) >> 12), "r" ((y) >> 16))
335
 
#  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
336
 
# endif
337
 
 
338
 
# if defined(OPT_SPEED)
339
 
#  define mad_f_scale64(hi, lo)  \
340
 
    ((mad_fixed_t) ((hi) << (32 - MAD_F_SCALEBITS)))
341
 
#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
342
 
# endif
343
 
 
344
 
/* --- SPARC --------------------------------------------------------------- */
345
 
 
346
 
# elif defined(FPM_SPARC)
347
 
 
348
 
/*
349
 
 * This SPARC V8 version is fast and accurate; the disposition of the least
350
 
 * significant bit depends on OPT_ACCURACY via mad_f_scale64().
351
 
 */
352
 
#  define MAD_F_MLX(hi, lo, x, y)  \
353
 
    asm ("smul %2, %3, %0\n\t"  \
354
 
         "rd %%y, %1"  \
355
 
         : "=r" (lo), "=r" (hi)  \
356
 
         : "%r" (x), "rI" (y))
357
 
 
358
 
/* --- PowerPC ------------------------------------------------------------- */
359
 
 
360
 
# elif defined(FPM_PPC)
361
 
 
362
 
/*
363
 
 * This PowerPC version is fast and accurate; the disposition of the least
364
 
 * significant bit depends on OPT_ACCURACY via mad_f_scale64().
365
 
 */
366
 
#  define MAD_F_MLX(hi, lo, x, y)  \
367
 
    do {  \
368
 
      asm ("mullw %0,%1,%2"  \
369
 
           : "=r" (lo)  \
370
 
           : "%r" (x), "r" (y));  \
371
 
      asm ("mulhw %0,%1,%2"  \
372
 
           : "=r" (hi)  \
373
 
           : "%r" (x), "r" (y));  \
374
 
    }  \
375
 
    while (0)
376
 
 
377
 
#  if defined(OPT_ACCURACY)
378
 
/*
379
 
 * This gives best accuracy but is not very fast.
380
 
 */
381
 
#   define MAD_F_MLA(hi, lo, x, y)  \
382
 
    ({ mad_fixed64hi_t __hi;  \
383
 
       mad_fixed64lo_t __lo;  \
384
 
       MAD_F_MLX(__hi, __lo, (x), (y));  \
385
 
       asm ("addc %0,%2,%3\n\t"  \
386
 
            "adde %1,%4,%5"  \
387
 
            : "=r" (lo), "=r" (hi)  \
388
 
            : "%r" (lo), "r" (__lo),  \
389
 
              "%r" (hi), "r" (__hi)  \
390
 
            : "xer");  \
391
 
    })
392
 
#  endif
393
 
 
394
 
#  if defined(OPT_ACCURACY)
395
 
/*
396
 
 * This is slower than the truncating version below it.
397
 
 */
398
 
#   define mad_f_scale64(hi, lo)  \
399
 
    ({ mad_fixed_t __result, __round;  \
400
 
       asm ("rotrwi %0,%1,%2"  \
401
 
            : "=r" (__result)  \
402
 
            : "r" (lo), "i" (MAD_F_SCALEBITS));  \
403
 
       asm ("extrwi %0,%1,1,0"  \
404
 
            : "=r" (__round)  \
405
 
            : "r" (__result));  \
406
 
       asm ("insrwi %0,%1,%2,0"  \
407
 
            : "+r" (__result)  \
408
 
            : "r" (hi), "i" (MAD_F_SCALEBITS));  \
409
 
       asm ("add %0,%1,%2"  \
410
 
            : "=r" (__result)  \
411
 
            : "%r" (__result), "r" (__round));  \
412
 
       __result;  \
413
 
    })
414
 
#  else
415
 
#   define mad_f_scale64(hi, lo)  \
416
 
    ({ mad_fixed_t __result;  \
417
 
       asm ("rotrwi %0,%1,%2"  \
418
 
            : "=r" (__result)  \
419
 
            : "r" (lo), "i" (MAD_F_SCALEBITS));  \
420
 
       asm ("insrwi %0,%1,%2,0"  \
421
 
            : "+r" (__result)  \
422
 
            : "r" (hi), "i" (MAD_F_SCALEBITS));  \
423
 
       __result;  \
424
 
    })
425
 
#  endif
426
 
 
427
 
#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
428
 
 
429
 
/* --- Default ------------------------------------------------------------- */
430
 
 
431
 
# elif defined(FPM_DEFAULT)
432
 
 
433
 
/*
434
 
 * This version is the most portable but it loses significant accuracy.
435
 
 * Furthermore, accuracy is biased against the second argument, so care
436
 
 * should be taken when ordering operands.
437
 
 *
438
 
 * The scale factors are constant as this is not used with SSO.
439
 
 *
440
 
 * Pre-rounding is required to stay within the limits of compliance.
441
 
 */
442
 
#  if defined(OPT_SPEED)
443
 
#   define mad_f_mul(x, y)      (((x) >> 12) * ((y) >> 16))
444
 
#  else
445
 
#   define mad_f_mul(x, y)      ((((x) + (1L << 11)) >> 12) *  \
446
 
                                 (((y) + (1L << 15)) >> 16))
447
 
#  endif
448
 
 
449
 
/* ------------------------------------------------------------------------- */
450
 
 
451
 
# else
452
 
#  error "no FPM selected"
453
 
# endif
454
 
 
455
 
/* default implementations */
456
 
 
457
 
# if !defined(mad_f_mul)
458
 
#  define mad_f_mul(x, y)  \
459
 
    ({ register mad_fixed64hi_t __hi;  \
460
 
       register mad_fixed64lo_t __lo;  \
461
 
       MAD_F_MLX(__hi, __lo, (x), (y));  \
462
 
       mad_f_scale64(__hi, __lo);  \
463
 
    })
464
 
# endif
465
 
 
466
 
# if !defined(MAD_F_MLA)
467
 
#  define MAD_F_ML0(hi, lo, x, y)       ((lo)  = mad_f_mul((x), (y)))
468
 
#  define MAD_F_MLA(hi, lo, x, y)       ((lo) += mad_f_mul((x), (y)))
469
 
#  define MAD_F_MLN(hi, lo)             ((lo)  = -(lo))
470
 
#  define MAD_F_MLZ(hi, lo)             ((void) (hi), (mad_fixed_t) (lo))
471
 
# endif
472
 
 
473
 
# if !defined(MAD_F_ML0)
474
 
#  define MAD_F_ML0(hi, lo, x, y)       MAD_F_MLX((hi), (lo), (x), (y))
475
 
# endif
476
 
 
477
 
# if !defined(MAD_F_MLN)
478
 
#  define MAD_F_MLN(hi, lo)             ((hi) = ((lo) = -(lo)) ? ~(hi) : -(hi))
479
 
# endif
480
 
 
481
 
# if !defined(MAD_F_MLZ)
482
 
#  define MAD_F_MLZ(hi, lo)             mad_f_scale64((hi), (lo))
483
 
# endif
484
 
 
485
 
# if !defined(mad_f_scale64)
486
 
#  if defined(OPT_ACCURACY)
487
 
#   define mad_f_scale64(hi, lo)  \
488
 
    ((((mad_fixed_t)  \
489
 
       (((hi) << (32 - (MAD_F_SCALEBITS - 1))) |  \
490
 
        ((lo) >> (MAD_F_SCALEBITS - 1)))) + 1) >> 1)
491
 
#  else
492
 
#   define mad_f_scale64(hi, lo)  \
493
 
    ((mad_fixed_t)  \
494
 
     (((hi) << (32 - MAD_F_SCALEBITS)) |  \
495
 
      ((lo) >> MAD_F_SCALEBITS)))
496
 
#  endif
497
 
#  define MAD_F_SCALEBITS  MAD_F_FRACBITS
498
 
# endif
499
 
 
500
 
/* C routines */
501
 
 
502
 
mad_fixed_t mad_f_abs(mad_fixed_t);
503
 
mad_fixed_t mad_f_div(mad_fixed_t, mad_fixed_t);
504
 
 
505
 
# endif