1 2 /* 3 ** Copyright 2003-2010, VisualOn, Inc. 4 ** 5 ** Licensed under the Apache License, Version 2.0 (the "License"); 6 ** you may not use this file except in compliance with the License. 7 ** You may obtain a copy of the License at 8 ** 9 ** http://www.apache.org/licenses/LICENSE-2.0 10 ** 11 ** Unless required by applicable law or agreed to in writing, software 12 ** distributed under the License is distributed on an "AS IS" BASIS, 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ** See the License for the specific language governing permissions and 15 ** limitations under the License. 16 */ 17 18 19 /******************************************************************************** 20 * 21 * File : log2.h 22 * Purpose : Computes log2(L_x) 23 * 24 ******************************************************************************** 25 */ 26 #ifndef __LOG2_H__ 27 #define __LOG2_H__ 28 29 /* 30 ******************************************************************************** 31 * INCLUDE FILES 32 ******************************************************************************** 33 */ 34 #include "typedef.h" 35 36 /* 37 ******************************************************************************** 38 * DEFINITION OF DATA TYPES 39 ******************************************************************************** 40 */ 41 42 /* 43 ******************************************************************************** 44 * DECLARATION OF PROTOTYPES 45 ******************************************************************************** 46 */ 47 void Log2 ( 48 Word32 L_x, /* (i) : input value */ 49 Word16 *exponent, /* (o) : Integer part of Log2. (range: 0<=val<=30) */ 50 Word16 *fraction /* (o) : Fractional part of Log2. (range: 0<=val<1)*/ 51 ); 52 53 void Log2_norm ( 54 Word32 L_x, /* (i) : input value (normalized) */ 55 Word16 exp, /* (i) : norm_l (L_x) */ 56 Word16 *exponent, /* (o) : Integer part of Log2. (range: 0<=val<=30) */ 57 Word16 *fraction /* (o) : Fractional part of Log2. (range: 0<=val<1) */ 58 ); 59 60 #endif //__LOG2_H__ 61 62 63