1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
18 /****************************************************************************************
19 Portions of this file are derived from the following 3GPP standard:
22 ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
23 Available from http://www.3gpp.org
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 ****************************************************************************************/
30 ------------------------------------------------------------------------------
34 Filename: gsmamr_enc.h
36 ------------------------------------------------------------------------------
39 This header contains all the necessary information needed to use the
40 GSM AMR encoder library.
42 ------------------------------------------------------------------------------
44 #ifndef _GSMAMR_ENC_H_
45 #define _GSMAMR_ENC_H_
47 /*----------------------------------------------------------------------------
49 ----------------------------------------------------------------------------*/
51 #include "gsm_amr_typedefs.h"
53 /*--------------------------------------------------------------------------*/
59 /*----------------------------------------------------------------------------
61 ----------------------------------------------------------------------------*/
64 /*----------------------------------------------------------------------------
66 ----------------------------------------------------------------------------*/
67 /* Number of 13-bit linear PCM samples per 20 ms frame */
68 /* L_FRAME = (8 kHz) * (20 msec) = 160 samples */
71 /* Output format types */
77 /*----------------------------------------------------------------------------
78 ; EXTERNAL VARIABLES REFERENCES
79 ----------------------------------------------------------------------------*/
82 /*----------------------------------------------------------------------------
84 ----------------------------------------------------------------------------*/
86 /*----------------------------------------------------------------------------
87 ; ENUMERATED TYPEDEF'S
88 ----------------------------------------------------------------------------*/
92 MR475 = 0,/* 4.75 kbps */
93 MR515, /* 5.15 kbps */
97 MR795, /* 7.95 kbps */
98 MR102, /* 10.2 kbps */
99 MR122, /* 12.2 kbps */
101 N_MODES /* Not Used */
106 AMR_475 = 0, /* 4.75 kbps */
107 AMR_515, /* 5.15 kbps */
108 AMR_59, /* 5.9 kbps */
109 AMR_67, /* 6.7 kbps */
110 AMR_74, /* 7.4 kbps */
111 AMR_795, /* 7.95 kbps */
112 AMR_102, /* 10.2 kbps */
113 AMR_122, /* 12.2 kbps */
114 AMR_SID, /* GSM AMR DTX */
115 GSM_EFR_SID, /* GSM EFR DTX */
116 TDMA_EFR_SID, /* TDMA EFR DTX */
117 PDC_EFR_SID, /* PDC EFR DTX */
118 FOR_FUTURE_USE1, /* Unused 1 */
119 FOR_FUTURE_USE2, /* Unused 2 */
120 FOR_FUTURE_USE3, /* Unused 3 */
121 AMR_NO_DATA /* No data */
124 /*----------------------------------------------------------------------------
125 ; STRUCTURES TYPEDEF'S
126 ----------------------------------------------------------------------------*/
127 /*----------------------------------------------------------------------------
128 ; GLOBAL FUNCTION DEFINITIONS
129 ----------------------------------------------------------------------------*/
130 /* AMREncodeInit initializes the GSM AMR Encoder library by calling
131 * GSMInitEncode and sid_sync_init. If initialization was successful,
132 * init_status is set to zero, otherwise, it is set to -1.
135 void **pEncStructure,
136 void **pSidSyncStructure,
139 /* AMREncodeReset resets the state memory used by the Encoder and SID sync
140 * function. If reset was successful, reset_status is set to zero, otherwise,
145 void *pSidSyncStructure);
147 /* AMREncodeExit frees up the state memory used by the Encoder and SID
148 * synchronization function.
151 void **pEncStructure,
152 void **pSidSyncStructure);
155 * AMREncode is the entry point to the ETS Encoder library that encodes the raw
156 * data speech bits and converts the encoded bitstream into either an IF2-
157 * formatted bitstream, WMF-formatted bitstream, or ETS-formatted bitstream,
158 * depending on the the value of output_format. A zero is returned on success.
165 unsigned char *pEncOutput,
166 enum Frame_Type_3GPP *p3gpp_frame_type,
175 #endif /* _GSMAMR_DEC_H_ */