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 
     32 
     33  Pathname: .audio/gsm-amr/c/src/dec_input_format_tab.c
     34 
     35      Date: 03/01/2002
     36 
     37 ------------------------------------------------------------------------------
     38  REVISION HISTORY
     39 
     40  Description: Renamed BytesThisFrame to WmfBytesPerFrame, changed its type
     41               from 'const short' to 'const int'. Added If2BytesPerFrame
     42               table for IF2 input format. Updated copyright year and I/O
     43               definition sections, and added reference document for IF2.
     44 
     45  Description: Renamed WmfBytesPerFrame to WmfDecBytesPerFrame, and
     46               If2BytesPerFrame to If2DecBytesPerFrame.
     47 
     48  Description: Added #ifdef __cplusplus and removed "extern" from table
     49               definition.
     50 
     51  Description: Put "extern" back.
     52 
     53  Description:
     54 
     55 ------------------------------------------------------------------------------
     56  INPUT AND OUTPUT DEFINITIONS
     57 
     58  Inputs:
     59     None
     60 
     61  Outputs:
     62     None
     63 
     64  Returns:
     65     None
     66 
     67  Global Variables Used:
     68     None
     69 
     70  Local Variables Needed:
     71     None
     72 
     73 ------------------------------------------------------------------------------
     74  FUNCTION DESCRIPTION
     75 
     76  This file contains the tables of the number of data bytes per codec mode in
     77  both WMF and IF2 input formats.
     78 
     79 ------------------------------------------------------------------------------
     80  REQUIREMENTS
     81 
     82  None
     83 
     84 ------------------------------------------------------------------------------
     85  REFERENCES
     86 
     87  [1] AMR Speech Codec Frame Structure, 3GPP TS 26.101 version 4.1.0 Release 4,
     88      June 2001
     89 
     90 ------------------------------------------------------------------------------
     91  PSEUDO-CODE
     92 
     93 
     94 ------------------------------------------------------------------------------
     95  RESOURCES USED
     96    When the code is written for a specific target processor the
     97      the resources used should be documented below.
     98 
     99  STACK USAGE: [stack count for this module] + [variable to represent
    100           stack usage for each subroutine called]
    101 
    102      where: [stack usage variable] = stack usage for [subroutine
    103          name] (see [filename].ext)
    104 
    105  DATA MEMORY USED: x words
    106 
    107  PROGRAM MEMORY USED: x words
    108 
    109  CLOCK CYCLES: [cycle count equation for this module] + [variable
    110            used to represent cycle count for each subroutine
    111            called]
    112 
    113      where: [cycle count variable] = cycle count for [subroutine
    114         name] (see [filename].ext)
    115 
    116 ------------------------------------------------------------------------------
    117 */
    118 
    119 
    120 /*----------------------------------------------------------------------------
    121 ; INCLUDES
    122 ----------------------------------------------------------------------------*/
    123 #include "typedef.h"
    124 #include "amrdecode.h"
    125 
    126 /*--------------------------------------------------------------------------*/
    127 #ifdef __cplusplus
    128 extern "C"
    129 {
    130 #endif
    131 
    132     /*----------------------------------------------------------------------------
    133     ; MACROS
    134     ; Define module specific macros here
    135     ----------------------------------------------------------------------------*/
    136 
    137 
    138     /*----------------------------------------------------------------------------
    139     ; DEFINES
    140     ; Include all pre-processor statements here. Include conditional
    141     ; compile variables also.
    142     ----------------------------------------------------------------------------*/
    143 
    144     /*----------------------------------------------------------------------------
    145     ; LOCAL FUNCTION DEFINITIONS
    146     ; Function Prototype declaration
    147     ----------------------------------------------------------------------------*/
    148 
    149 
    150     /*----------------------------------------------------------------------------
    151     ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
    152     ; Variable declaration - defined here and used outside this module
    153     ----------------------------------------------------------------------------*/
    154     /* Table containing the number of core AMR data bytes for                */
    155     /* each codec mode for WMF input format(number excludes frame type byte) */
    156     const Word16 WmfDecBytesPerFrame[16] =
    157     {
    158         12, /* 4.75 */
    159         13, /* 5.15 */
    160         15, /* 5.90 */
    161         17, /* 6.70 */
    162         19, /* 7.40 */
    163         20, /* 7.95 */
    164         26, /* 10.2 */
    165         31, /* 12.2 */
    166         5, /* GsmAmr comfort noise */
    167         6, /* Gsm-Efr comfort noise */
    168         5, /* IS-641 comfort noise */
    169         5, /* Pdc-Efr comfort noise */
    170         0, /* future use */
    171         0, /* future use */
    172         0, /* future use */
    173         0 /* No transmission */
    174     };
    175 
    176     /* Table containing the number of core AMR data bytes for   */
    177     /* each codec mode for IF2 input format.                    */
    178     const Word16 If2DecBytesPerFrame[16] =
    179     {
    180         13, /* 4.75 */
    181         14, /* 5.15 */
    182         16, /* 5.90 */
    183         18, /* 6.70 */
    184         19, /* 7.40 */
    185         21, /* 7.95 */
    186         26, /* 10.2 */
    187         31, /* 12.2 */
    188         6, /* GsmAmr comfort noise */
    189         6, /* Gsm-Efr comfort noise */
    190         6, /* IS-641 comfort noise */
    191         6, /* Pdc-Efr comfort noise */
    192         0, /* future use */
    193         0, /* future use */
    194         0, /* future use */
    195         1 /* No transmission */
    196     };
    197 
    198     /*----------------------------------------------------------------------------
    199     ; EXTERNAL FUNCTION REFERENCES
    200     ; Declare functions defined elsewhere and referenced in this module
    201     ----------------------------------------------------------------------------*/
    202 
    203 
    204     /*----------------------------------------------------------------------------
    205     ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
    206     ; Declare variables used in this module but defined elsewhere
    207     ----------------------------------------------------------------------------*/
    208 
    209 
    210     /*--------------------------------------------------------------------------*/
    211 #ifdef __cplusplus
    212 }
    213 #endif
    214 
    215 /*----------------------------------------------------------------------------
    216 ; FUNCTION CODE
    217 ----------------------------------------------------------------------------*/
    218 
    219 /*----------------------------------------------------------------------------
    220 ; Define all local variables
    221 ----------------------------------------------------------------------------*/
    222 
    223 
    224 /*----------------------------------------------------------------------------
    225 ; Function body here
    226 ----------------------------------------------------------------------------*/
    227 
    228 
    229 /*----------------------------------------------------------------------------
    230 ; Return nothing or data or data pointer
    231 ----------------------------------------------------------------------------*/
    232 
    233 
    234