sipr.h
Go to the documentation of this file.
1 /*
2  * SIPR / ACELP.NET decoder
3  *
4  * Copyright (c) 2008 Vladimir Voroshilov
5  * Copyright (c) 2009 Vitor Sessak
6  *
7  * This file is part of Libav.
8  *
9  * Libav is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * Libav is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with Libav; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef AVCODEC_SIPR_H
25 #define AVCODEC_SIPR_H
26 
27 #include "avcodec.h"
28 #include "dsputil.h"
29 #include "acelp_pitch_delay.h"
30 
31 #define LP_FILTER_ORDER_16k 16
32 #define L_SUBFR_16k 80
33 #define PITCH_MIN 30
34 #define PITCH_MAX 281
35 
36 #define LSFQ_DIFF_MIN (0.0125 * M_PI)
37 
38 #define LP_FILTER_ORDER 10
39 
41 #define L_INTERPOL (LP_FILTER_ORDER + 1)
42 
44 #define SUBFR_SIZE 48
45 
46 #define SUBFRAME_COUNT_16k 2
47 
48 typedef enum {
54 } SiprMode;
55 
56 typedef struct SiprParameters {
58  int vq_indexes[5];
59  int pitch_delay[5];
60  int gp_index[5];
61  int16_t fc_indexes[5][10];
62  int gc_index[5];
64 
65 typedef struct SiprContext {
68 
70 
73 
75 
77 
79  float gain_mem;
80  float energy_history[4];
83 
84  /* 5k0 */
85  float tilt_mem;
89 
90  /* 16k */
94  float *filt_mem[2];
97  double lsp_history_16k[16];
98 
99  void (*decode_frame)(struct SiprContext *ctx, SiprParameters *params,
100  float *out_data);
101 } SiprContext;
102 
103 extern const float ff_pow_0_5[16];
104 
105 void ff_sipr_init_16k(SiprContext *ctx);
106 
108  float *out_data);
109 
110 #endif /* AVCODEC_SIPR_H */