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 33 34 Filename: /audio/gsm_amr/c/src/include/sp_enc.h 35 36 Date: 02/07/2002 37 38 ------------------------------------------------------------------------------ 39 REVISION HISTORY 40 41 Description: Updated template. Changed the function names of 42 Speech_Encode_Frame_reset and Speech_Encode_Frame_first to 43 GSMEncodeFrameReset and GSMEncodeFrameFirst respectively for 44 consistency. 45 46 Description: Reverted back to old function names Speech_Encode_Frame_reset() 47 and Speech_Encode_Frame_First() 48 49 Description: Replaced "int" and/or "char" with OSCL defined types. 50 51 Description: Moved _cplusplus #ifdef after Include section. 52 53 Description: 54 55 ------------------------------------------------------------------------------ 56 INCLUDE DESCRIPTION 57 58 File : sp_enc.h 59 Purpose : Encoding of one speech frame 60 61 ------------------------------------------------------------------------------ 62 */ 63 64 #ifndef sp_enc_h 65 #define sp_enc_h "$Id $" 66 67 /*---------------------------------------------------------------------------- 68 ; INCLUDES 69 ----------------------------------------------------------------------------*/ 70 #include "typedef.h" 71 #include "cnst.h" 72 #include "pre_proc.h" 73 #include "mode.h" 74 #include "cod_amr.h" 75 76 /*--------------------------------------------------------------------------*/ 77 #ifdef __cplusplus 78 extern "C" 79 { 80 #endif 81 82 /*---------------------------------------------------------------------------- 83 ; MACROS 84 ; [Define module specific macros here] 85 ----------------------------------------------------------------------------*/ 86 87 /*---------------------------------------------------------------------------- 88 ; DEFINES 89 ; [Include all pre-processor statements here.] 90 ----------------------------------------------------------------------------*/ 91 92 93 /*---------------------------------------------------------------------------- 94 ; EXTERNAL VARIABLES REFERENCES 95 ; [Declare variables used in this module but defined elsewhere] 96 ----------------------------------------------------------------------------*/ 97 98 /*---------------------------------------------------------------------------- 99 ; SIMPLE TYPEDEF'S 100 ----------------------------------------------------------------------------*/ 101 102 /*---------------------------------------------------------------------------- 103 ; ENUMERATED TYPEDEF'S 104 ----------------------------------------------------------------------------*/ 105 106 /*---------------------------------------------------------------------------- 107 ; STRUCTURES TYPEDEF'S 108 ----------------------------------------------------------------------------*/ 109 typedef struct 110 { 111 Pre_ProcessState *pre_state; 112 cod_amrState *cod_amr_state; 113 Flag dtx; 114 } Speech_Encode_FrameState; 115 116 /*---------------------------------------------------------------------------- 117 ; GLOBAL FUNCTION DEFINITIONS 118 ; [List function prototypes here] 119 ----------------------------------------------------------------------------*/ 120 /* initialize one instance of the speech encoder 121 Stores pointer to filter status struct in *st. This pointer has to 122 be passed to Speech_Encode_Frame in each call. 123 returns 0 on success */ 124 Word16 GSMInitEncode(void **state_data, 125 Flag dtx, 126 Word8 *id); 127 128 129 /* reset speech encoder (i.e. set state memory to zero) 130 returns 0 on success */ 131 Word16 Speech_Encode_Frame_reset(void *state_data); 132 133 /* de-initialize speech encoder (i.e. free status struct) 134 stores NULL in *s */ 135 void GSMEncodeFrameExit(void **state_data); 136 137 void Speech_Encode_Frame_First( 138 Speech_Encode_FrameState *st, /* i/o : post filter states */ 139 Word16 *new_speech); /* i : speech input */ 140 141 void GSMEncodeFrame( 142 void *state_data, /* i/o : encoder states */ 143 enum Mode mode, /* i : speech coder mode */ 144 Word16 *new_speech, /* i : input speech */ 145 Word16 *serial, /* o : serial bit stream */ 146 enum Mode *usedMode /* o : used speech coder mode */ 147 ); 148 149 #ifdef __cplusplus 150 } 151 #endif 152 153 #endif /* _sp_enc_h_ */ 154 155