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 *      GSM AMR speech codec   Version 2.0.0   February 8, 1999
33 *
34 *****************************************************************************
35 *
36 *      File             : sp_dec.h
37 *      Purpose          : Decoding and post filtering of one speech frame.
38 *
39 
40  Description:  Replaced "int" and/or "char" with OSCL defined types.
41 
42 *****************************************************************************
43 */
44 #ifndef sp_dec_h
45 #define sp_dec_h "$Id $"
46 
47 /*
48 *****************************************************************************
49 *                         INCLUDE FILES
50 *****************************************************************************
51 */
52 #include "typedef.h"
53 #include "cnst.h"
54 #include "dec_amr.h"
55 #include "pstfilt.h"
56 #include "post_pro.h"
57 #include "mode.h"
58 
59 /*
60 *****************************************************************************
61 *                         DEFINITION OF DATA TYPES
62 *****************************************************************************
63 */
64 typedef struct
65 {
66     Decoder_amrState  decoder_amrState;
67     Post_FilterState  post_state;
68     Post_ProcessState postHP_state;
69     enum Mode prev_mode;
70 } Speech_Decode_FrameState;
71 
72 /*
73 *****************************************************************************
74 *                         DECLARATION OF PROTOTYPES
75 *****************************************************************************
76 */
77 
78 #if defined(__cplusplus)
79 extern "C"
80 {
81 #endif
82     Word16 GSMInitDecode(void **state_data,
83     Word8 *id);
84     /* initialize one instance of the speech decoder
85        Stores pointer to filter status struct in *st. This pointer has to
86        be passed to Speech_Decode_Frame in each call.
87        returns 0 on success
88      */
89 
90     Word16 Speech_Decode_Frame_reset(void *state_data);
91     /* reset speech decoder (i.e. set state memory to zero)
92        returns 0 on success
93      */
94 
95     void GSMDecodeFrameExit(void **state_data);
96     /* de-initialize speech decoder (i.e. free status struct)
97        stores NULL in *s
98      */
99 
100     void GSMFrameDecode(
101         Speech_Decode_FrameState *st, /* io: post filter states                */
102         enum Mode mode,               /* i : AMR mode                          */
103         Word16 *serial,               /* i : serial bit stream                 */
104         enum RXFrameType frame_type,  /* i : Frame type                        */
105         Word16 *synth                 /* o : synthesis speech (postfiltered    */
106         /*     output)                           */
107     );
108     /*    return 0 on success
109      */
110 #if defined(__cplusplus)
111 }
112 #endif
113 #endif
114