Libav
lsp.h
Go to the documentation of this file.
1 /*
2  * LSP computing for ACELP-based codecs
3  *
4  * Copyright (c) 2008 Vladimir Voroshilov
5  *
6  * This file is part of Libav.
7  *
8  * Libav is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * Libav is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with Libav; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef AVCODEC_LSP_H
24 #define AVCODEC_LSP_H
25 
26 #include <stdint.h>
27 
40 void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order);
41 
53 void ff_set_min_dist_lsf(float *lsf, double min_spacing, int size);
54 
63 void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order);
64 
68 void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order);
69 
76 void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order);
77 
81 void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order);
82 
91 void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order);
92 
93 
94 #define MAX_LP_HALF_ORDER 10
95 #define MAX_LP_ORDER (2*MAX_LP_HALF_ORDER)
96 
109 void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order);
110 
116 void ff_sort_nearly_sorted_floats(float *vals, int len);
117 
128 void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order);
129 
130 #endif /* AVCODEC_LSP_H */
void ff_set_min_dist_lsf(float *lsf, double min_spacing, int size)
Adjust the quantized LSFs so they are increasing and not too close.
Definition: lsp.c:49
void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order)
LSP to LP conversion (5.2.4 of AMR-WB)
Definition: lsp.c:143
int size
void ff_acelp_lp_decode(int16_t *lp_1st, int16_t *lp_2nd, const int16_t *lsp_2nd, const int16_t *lsp_prev, int lp_order)
Interpolate LSP for the first subframe and convert LSP -> LP for both subframes (3.2.5 and 3.2.6 of G.729)
Definition: lsp.c:169
void ff_acelp_reorder_lsf(int16_t *lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order)
(I.F) means fixed-point value with F fractional and I integer bits
Definition: lsp.c:31
void ff_sort_nearly_sorted_floats(float *vals, int len)
Sort values in ascending order.
Definition: lsp.c:220
void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order)
Floating point version of ff_acelp_lsf2lsp()
Definition: lsp.c:91
void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order)
Convert LSF to LSP.
Definition: lsp.c:81
int len
void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order)
Compute the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients needed for LSP to LPC conversion...
Definition: lsp.c:184
void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order)
Reconstruct LPC coefficients from the line spectral pair frequencies.
Definition: lsp.c:201
void ff_acelp_lsp2lpc(int16_t *lp, const int16_t *lsp, int lp_half_order)
LSP to LP conversion (3.2.6 of G.729)
Definition: lsp.c:121