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: /audio/gsm-amr/c/include/gsmamr_dec.h
38 ------------------------------------------------------------------------------
41 Description: Adding comments and removing some tables as per review comments.
43 Description: Replace enum Mode with enum Frame_Type_3GPP and updated function
44 prototype of AMRDecode().
46 Description: Added back the enum Mode type definition, removed RXFrameType
47 type definition, and updated AMRDecode and GSMInitDecode function
50 Description: Added #defines for WMF and IF2. Updated AMRDecode function
53 Description: Removed enum Mode type definition and updated AMRDecode function
56 Description: Renamed WMF and IF2 to AMR_WMF and AMR_IF2, respectively. Added
57 #define for AMR_ETS format.
59 Description: Rename input format defines to make it unique to the decoder.
61 Description: Added comment to describe L_FRAME.
63 Description: Moved _cplusplus #ifdef after Include section.
65 Description: Included file "typedefs.h" to avoid re-declaring similar typedef
66 this for OSCL-ed compatibility
68 Description: Included file "gsm_amr_typedefs.h" and eliminated re-definition
69 of types UWord8, Word8, Word16
73 ------------------------------------------------------------------------------
76 This header contains all the necessary information needed to allow the gsm amr
77 decoder library to be used properly upon release.
79 ------------------------------------------------------------------------------
81 #ifndef _GSMAMR_DEC_H_
82 #define _GSMAMR_DEC_H_
84 /*----------------------------------------------------------------------------
86 ----------------------------------------------------------------------------*/
88 #include "gsm_amr_typedefs.h"
89 #include "pvamrnbdecoder_api.h"
90 #include "frame_type_3gpp.h"
92 /*--------------------------------------------------------------------------*/
98 /*----------------------------------------------------------------------------
100 ----------------------------------------------------------------------------*/
103 /*----------------------------------------------------------------------------
105 ----------------------------------------------------------------------------*/
106 /* Number of 13-bit linear PCM samples per 20 ms frame */
107 /* L_FRAME = (8 kHz) * (20 msec) = 160 samples */
110 /*----------------------------------------------------------------------------
111 ; EXTERNAL VARIABLES REFERENCES
112 ----------------------------------------------------------------------------*/
115 /*----------------------------------------------------------------------------
117 ----------------------------------------------------------------------------*/
119 /*----------------------------------------------------------------------------
120 ; ENUMERATED TYPEDEF'S
121 ----------------------------------------------------------------------------*/
123 /*----------------------------------------------------------------------------
124 ; STRUCTURES TYPEDEF'S
125 ----------------------------------------------------------------------------*/
128 /*----------------------------------------------------------------------------
129 ; GLOBAL FUNCTION DEFINITIONS
130 ----------------------------------------------------------------------------*/
132 * This function allocates memory for filter structure and initializes state
133 * memory used by the GSM AMR decoder. This function returns zero. It will
134 * return negative one if there is an error.
136 Word16 GSMInitDecode(void **state_data,
140 * AMRDecode steps into the part of the library that decodes the raw data
141 * speech bits for the decoding process. It returns the address offset of
142 * the next frame to be decoded.
146 enum Frame_Type_3GPP frame_type,
147 UWord8 *speech_bits_ptr,
148 Word16 *raw_pcm_buffer,
153 * This function resets the state memory used by the GSM AMR decoder. This
154 * function returns zero. It will return negative one if there is an error.
156 Word16 Speech_Decode_Frame_reset(void *state_data);
159 * This function frees up the memory used for the state memory of the
162 void GSMDecodeFrameExit(void **state_data);
169 #endif /* _GSMAMR_DEC_H_ */