Delaying SILK stereo->mono transitions by two frames
[opus.git] / silk / main.h
1 /***********************************************************************
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved.
3 Redistribution and use in source and binary forms, with or without
4 modification, (subject to the limitations in the disclaimer below)
5 are permitted provided that the following conditions are met:
6 - Redistributions of source code must retain the above copyright notice,
7 this list of conditions and the following disclaimer.
8 - Redistributions in binary form must reproduce the above copyright
9 notice, this list of conditions and the following disclaimer in the
10 documentation and/or other materials provided with the distribution.
11 - Neither the name of Skype Limited, nor the names of specific
12 contributors, may be used to endorse or promote products derived from
13 this software without specific prior written permission.
14 NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED
15 BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
16 CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
17 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***********************************************************************/
27
28 #ifndef SILK_MAIN_H
29 #define SILK_MAIN_H
30
31 #include "SigProc_FIX.h"
32 #include "define.h"
33 #include "structs.h"
34 #include "tables.h"
35 #include "PLC.h"
36 #include "control.h"
37 #include "debug.h"
38 #include "entenc.h"
39 #include "entdec.h"
40
41 /* Uncomment the next line to store intermadiate data to files */
42 /*#define SAVE_ALL_INTERNAL_DATA      1*/
43 /* Uncomment the next line to force a fixed internal sampling rate (independent of what bitrate is used */
44 /*#define FORCE_INTERNAL_FS_KHZ       16*/
45
46
47 /* Convert Left/Right stereo signal to adaptive Mid/Side representation */
48 void silk_stereo_LR_to_MS(
49     stereo_enc_state    *state,                         /* I/O  State                                       */
50     opus_int16           x1[],                           /* I/O  Left input signal, becomes mid signal       */
51     opus_int16           x2[],                           /* I/O  Right input signal, becomes side signal     */
52     opus_int8            ix[ 2 ][ 3 ],                   /* O    Quantization indices                        */
53     opus_int8            *mid_only_flag,                 /* O    Flag: only mid signal coded                 */
54     opus_int32           mid_side_rates_bps[],           /* O    Bitrates for mid and side signals           */
55     opus_int32           total_rate_bps,                 /* I    Total bitrate                               */
56     opus_int             prev_speech_act_Q8,             /* I    Speech activity level in previous frame     */
57     opus_int             fs_kHz,                         /* I    Sample rate (kHz)                           */
58     opus_int             frame_length                    /* I    Number of samples                           */
59 );
60
61 /* Convert adaptive Mid/Side representation to Left/Right stereo signal */
62 void silk_stereo_MS_to_LR(
63     stereo_dec_state    *state,                         /* I/O  State                                       */
64     opus_int16           x1[],                           /* I/O  Left input signal, becomes mid signal       */
65     opus_int16           x2[],                           /* I/O  Right input signal, becomes side signal     */
66     const opus_int32     pred_Q13[],                     /* I    Predictors                                  */
67     opus_int             fs_kHz,                         /* I    Samples rate (kHz)                          */
68     opus_int             frame_length                    /* I    Number of samples                           */
69 );
70
71 /* Find least-squares prediction gain for one signal based on another and quantize it */
72 opus_int32 silk_stereo_find_predictor(                   /* O    Returns predictor in Q13                    */
73     opus_int32           *ratio_Q14,                     /* O    Ratio of residual and mid energies          */
74     const opus_int16     x[],                            /* I    Basis signal                                */
75     const opus_int16     y[],                            /* I    Target signal                               */
76     opus_int32           mid_res_amp_Q0[],               /* I/O  Smoothed mid, residual norms                */
77     opus_int             length,                         /* I    Number of samples                           */
78     opus_int             smooth_coef_Q16                 /* I    Smoothing coefficient                       */
79 );
80
81 /* Quantize mid/side predictors */
82 void silk_stereo_quant_pred(
83     opus_int32           pred_Q13[],                     /* I/O  Predictors (out: quantized)                 */
84     opus_int8            ix[ 2 ][ 3 ]                    /* O    Quantization indices                        */
85 );
86
87 /* Entropy code the mid/side quantization indices */
88 void silk_stereo_encode_pred(
89     ec_enc              *psRangeEnc,                    /* I/O  Compressor data structure                   */
90     opus_int8            ix[ 2 ][ 3 ]                    /* I    Quantization indices                        */
91 );
92
93 /* Entropy code the mid-only flag */
94 void silk_stereo_encode_mid_only(
95     ec_enc              *psRangeEnc,                    /* I/O  Compressor data structure                   */
96     opus_int8            mid_only_flag
97 );
98
99 /* Decode mid/side predictors */
100 void silk_stereo_decode_pred(
101     ec_dec              *psRangeDec,                    /* I/O  Compressor data structure                   */
102     opus_int32           pred_Q13[]                      /* O    Predictors                                  */
103 );
104
105 /* Decode mid-only flag */
106 void silk_stereo_decode_mid_only(
107     ec_dec              *psRangeDec,                    /* I/O  Compressor data structure                   */
108     opus_int             *decode_only_mid                /* O    Flag that only mid channel has been coded   */
109 );
110
111 /* Encodes signs of excitation */
112 void silk_encode_signs(
113     ec_enc                      *psRangeEnc,                        /* I/O  Compressor data structure                   */
114     const opus_int8              pulses[],                           /* I    pulse signal                                */
115     opus_int                     length,                             /* I    length of input                             */
116     const opus_int               signalType,                         /* I    Signal type                                 */
117     const opus_int               quantOffsetType,                    /* I    Quantization offset type                    */
118     const opus_int               sum_pulses[ MAX_NB_SHELL_BLOCKS ]   /* I    Sum of absolute pulses per block            */
119 );
120
121 /* Decodes signs of excitation */
122 void silk_decode_signs(
123     ec_dec                      *psRangeDec,                        /* I/O  Compressor data structure                   */
124     opus_int                     pulses[],                           /* I/O  pulse signal                                */
125     opus_int                     length,                             /* I    length of input                             */
126     const opus_int               signalType,                         /* I    Signal type                                 */
127     const opus_int               quantOffsetType,                    /* I    Quantization offset type                    */
128     const opus_int               sum_pulses[ MAX_NB_SHELL_BLOCKS ]   /* I    Sum of absolute pulses per block            */
129 );
130
131 /* Check encoder control struct */
132 opus_int check_control_input(
133     silk_EncControlStruct        *encControl     /* I:   Control structure                               */
134 );
135
136 /* Control internal sampling rate */
137 opus_int silk_control_audio_bandwidth(
138     silk_encoder_state          *psEncC             /* I/O  Pointer to Silk encoder state               */
139 );
140
141 /* Control SNR of redidual quantizer */
142 opus_int silk_control_SNR(
143     silk_encoder_state          *psEncC,            /* I/O  Pointer to Silk encoder state               */
144     opus_int32                   TargetRate_bps      /* I    Target max bitrate (bps)                    */
145 );
146
147 /***************/
148 /* Shell coder */
149 /***************/
150
151 /* Encode quantization indices of excitation */
152 void silk_encode_pulses(
153     ec_enc                      *psRangeEnc,        /* I/O  compressor data structure                   */
154     const opus_int               signalType,         /* I    Signal type                                 */
155     const opus_int               quantOffsetType,    /* I    quantOffsetType                             */
156     opus_int8                    pulses[],           /* I    quantization indices                        */
157     const opus_int               frame_length        /* I    Frame length                                */
158 );
159
160 /* Shell encoder, operates on one shell code frame of 16 pulses */
161 void silk_shell_encoder(
162     ec_enc                      *psRangeEnc,        /* I/O  compressor data structure                   */
163     const opus_int               *pulses0            /* I    data: nonnegative pulse amplitudes          */
164 );
165
166 /* Shell decoder, operates on one shell code frame of 16 pulses */
167 void silk_shell_decoder(
168     opus_int                     *pulses0,           /* O    data: nonnegative pulse amplitudes          */
169     ec_dec                      *psRangeDec,        /* I/O  Compressor data structure                   */
170     const opus_int               pulses4             /* I    number of pulses per pulse-subframe         */
171 );
172
173 /* Gain scalar quantization with hysteresis, uniform on log scale */
174 void silk_gains_quant(
175     opus_int8                        ind[ MAX_NB_SUBFR ],        /* O    gain indices                            */
176     opus_int32                       gain_Q16[ MAX_NB_SUBFR ],   /* I/O  gains (quantized out)                   */
177     opus_int8                        *prev_ind,                  /* I/O  last index in previous frame            */
178     const opus_int                   conditional,                /* I    first gain is delta coded if 1          */
179     const opus_int                   nb_subfr                    /* I    number of subframes                     */
180 );
181
182 /* Gains scalar dequantization, uniform on log scale */
183 void silk_gains_dequant(
184     opus_int32                       gain_Q16[ MAX_NB_SUBFR ],   /* O    quantized gains                         */
185     const opus_int8                  ind[ MAX_NB_SUBFR ],        /* I    gain indices                            */
186     opus_int8                        *prev_ind,                  /* I/O  last index in previous frame            */
187     const opus_int                   conditional,                /* I    first gain is delta coded if 1          */
188     const opus_int                   nb_subfr                    /* I    number of subframes                     */
189 );
190
191 /* Interpolate two vectors */
192 void silk_interpolate(
193     opus_int16                       xi[ MAX_LPC_ORDER ],    /* O    interpolated vector                     */
194     const opus_int16                 x0[ MAX_LPC_ORDER ],    /* I    first vector                            */
195     const opus_int16                 x1[ MAX_LPC_ORDER ],    /* I    second vector                           */
196     const opus_int                   ifact_Q2,               /* I    interp. factor, weight on 2nd vector    */
197     const opus_int                   d                       /* I    number of parameters                    */
198 );
199
200 /* LTP tap quantizer */
201 void silk_quant_LTP_gains(
202     opus_int16           B_Q14[ MAX_NB_SUBFR * LTP_ORDER ],              /* I/O  (un)quantized LTP gains     */
203     opus_int8            cbk_index[ MAX_NB_SUBFR ],                      /* O    Codebook Index              */
204     opus_int8            *periodicity_index,                             /* O    Periodicity Index           */
205     const opus_int32     W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ],      /* I    Error Weights in Q18        */
206     opus_int             mu_Q9,                                          /* I    Mu value (R/D tradeoff)     */
207     opus_int             lowComplexity,                                  /* I    Flag for low complexity     */
208     const opus_int       nb_subfr                                        /* I    number of subframes         */
209 );
210
211 /* Entropy constrained matrix-weighted VQ, for a single input data vector */
212 void silk_VQ_WMat_EC(
213     opus_int8                        *ind,               /* O    index of best codebook vector               */
214     opus_int32                       *rate_dist_Q14,     /* O    best weighted quantization error + mu * rate*/
215     const opus_int16                 *in_Q14,            /* I    input vector to be quantized                */
216     const opus_int32                 *W_Q18,             /* I    weighting matrix                            */
217     const opus_int8                  *cb_Q7,             /* I    codebook                                    */
218     const opus_uint8                 *cl_Q5,             /* I    code length for each codebook vector        */
219     const opus_int                   mu_Q9,              /* I    tradeoff between weighted error and rate    */
220     opus_int                         L                   /* I    number of vectors in codebook               */
221 );
222
223 /***********************************/
224 /* Noise shaping quantization (NSQ)*/
225 /***********************************/
226 void silk_NSQ(
227     const silk_encoder_state        *psEncC,                                    /* I/O  Encoder State                       */
228     silk_nsq_state                  *NSQ,                                       /* I/O  NSQ state                           */
229     SideInfoIndices                 *psIndices,                                 /* I/O  Quantization Indices                */
230     const opus_int16                 x[],                                        /* I    prefiltered input signal            */
231     opus_int8                        pulses[],                                   /* O    quantized qulse signal              */
232     const opus_int16                 PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Short term prediction coefficients  */
233     const opus_int16                 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    Long term prediction coefficients   */
234     const opus_int16                 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I                                     */
235     const opus_int                   HarmShapeGain_Q14[ MAX_NB_SUBFR ],          /* I                                        */
236     const opus_int                   Tilt_Q14[ MAX_NB_SUBFR ],                   /* I    Spectral tilt                       */
237     const opus_int32                 LF_shp_Q14[ MAX_NB_SUBFR ],                 /* I                                        */
238     const opus_int32                 Gains_Q16[ MAX_NB_SUBFR ],                  /* I                                        */
239     const opus_int                   pitchL[ MAX_NB_SUBFR ],                     /* I                                        */
240     const opus_int                   Lambda_Q10,                                 /* I                                        */
241     const opus_int                   LTP_scale_Q14                               /* I    LTP state scaling                   */
242 );
243
244 /* Noise shaping using delayed decision */
245 void silk_NSQ_del_dec(
246     const silk_encoder_state        *psEncC,                                    /* I/O  Encoder State                       */
247     silk_nsq_state                  *NSQ,                                       /* I/O  NSQ state                           */
248     SideInfoIndices                 *psIndices,                                 /* I/O  Quantization Indices                */
249     const opus_int16                 x[],                                        /* I    Prefiltered input signal            */
250     opus_int8                        pulses[],                                   /* O    Quantized pulse signal              */
251     const opus_int16                 PredCoef_Q12[ 2 * MAX_LPC_ORDER ],          /* I    Prediction coefs                    */
252     const opus_int16                 LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],    /* I    LT prediction coefs                 */
253     const opus_int16                 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ], /* I                                     */
254     const opus_int                   HarmShapeGain_Q14[ MAX_NB_SUBFR ],          /* I                                        */
255     const opus_int                   Tilt_Q14[ MAX_NB_SUBFR ],                   /* I    Spectral tilt                       */
256     const opus_int32                 LF_shp_Q14[ MAX_NB_SUBFR ],                 /* I                                        */
257     const opus_int32                 Gains_Q16[ MAX_NB_SUBFR ],                  /* I                                        */
258     const opus_int                   pitchL[ MAX_NB_SUBFR ],                     /* I                                        */
259     const opus_int                   Lambda_Q10,                                 /* I                                        */
260     const opus_int                   LTP_scale_Q14                               /* I    LTP state scaling                   */
261 );
262
263 /************/
264 /* Silk VAD */
265 /************/
266 /* Initialize the Silk VAD */
267 opus_int silk_VAD_Init(                              /* O    Return value, 0 if success                  */
268     silk_VAD_state              *psSilk_VAD         /* I/O  Pointer to Silk VAD state                   */
269 );
270
271 /* Get speech activity level in Q8 */
272 opus_int silk_VAD_GetSA_Q8(                          /* O    Return value, 0 if success                  */
273     silk_encoder_state          *psEncC,            /* I/O  Encoder state                               */
274     const opus_int16             pIn[]               /* I    PCM input                                   */
275 );
276
277 /* Low-pass filter with variable cutoff frequency based on  */
278 /* piece-wise linear interpolation between elliptic filters */
279 /* Start by setting transition_frame_no = 1;                */
280 void silk_LP_variable_cutoff(
281     silk_LP_state               *psLP,              /* I/O  LP filter state                             */
282     opus_int16                   *signal,            /* I/O  Low-pass filtered output signal             */
283     const opus_int               frame_length        /* I    Frame length                                */
284 );
285
286 /******************/
287 /* NLSF Quantizer */
288 /******************/
289 /* Limit, stabilize, convert and quantize NLSFs */
290 void silk_process_NLSFs(
291     silk_encoder_state              *psEncC,                                /* I/O  Encoder state                               */
292     opus_int16                       PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ],     /* O    Prediction coefficients                     */
293     opus_int16                       pNLSF_Q15[         MAX_LPC_ORDER ],     /* I/O  Normalized LSFs (quant out) (0 - (2^15-1))  */
294     const opus_int16                 prev_NLSFq_Q15[    MAX_LPC_ORDER ]      /* I    Previous Normalized LSFs (0 - (2^15-1))     */
295 );
296
297 opus_int32 silk_NLSF_encode(                                 /* O    Returns RD value in Q25                 */
298           opus_int8                  *NLSFIndices,           /* I    Codebook path vector [ LPC_ORDER + 1 ]  */
299           opus_int16                 *pNLSF_Q15,             /* I/O  Quantized NLSF vector [ LPC_ORDER ]     */
300     const silk_NLSF_CB_struct       *psNLSF_CB,             /* I    Codebook object                         */
301     const opus_int16                 *pW_QW,                 /* I    NLSF weight vector [ LPC_ORDER ]        */
302     const opus_int                   NLSF_mu_Q20,            /* I    Rate weight for the RD optimization     */
303     const opus_int                   nSurvivors,             /* I    Max survivors after first stage         */
304     const opus_int                   signalType              /* I    Signal type: 0/1/2                      */
305 );
306
307 /* Compute quantization errors for an LPC_order element input vector for a VQ codebook */
308 void silk_NLSF_VQ(
309     opus_int32                   err_Q26[],              /* O    Quantization errors [K]                     */
310     const opus_int16             in_Q15[],               /* I    Input vectors to be quantized [LPC_order]   */
311     const opus_uint8             pCB_Q8[],               /* I    Codebook vectors [K*LPC_order]              */
312     const opus_int               K,                      /* I    Number of codebook vectors                  */
313     const opus_int               LPC_order               /* I    Number of LPCs                              */
314 );
315
316 /* Delayed-decision quantizer for NLSF residuals */
317 opus_int32 silk_NLSF_del_dec_quant(                      /* O    Returns RD value in Q25                     */
318     opus_int8                    indices[],              /* O    Quantization indices [ order ]              */
319     const opus_int16             x_Q10[],                /* I    Input [ order ]                             */
320     const opus_int16             w_Q5[],                 /* I    Weights [ order ]                           */
321     const opus_uint8             pred_coef_Q8[],         /* I    Backward predictor coefs [ order ]          */
322     const opus_int16             ec_ix[],                /* I    Indices to entropy coding tables [ order ]  */
323     const opus_uint8             ec_rates_Q5[],          /* I    Rates []                                    */
324     const opus_int               quant_step_size_Q16,    /* I    Quantization step size                      */
325     const opus_int16             inv_quant_step_size_Q6, /* I    Inverse quantization step size              */
326     const opus_int32             mu_Q20,                 /* I    R/D tradeoff                                */
327     const opus_int16             order                   /* I    Number of input values                      */
328 );
329
330 /* Unpack predictor values and indices for entropy coding tables */
331 void silk_NLSF_unpack(
332           opus_int16                 ec_ix[],                /* O    Indices to entropy tales [ LPC_ORDER ]  */
333           opus_uint8                 pred_Q8[],              /* O    LSF predictor [ LPC_ORDER ]             */
334     const silk_NLSF_CB_struct       *psNLSF_CB,             /* I    Codebook object                         */
335     const opus_int                   CB1_index               /* I    Index of vector in first LSF codebook   */
336 );
337
338 /***********************/
339 /* NLSF vector decoder */
340 /***********************/
341 void silk_NLSF_decode(
342           opus_int16                 *pNLSF_Q15,             /* O    Quantized NLSF vector [ LPC_ORDER ]     */
343           opus_int8                  *NLSFIndices,           /* I    Codebook path vector [ LPC_ORDER + 1 ]  */
344     const silk_NLSF_CB_struct       *psNLSF_CB              /* I    Codebook object                         */
345 );
346
347 /****************************************************/
348 /* Decoder Functions                                */
349 /****************************************************/
350 opus_int silk_create_decoder(
351     silk_decoder_state              **ppsDec            /* I/O  Decoder state pointer pointer               */
352 );
353
354 opus_int silk_free_decoder(
355     silk_decoder_state              *psDec              /* I/O  Decoder state pointer                       */
356 );
357
358 opus_int silk_init_decoder(
359     silk_decoder_state              *psDec              /* I/O  Decoder state pointer                       */
360 );
361
362 /* Set decoder sampling rate */
363 void silk_decoder_set_fs(
364     silk_decoder_state              *psDec,             /* I/O  Decoder state pointer                       */
365     opus_int                         fs_kHz              /* I    Sampling frequency (kHz)                    */
366 );
367
368 /****************/
369 /* Decode frame */
370 /****************/
371 opus_int silk_decode_frame(
372     silk_decoder_state          *psDec,             /* I/O  Pointer to Silk decoder state               */
373     ec_dec                      *psRangeDec,        /* I/O  Compressor data structure                   */
374     opus_int16                   pOut[],             /* O    Pointer to output speech frame              */
375     opus_int32                   *pN,                /* O    Pointer to size of output frame             */
376     opus_int                     lostFlag            /* I    0: no loss, 1 loss, 2 decode fec            */
377 );
378
379 /* Decode LBRR side info and excitation */
380 void silk_LBRR_extract(
381     silk_decoder_state          *psDec,             /* I/O  State                                       */
382     ec_dec                      *psRangeDec         /* I/O  Compressor data structure                   */
383 );
384
385 /* Decode indices from payload v4 Bitstream */
386 void silk_decode_indices(
387     silk_decoder_state          *psDec,             /* I/O  State                                       */
388     ec_dec                      *psRangeDec,        /* I/O  Compressor data structure                   */
389     opus_int                     FrameIndex,         /* I    Frame number                                */
390     opus_int                     decode_LBRR         /* I    Flag indicating LBRR data is being decoded  */
391 );
392
393 /* Decode parameters from payload */
394 void silk_decode_parameters(
395     silk_decoder_state      *psDec,                             /* I/O  State                                    */
396     silk_decoder_control    *psDecCtrl                          /* I/O  Decoder control                          */
397 );
398
399 /* Core decoder. Performs inverse NSQ operation LTP + LPC */
400 void silk_decode_core(
401     silk_decoder_state          *psDec,                             /* I/O  Decoder state               */
402     silk_decoder_control        *psDecCtrl,                         /* I    Decoder control             */
403     opus_int16                   xq[],                               /* O    Decoded speech              */
404     const opus_int               pulses[ MAX_FRAME_LENGTH ]          /* I    Pulse signal                */
405 );
406
407 /* Decode quantization indices of excitation (Shell coding) */
408 void silk_decode_pulses(
409     ec_dec                          *psRangeDec,        /* I/O  Compressor data structure                   */
410     opus_int                         pulses[],           /* O    Excitation signal                           */
411     const opus_int                   signalType,         /* I    Sigtype                                     */
412     const opus_int                   quantOffsetType,    /* I    quantOffsetType                             */
413     const opus_int                   frame_length        /* I    Frame length                                */
414 );
415
416 /******************/
417 /* CNG */
418 /******************/
419
420 /* Reset CNG */
421 void silk_CNG_Reset(
422     silk_decoder_state          *psDec              /* I/O  Decoder state                               */
423 );
424
425 /* Updates CNG estimate, and applies the CNG when packet was lost */
426 void silk_CNG(
427     silk_decoder_state          *psDec,             /* I/O  Decoder state                               */
428     silk_decoder_control        *psDecCtrl,         /* I/O  Decoder control                             */
429     opus_int16                   signal[],           /* I/O  Signal                                      */
430     opus_int                     length              /* I    Length of residual                          */
431 );
432
433 /* Encoding of various parameters */
434 void silk_encode_indices(
435     silk_encoder_state          *psEncC,            /* I/O  Encoder state                               */
436     ec_enc                      *psRangeEnc,        /* I/O  Compressor data structure                   */
437     opus_int                     FrameIndex,         /* I    Frame number                                */
438     opus_int                     encode_LBRR         /* I    Flag indicating LBRR data is being encoded  */
439 );
440
441 #endif