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_dec.h
36 ------------------------------------------------------------------------------
39 This header contains all the necessary information needed to allow the gsm amr
40 decoder library to be used properly upon release.
42 ------------------------------------------------------------------------------
44 #ifndef _GSMAMR_DEC_H_
45 #define _GSMAMR_DEC_H_
47 /*----------------------------------------------------------------------------
49 ----------------------------------------------------------------------------*/
51 #include "gsm_amr_typedefs.h"
52 #include "pvamrnbdecoder_api.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 /*----------------------------------------------------------------------------
72 ; EXTERNAL VARIABLES REFERENCES
73 ----------------------------------------------------------------------------*/
76 /*----------------------------------------------------------------------------
78 ----------------------------------------------------------------------------*/
80 /*----------------------------------------------------------------------------
81 ; ENUMERATED TYPEDEF'S
82 ----------------------------------------------------------------------------*/
85 AMR_475 = 0, /* 4.75 kbps */
86 AMR_515, /* 5.15 kbps */
87 AMR_59, /* 5.9 kbps */
88 AMR_67, /* 6.7 kbps */
89 AMR_74, /* 7.4 kbps */
90 AMR_795, /* 7.95 kbps */
91 AMR_102, /* 10.2 kbps */
92 AMR_122, /* 12.2 kbps */
93 AMR_SID, /* GSM AMR DTX */
94 GSM_EFR_SID, /* GSM EFR DTX */
95 TDMA_EFR_SID, /* TDMA EFR DTX */
96 PDC_EFR_SID, /* PDC EFR DTX */
97 FOR_FUTURE_USE1, /* Unused 1 */
98 FOR_FUTURE_USE2, /* Unused 2 */
99 FOR_FUTURE_USE3, /* Unused 3 */
103 /*----------------------------------------------------------------------------
104 ; STRUCTURES TYPEDEF'S
105 ----------------------------------------------------------------------------*/
108 /*----------------------------------------------------------------------------
109 ; GLOBAL FUNCTION DEFINITIONS
110 ----------------------------------------------------------------------------*/
112 * This function allocates memory for filter structure and initializes state
113 * memory used by the GSM AMR decoder. This function returns zero. It will
114 * return negative one if there is an error.
116 Word16 GSMInitDecode(void **state_data,
120 * AMRDecode steps into the part of the library that decodes the raw data
121 * speech bits for the decoding process. It returns the address offset of
122 * the next frame to be decoded.
126 enum Frame_Type_3GPP frame_type,
127 UWord8 *speech_bits_ptr,
128 Word16 *raw_pcm_buffer,
133 * This function resets the state memory used by the GSM AMR decoder. This
134 * function returns zero. It will return negative one if there is an error.
136 Word16 Speech_Decode_Frame_reset(void *state_data);
139 * This function frees up the memory used for the state memory of the
142 void GSMDecodeFrameExit(void **state_data);
149 #endif /* _GSMAMR_DEC_H_ */