Disabling LBRR for whever there's a change in bandwidth/channels/framesize
[opus.git] / silk / PLC.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_PLC_FIX_H
29 #define SILK_PLC_FIX_H
30
31 #include "main.h"
32
33 #define BWE_COEF                        0.99
34 #define V_PITCH_GAIN_START_MIN_Q14      11469           /* 0.7 in Q14                       */
35 #define V_PITCH_GAIN_START_MAX_Q14      15565           /* 0.95 in Q14                      */
36 #define MAX_PITCH_LAG_MS                18
37 #define SA_THRES_Q8                     50
38 #define USE_SINGLE_TAP                  1
39 #define RAND_BUF_SIZE                   128
40 #define RAND_BUF_MASK                   (RAND_BUF_SIZE - 1)
41 #define LOG2_INV_LPC_GAIN_HIGH_THRES    3               /* 2^3 = 8 dB LPC gain              */
42 #define LOG2_INV_LPC_GAIN_LOW_THRES     8               /* 2^8 = 24 dB LPC gain             */
43 #define PITCH_DRIFT_FAC_Q16             655             /* 0.01 in Q16                      */
44
45 void silk_PLC_Reset(
46     silk_decoder_state      *psDec              /* I/O Decoder state        */
47 );
48
49 void silk_PLC(
50     silk_decoder_state      *psDec,             /* I/O Decoder state        */
51     silk_decoder_control    *psDecCtrl,         /* I/O Decoder control      */
52     opus_int16                   signal[],           /* I/O  signal              */
53     opus_int                     lost                /* I Loss flag              */
54 );
55
56 void silk_PLC_glue_frames(
57     silk_decoder_state      *psDec,             /* I/O decoder state        */
58     opus_int16                   signal[],           /* I/O signal               */
59     opus_int                     length              /* I length of signal       */
60 );
61
62 #endif
63