~ubuntu-branches/ubuntu/raring/mumble/raring

« back to all changes in this revision

Viewing changes to celt-0.7.0-src/libcelt/mathops.h

  • Committer: Bazaar Package Importer
  • Author(s): Thorvald Natvig
  • Date: 2010-01-09 19:28:50 UTC
  • mfrom: (9.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109192850-zs4g5vwrrpd71kob
Tags: 1.2.1-2
Fix upgrade failure when upgrading mumble-server directly from 1.1.x
to 1.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
   Redistribution and use in source and binary forms, with or without
11
11
   modification, are permitted provided that the following conditions
12
12
   are met:
13
 
 
 
13
   
14
14
   - Redistributions of source code must retain the above copyright
15
15
   notice, this list of conditions and the following disclaimer.
16
 
 
 
16
   
17
17
   - Redistributions in binary form must reproduce the above copyright
18
18
   notice, this list of conditions and the following disclaimer in the
19
19
   documentation and/or other materials provided with the distribution.
20
 
 
 
20
   
21
21
   - Neither the name of the Xiph.org Foundation nor the names of its
22
22
   contributors may be used to endorse or promote products derived from
23
23
   this software without specific prior written permission.
24
 
 
 
24
   
25
25
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
26
   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
27
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
237
237
   k = (celt_ilog2(x)>>1)-7;
238
238
   x = VSHR32(x, (k<<1));
239
239
   n = x-32768;
240
 
   rt = ADD16(C[0], MULT16_16_Q15(n, ADD16(C[1], MULT16_16_Q15(n, ADD16(C[2],
 
240
   rt = ADD16(C[0], MULT16_16_Q15(n, ADD16(C[1], MULT16_16_Q15(n, ADD16(C[2], 
241
241
              MULT16_16_Q15(n, ADD16(C[3], MULT16_16_Q15(n, (C[4])))))))));
242
242
   rt = VSHR32(rt,7-k);
243
243
   return rt;
254
254
   k = (celt_ilog2(x)>>1)-7;
255
255
   x = VSHR32(x, (k<<1));
256
256
   n = x-32768;
257
 
   rt = ADD16(C[0], MULT16_16_Q15(n, ADD16(C[1], MULT16_16_Q15(n, ADD16(C[2],
 
257
   rt = ADD16(C[0], MULT16_16_Q15(n, ADD16(C[1], MULT16_16_Q15(n, ADD16(C[2], 
258
258
              MULT16_16_Q15(n, ADD16(C[3], MULT16_16_Q15(n, (C[4])))))))));
259
259
   rt = VSHR32(rt,7-k);
260
260
   return rt;
268
268
static inline celt_word16 _celt_cos_pi_2(celt_word16 x)
269
269
{
270
270
   celt_word16 x2;
271
 
 
 
271
   
272
272
   x2 = MULT16_16_P15(x,x);
273
273
   return ADD16(1,MIN16(32766,ADD32(SUB16(L1,x2), MULT16_16_P15(x2, ADD32(L2, MULT16_16_P15(x2, ADD32(L3, MULT16_16_P15(L4, x2
274
274
                                                                                ))))))));