lsp.h revision 98913fed6520d8849fb2e246be943e04474aefa4
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/*---------------------------------------------------------------------------*\
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)Original Copyright
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)	FILE........: AK2LSPD.H
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)	TYPE........: Turbo C header file
590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)	COMPANY.....: Voicetronix
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)	AUTHOR......: James Whitehall
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)	DATE CREATED: 21/11/95
890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)Modified by Jean-Marc Valin
10424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    This file contains functions for converting Linear Prediction
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    Coefficients (LPC) to Line Spectral Pair (LSP) and back. Note that the
13c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    LSP coefficients are not in radians format but in the x domain of the
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    unit circle.
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)\*---------------------------------------------------------------------------*/
17ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch/**
18ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch   @file lsp.h
19c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)   @brief Line Spectral Pair (LSP) functions.
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)*/
21eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch/* Speex License:
22eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   Redistribution and use in source and binary forms, with or without
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   modification, are permitted provided that the following conditions
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   are met:
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   - Redistributions of source code must retain the above copyright
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   notice, this list of conditions and the following disclaimer.
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   - Redistributions in binary form must reproduce the above copyright
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   notice, this list of conditions and the following disclaimer in the
32eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch   documentation and/or other materials provided with the distribution.
33eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
3490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)   - Neither the name of the Xiph.org Foundation nor the names of its
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   contributors may be used to endorse or promote products derived from
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   this software without specific prior written permission.
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
42eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)*/
50c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
51c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#ifndef __AK2LSPD__
52c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#define __AK2LSPD__
53c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
54c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "arch.h"
55eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)int lpc_to_lsp (spx_coef_t *a, int lpcrdr, spx_lsp_t *freq, int nb, spx_word16_t delta, char *stack);
57eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochvoid lsp_to_lpc(spx_lsp_t *freq, spx_coef_t *ak, int lpcrdr, char *stack);
58c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
59c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)/*Added by JMV*/
60eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdochvoid lsp_enforce_margin(spx_lsp_t *lsp, int len, spx_word16_t margin);
61c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
62c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *interp_lsp, int len, int subframe, int nb_subframes);
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif	/* __AK2LSPD__ */
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)