OSDN Git Service

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