Home | History | Annotate | Download | only in src
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      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
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /****************************************************************************************
     19 Portions of this file are derived from the following 3GPP standard:
     20 
     21     3GPP TS 26.073
     22     ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
     23     Available from http://www.3gpp.org
     24 
     25 (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
     26 Permission to distribute, modify and use this file under the standard license
     27 terms listed above has been obtained from the copyright holder.
     28 ****************************************************************************************/
     29 /*
     30 
     31  Filename: /audio/gsm_amr/c/src/sqrt_l_tbl.c
     32 
     33 ------------------------------------------------------------------------------
     34  REVISION HISTORY
     35 
     36  Description: Changed the table name to sqrt_l_tbl.
     37 
     38  Description: Added #ifdef __cplusplus and removed "extern" from table
     39               definition.
     40 
     41  Description: Put "extern" back.
     42 
     43  Who:                           Date:
     44  Description:
     45 
     46 ------------------------------------------------------------------------------
     47  MODULE DESCRIPTION
     48 
     49  This file contains the declaration for sqrt_l_table[] used by the sqrt_l_exp
     50  function.
     51 
     52     sqrt_l_tbl[i] = sqrt((i+16)*2^-6) * 2^15, i.e. sqrt(x) scaled Q15
     53 
     54  ------------------------------------------------------------------------------
     55 */
     56 
     57 /*----------------------------------------------------------------------------
     58 ; INCLUDES
     59 ----------------------------------------------------------------------------*/
     60 #include "typedef.h"
     61 #include "sqrt_l.h"
     62 
     63 /*--------------------------------------------------------------------------*/
     64 #ifdef __cplusplus
     65 extern "C"
     66 {
     67 #endif
     68 
     69     /*----------------------------------------------------------------------------
     70     ; MACROS
     71     ; [Define module specific macros here]
     72     ----------------------------------------------------------------------------*/
     73 
     74     /*----------------------------------------------------------------------------
     75     ; DEFINES
     76     ; [Include all pre-processor statements here. Include conditional
     77     ; compile variables also.]
     78     ----------------------------------------------------------------------------*/
     79 
     80     /*----------------------------------------------------------------------------
     81     ; LOCAL FUNCTION DEFINITIONS
     82     ; [List function prototypes here]
     83     ----------------------------------------------------------------------------*/
     84 
     85     /*----------------------------------------------------------------------------
     86     ; LOCAL VARIABLE DEFINITIONS
     87     ; [Variable declaration - defined here and used outside this module]
     88     ----------------------------------------------------------------------------*/
     89     const Word16 sqrt_l_tbl[50] =
     90     {
     91         16384, 16888, 17378, 17854, 18318, 18770, 19212, 19644, 20066, 20480,
     92         20886, 21283, 21674, 22058, 22435, 22806, 23170, 23530, 23884, 24232,
     93         24576, 24915, 25249, 25580, 25905, 26227, 26545, 26859, 27170, 27477,
     94         27780, 28081, 28378, 28672, 28963, 29251, 29537, 29819, 30099, 30377,
     95         30652, 30924, 31194, 31462, 31727, 31991, 32252, 32511, 32767, 32767
     96     };
     97 
     98 
     99     /*--------------------------------------------------------------------------*/
    100 #ifdef __cplusplus
    101 }
    102 #endif
    103 
    104 /*
    105 ------------------------------------------------------------------------------
    106  FUNCTION NAME:
    107 ------------------------------------------------------------------------------
    108  INPUT AND OUTPUT DEFINITIONS
    109 
    110  Inputs:
    111     None
    112 
    113  Outputs:
    114     None
    115 
    116  Returns:
    117     None
    118 
    119  Global Variables Used:
    120     None
    121 
    122  Local Variables Needed:
    123     None
    124 
    125 ------------------------------------------------------------------------------
    126  FUNCTION DESCRIPTION
    127 
    128  None
    129 
    130 ------------------------------------------------------------------------------
    131  REQUIREMENTS
    132 
    133  None
    134 
    135 ------------------------------------------------------------------------------
    136  REFERENCES
    137 
    138  [1] inv_sqrt.tab file,  UMTS GSM AMR speech codec, R99 - Version 3.2.0,
    139  March 2, 2001
    140 
    141 ------------------------------------------------------------------------------
    142  PSEUDO-CODE
    143 
    144 
    145 ------------------------------------------------------------------------------
    146  RESOURCES USED [optional]
    147 
    148  When the code is written for a specific target processor the
    149  the resources used should be documented below.
    150 
    151  HEAP MEMORY USED: x bytes
    152 
    153  STACK MEMORY USED: x bytes
    154 
    155  CLOCK CYCLES: (cycle count equation for this function) + (variable
    156                 used to represent cycle count for each subroutine
    157                 called)
    158      where: (cycle count variable) = cycle count for [subroutine
    159                                      name]
    160 
    161 ------------------------------------------------------------------------------
    162  CAUTION [optional]
    163  [State any special notes, constraints or cautions for users of this function]
    164 
    165 ------------------------------------------------------------------------------
    166 */
    167 
    168 /*----------------------------------------------------------------------------
    169 ; FUNCTION CODE
    170 ----------------------------------------------------------------------------*/
    171 
    172