• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  ** Copyright 2003-2010, VisualOn, Inc.
3  **
4  ** Licensed under the Apache License, Version 2.0 (the "License");
5  ** you may not use this file except in compliance with the License.
6  ** You may obtain a copy of the License at
7  **
8  **     http://www.apache.org/licenses/LICENSE-2.0
9  **
10  ** Unless required by applicable law or agreed to in writing, software
11  ** distributed under the License is distributed on an "AS IS" BASIS,
12  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  ** See the License for the specific language governing permissions and
14  ** limitations under the License.
15  */
16 
17 
18 /*--------------------------------------------------------------------------*
19  *                         MATH_OP.H                                        *
20  *--------------------------------------------------------------------------*
21  *       Mathematical operations                        *
22  *--------------------------------------------------------------------------*/
23 
24 #ifndef __MATH_OP_H__
25 #define __MATH_OP_H__
26 
27 Word32 Isqrt(                              /* (o) Q31 : output value (range: 0<=val<1)         */
28         Word32 L_x                            /* (i) Q0  : input value  (range: 0<=val<=7fffffff) */
29         );
30 
31 void Isqrt_n(
32         Word32 * frac,                        /* (i/o) Q31: normalized value (1.0 < frac <= 0.5) */
33         Word16 * exp                          /* (i/o)    : exponent (value = frac x 2^exponent) */
34         );
35 
36 Word32 Pow2(                               /* (o) Q0  : result       (range: 0<=val<=0x7fffffff) */
37         Word16 exponant,                      /* (i) Q0  : Integer part.      (range: 0<=val<=30)   */
38         Word16 fraction                       /* (i) Q15 : Fractionnal part.  (range: 0.0<=val<1.0) */
39        );
40 
41 Word32 Dot_product12(                      /* (o) Q31: normalized result (1 < val <= -1) */
42         Word16 x[],                           /* (i) 12bits: x vector                       */
43         Word16 y[],                           /* (i) 12bits: y vector                       */
44         Word16 lg,                            /* (i)    : vector length                     */
45         Word16 * exp                          /* (o)    : exponent of result (0..+30)       */
46         );
47 
48 Word32 Dot_product12_asm(                      /* (o) Q31: normalized result (1 < val <= -1) */
49         Word16 x[],                           /* (i) 12bits: x vector                       */
50         Word16 y[],                           /* (i) 12bits: y vector                       */
51         Word16 lg,                            /* (i)    : vector length                     */
52         Word16 * exp                          /* (o)    : exponent of result (0..+30)       */
53         );
54 #endif //__MATH_OP_H__
55 
56