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 ****************************************************************************************/
33 ------------------------------------------------------------------------------
36 This file contains all the constant definitions and prototype definitions
37 needed by the d_plsf_3.c and d_plsf_5.c
39 ------------------------------------------------------------------------------
42 /*----------------------------------------------------------------------------
43 ; CONTINUE ONLY IF NOT ALREADY DEFINED
44 ----------------------------------------------------------------------------*/
46 #define d_plsf_h "$Id $"
48 /*----------------------------------------------------------------------------
50 ----------------------------------------------------------------------------*/
54 #include "get_const_tbls.h"
56 /*--------------------------------------------------------------------------*/
62 /*----------------------------------------------------------------------------
64 ; Define module specific macros here
65 ----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------
69 ; Include all pre-processor statements here.
70 ----------------------------------------------------------------------------*/
72 /*----------------------------------------------------------------------------
73 ; EXTERNAL VARIABLES REFERENCES
74 ; Declare variables used in this module but defined elsewhere
75 ----------------------------------------------------------------------------*/
77 /*----------------------------------------------------------------------------
79 ----------------------------------------------------------------------------*/
81 /*----------------------------------------------------------------------------
82 ; ENUMERATED TYPEDEF'S
83 ----------------------------------------------------------------------------*/
85 /*----------------------------------------------------------------------------
86 ; STRUCTURES TYPEDEF'S
87 ----------------------------------------------------------------------------*/
90 Word16 past_r_q[M]; /* Past quantized prediction error, Q15 */
91 Word16 past_lsf_q[M]; /* Past dequantized lsfs, Q15 */
94 /*----------------------------------------------------------------------------
95 ; GLOBAL FUNCTION DEFINITIONS
96 ; Function Prototype declaration
97 ----------------------------------------------------------------------------*/
100 **************************************************************************
102 * Function : D_plsf_reset
103 * Purpose : Resets state memory
104 * Returns : 0 on success
106 **************************************************************************
108 Word16 D_plsf_reset(D_plsfState *st, const Word16* mean_lsf_5_ptr);
111 **************************************************************************
113 * Function : D_plsf_exit
114 * Purpose : The memory used for state memory is freed
115 * Description : Stores NULL in *st
118 **************************************************************************
120 void D_plsf_exit(D_plsfState **st);
123 **************************************************************************
125 * Function : D_plsf_5
126 * Purpose : Decodes the 2 sets of LSP parameters in a frame
127 * using the received quantization indices.
128 * Description : The two sets of LSFs are quantized using split by
129 * 5 matrix quantization (split-MQ) with 1st order MA
131 * See "q_plsf_5.c" for more details about the
132 * quantization procedure
135 **************************************************************************
138 D_plsfState *st, /* i/o: State variables */
139 Word16 bfi, /* i : bad frame indicator (set to 1 if a bad
140 frame is received) */
141 Word16 *indice, /* i : quantization indices of 5 submatrices, Q0 */
142 CommonAmrTbls* common_amr_tbls, /* i : structure containing ptrs to read-only tables */
143 Word16 *lsp1_q, /* o : quantized 1st LSP vector (M) Q15 */
144 Word16 *lsp2_q, /* o : quantized 2nd LSP vector (M) Q15 */
145 Flag *pOverflow /* o : Flag set when overflow occurs */
148 /*************************************************************************
150 * FUNCTION: D_plsf_3()
152 * PURPOSE: Decodes the LSP parameters using the received quantization
153 * indices.1st order MA prediction and split by 3 matrix
154 * quantization (split-MQ)
156 *************************************************************************/
159 D_plsfState *st, /* i/o: State struct */
160 enum Mode mode, /* i : coder mode */
161 Word16 bfi, /* i : bad frame indicator (set to 1 if a */
162 /* bad frame is received) */
163 Word16 * indice, /* i : quantization indices of 3 submatrices, Q0 */
164 CommonAmrTbls* common_amr_tbls, /* i : structure containing ptrs to read-only tables */
165 Word16 * lsp1_q, /* o : quantized 1st LSP vector, Q15 */
166 Flag *pOverflow /* o : Flag set when overflow occurs */
169 /*************************************************************************
171 * FUNCTION: Init_D_plsf_3()
173 * PURPOSE: Set the past_r_q[M] vector to one of the eight
174 * past_rq_init vectors.
176 *************************************************************************/
177 void Init_D_plsf_3(D_plsfState *st, /* i/o: State struct */
178 Word16 index, /* i : past_rq_init[] index [0, 7] */
179 const Word16* past_rq_init_ptr /* ptr to read-only table */
182 /*----------------------------------------------------------------------------
184 ----------------------------------------------------------------------------*/
189 #endif /* _Q_PLSF_H_ */