enc_output_format_tab.cpp revision b841f14f8e51f2365945281fbfa54ef6a1b1b5a6
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/****************************************************************************************
19Portions 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)
26Permission to distribute, modify and use this file under the standard license
27terms 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
121/*--------------------------------------------------------------------------*/
122#ifdef __cplusplus
123extern "C"
124{
125#endif
126
127    /*----------------------------------------------------------------------------
128    ; MACROS
129    ; Define module specific macros here
130    ----------------------------------------------------------------------------*/
131
132
133    /*----------------------------------------------------------------------------
134    ; DEFINES
135    ; Include all pre-processor statements here. Include conditional
136    ; compile variables also.
137    ----------------------------------------------------------------------------*/
138
139    /*----------------------------------------------------------------------------
140    ; LOCAL FUNCTION DEFINITIONS
141    ; Function Prototype declaration
142    ----------------------------------------------------------------------------*/
143
144
145    /*----------------------------------------------------------------------------
146    ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
147    ; Variable declaration - defined here and used outside this module
148    ----------------------------------------------------------------------------*/
149    /* Number of data bytes in an encoder frame for each codec mode */
150    /* for WMF output format.                                       */
151    /* Each entry is the sum of the 3GPP frame type byte and the    */
152    /* number of packed core AMR data bytes                         */
153    extern const Word16 WmfEncBytesPerFrame[16] =
154    {
155        13, /* 4.75 */
156        14, /* 5.15 */
157        16, /* 5.90 */
158        18, /* 6.70 */
159        20, /* 7.40 */
160        21, /* 7.95 */
161        27, /* 10.2 */
162        32, /* 12.2 */
163        6,  /* GsmAmr comfort noise */
164        7,  /* Gsm-Efr comfort noise */
165        6,  /* IS-641 comfort noise */
166        6,  /* Pdc-Efr comfort noise */
167        0,  /* future use */
168        0,  /* future use */
169        0,  /* future use */
170        1   /* No transmission */
171    };
172
173
174    /* Number of data bytes in an encoder frame for each codec mode */
175    /* for IF2 output format                                        */
176    extern const Word16 If2EncBytesPerFrame[16] =
177    {
178        13, /* 4.75 */
179        14, /* 5.15 */
180        16, /* 5.90 */
181        18, /* 6.70 */
182        19, /* 7.40 */
183        21, /* 7.95 */
184        26, /* 10.2 */
185        31, /* 12.2 */
186        6, /* GsmAmr comfort noise */
187        6, /* Gsm-Efr comfort noise */
188        6, /* IS-641 comfort noise */
189        6, /* Pdc-Efr comfort noise */
190        0, /* future use */
191        0, /* future use */
192        0, /* future use */
193        1  /* No transmission */
194    };
195
196    /*----------------------------------------------------------------------------
197    ; EXTERNAL FUNCTION REFERENCES
198    ; Declare functions defined elsewhere and referenced in this module
199    ----------------------------------------------------------------------------*/
200
201
202    /*----------------------------------------------------------------------------
203    ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
204    ; Declare variables used in this module but defined elsewhere
205    ----------------------------------------------------------------------------*/
206
207
208    /*--------------------------------------------------------------------------*/
209#ifdef __cplusplus
210}
211#endif
212
213/*----------------------------------------------------------------------------
214; FUNCTION CODE
215----------------------------------------------------------------------------*/
216
217/*----------------------------------------------------------------------------
218; Define all local variables
219----------------------------------------------------------------------------*/
220
221
222/*----------------------------------------------------------------------------
223; Function body here
224----------------------------------------------------------------------------*/
225
226
227/*----------------------------------------------------------------------------
228; Return nothing or data or data pointer
229----------------------------------------------------------------------------*/
230
231
232