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