Commit 1ad5aa5a authored by johan's avatar johan

ITU G729 annexe A implementation

parents
.deps/
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
build-aux/
config.log
config.status
configure
libtool
*.o
*.lo
*.la
libbcg729.pc
test/src/decoderTest
test/src/encoderTest
.libs
Copyright 2012 Belledonne Communications SARL.
Johan Pascal
Jehan Monnier
This diff is collapsed.
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src include
if BUILD_MSBCG729
SUBDIRS += msbcg729
endif
SUBDIRS += test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libbcg729.pc
bcg729 - g729 encoder and decoder implementation, and mediastreamer2 plugin interface.
By default, the upstream package installs into /usr/local. Please use
'./configure --prefix' to change it
# Tests suite:
- Tests are defined for each functional bloc (more or less matching a source file)
and for global encoding/decoding
- Use 'make check' to compile and run all tests available in the test directory.
- Input tests pattern have been generated by ITU code using ITU tests patterns.
The test patterns are not part of this repository but can be downloaded here:
http://www.belledonne-communications.com/downloads/bcg729-patterns.zip
However, the first run of 'make check' will get them for you.
- To run partial test, use perl executable 'testCampaign' in the test directory.
'./testCampaign <functional bloc name>'
You must first download the tests patterns using 'make check' or manually
#!/bin/sh
#AM_VERSION="1.11"
if ! type aclocal-$AM_VERSION 1>/dev/null 2>&1; then
AUTOMAKE=automake
ACLOCAL=aclocal
else
ACLOCAL=aclocal-${AM_VERSION}
AUTOMAKE=automake-${AM_VERSION}
fi
if test -f /opt/local/bin/glibtoolize ; then
# darwin
LIBTOOLIZE=/opt/local/bin/glibtoolize
else
LIBTOOLIZE=libtoolize
fi
if test -d /opt/local/share/aclocal ; then
ACLOCAL_ARGS="-I /opt/local/share/aclocal"
fi
echo "Generating build scripts for G729 codec..."
set -x
$LIBTOOLIZE --copy --force
$ACLOCAL $ACLOCAL_ARGS
#autoheader
$AUTOMAKE --force-missing --add-missing --copy
autoconf
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([bcg729],[0.1])
AC_PREREQ(2.63)
AC_CONFIG_SRCDIR([src/encoder.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([tar-ustar --warnings=no-portability])
AC_PROG_LIBTOOL
AC_PROG_CC
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_ARG_ENABLE(strict,
[ --enable-strict Enable error on compilation warning [default=yes]],
[wall_werror=$enableval],
[wall_werror=yes]
)
CFLAGS="$CFLAGS -Wall"
if test $GCC = yes && test $wall_werror = yes; then
CFLAGS="$CFLAGS -Werror "
fi
# check for libraries that have pkg-config files installed
PKG_CHECK_MODULES(ORTP, ortp >= 0.16.0,[found_ortp=true],foo=bar)
PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.0.0,[found_ms2=true],foo=bar)
AM_CONDITIONAL(BUILD_MSBCG729, test x$found_ms2 = xtrue && test x$found_ortp = xtrue)
# Create the following files from their .in counterparts
AC_CONFIG_FILES([
Makefile
src/Makefile
include/Makefile
include/bcg729/Makefile
msbcg729/Makefile
test/Makefile
test/bin/Makefile
libbcg729.pc
])
AC_OUTPUT
/*
LP2LSPConversion.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef LP2LSPCONVERSION_H
#define LP2LSPCONVERSION_H
/*****************************************************************************/
/* LP2LSPConversion : Compute polynomials, find their roots as in spec A3.2.3*/
/* parameters: */
/* -(i) LPCoefficients[] : 10 coefficients in Q12 */
/* -(o) LSPCoefficients[] : 10 coefficients in Q15 */
/* */
/* return value : */
/* - boolean: 1 if all roots found, 0 if unable to compute 10 roots */
/* */
/*****************************************************************************/
int LP2LSPConversion(word16_t LPCoefficients[], word16_t LSPCoefficients[]);
#endif /* ifndef LP2LSPCONVERSION_H */
/*
LPSynthesisFilter.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef LPSYNTHESISFILTER_H
#define LPSYNTHESISFILTER_H
/*****************************************************************************/
/* LPSynthesisFilter : as decribed in spec 4.1.6 eq77 */
/* parameters: */
/* -(i) excitationVector: u(n), the excitation, 40 values in Q0 */
/* -(i) LPCoefficients: 10 LP coefficients in Q12 */
/* -(i/o) recontructedSpeech: 50 values in Q0 */
/* [-NB_LSP_COEFF, -1] of previous values as input */
/* [0, L_SUBFRAME[ as output */
/* */
/*****************************************************************************/
void LPSynthesisFilter (word16_t *excitationVector, word16_t *LPCoefficients, word16_t *reconstructedSpeech);
#endif /* ifndef LPSYNTHESISFILTER_H */
/*
LSPQuantization.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef LSPQUANTIZATION_H
#define LSPQUANTIZATION_H
void initLSPQuantization(bcg729EncoderChannelContextStruct *encoderChannelContext);
/*****************************************************************************/
/* LSPQuantization : Convert LSP to LSF, Quantize LSF and find L parameters, */
/* qLSF->qLSP as described in spec A3.2.4 */
/* parameters: */
/* -(i/o) encoderChannelContext : the channel context data */
/* -(i) LSPCoefficients : 10 LSP coefficients in Q15 */
/* -(i) qLSPCoefficients : 10 qLSP coefficients in Q15 */
/* -(o) parameters : 4 parameters L0, L1, L2, L3 */
/* */
/*****************************************************************************/
void LSPQuantization(bcg729EncoderChannelContextStruct *encoderChannelContext, word16_t LSPCoefficients[], word16_t qLSPCoefficients[], uint16_t parameters[]);
#endif /* LSPQUANTIZATION_H */
SUBDIRS = bcg729
/*
adaptativeCodebookSearch.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef ADAPTATIVECODEBOOKSEARCH_H
#define ADAPTATIVECODEBOOKSEARCH_H
/*****************************************************************************/
/* adaptativeCodebookSearch: compute parameter P1 and P2 as in spec A.3.7 */
/* compute also adaptative codebook vector as in spec 3.7.1 */
/* parameters: */
/* -(i/o) excitationVector: [-154,0[ previous excitation as input */
/* Range [0,39[ */
/* 40 words of LPResidualSignal as substitute for current */
/* excitation (spec A.3.7) as input */
/* 40 words of adaptative codebook vector in Q0 as output */
/* Buffer in Q0 accessed in range [-154, 39] */
/* -(i/o) intPitchDelayMin: low boundary for pitch delay search */
/* -(i/o) intPitchDelayMax: low boundary for pitch delay search */
/* Boundaries are updated during first subframe search */
/* -(i) impulseResponse: 40 values as in spec A.3.5 in Q12 */
/* -(i) targetSignal: 40 values as in spec A.3.6 in Q0 */
/* */
/* -(o) intPitchDelay: the integer pitch delay */
/* -(o) fracPitchDelay: the fractionnal part of pitch delay */
/* -(o) pitchDelayCodeword: P1 or P2 codeword as in spec 3.7.2 */
/* -(o) adaptativeCodebookVector: 40 words of adaptative codebook vector*/
/* as described in spec 3.7.1, in Q0. */
/* -(i) subFrameIndex: 0 for the first subframe, 40 for the second */
/* */
/*****************************************************************************/
void adaptativeCodebookSearch(word16_t excitationVector[], int16_t *intPitchDelayMin, int16_t *intPitchDelayMax, word16_t impulseResponse[], word16_t targetSignal[],
int16_t *intPitchDelay, int16_t *fracPitchDelay, uint16_t *pitchDelayCodeword, uint16_t subFrameIndex);
#endif /* ifndef ADAPTATIVECODEBOOKSEARCH_H */
/*
basicOperationsMacros.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef BASICOPERATIONSMACROS_H
#define BASICOPERATIONSMACROS__H
#include "fixedPointMacros.h"
#endif /* ifndef BASICOPERATIONSMACROS_H */
bcg729_includedir=$(includedir)/bcg729
bcg729_include_HEADERS= encoder.h decoder.h
EXTRA_DIST=$(bcg729_include_HEADERS)
/*
decoder.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef DECODER_H
#define DECODER_H
typedef struct bcg729DecoderChannelContextStruct_struct bcg729DecoderChannelContextStruct;
#include <stdint.h>
/*****************************************************************************/
/* initBcg729DecoderChannel : create context structure and initialise it */
/* return value : */
/* - the decoder channel context data */
/* */
/*****************************************************************************/
__attribute__ ((visibility ("default"))) bcg729DecoderChannelContextStruct *initBcg729DecoderChannel();
/*****************************************************************************/
/* closeBcg729DecoderChannel : free memory of context structure */
/* parameters: */
/* -(i) decoderChannelContext : the channel context data */
/* */
/*****************************************************************************/
__attribute__ ((visibility ("default"))) void closeBcg729DecoderChannel(bcg729DecoderChannelContextStruct *decoderChannelContext);
/*****************************************************************************/
/* bcg729Decoder : */
/* parameters: */
/* -(i) decoderChannelContext : the channel context data */
/* -(i) bitStream : 15 parameters on 80 bits */
/* -(i) frameErased: flag: true, frame has been erased */
/* -(o) signal : a decoded frame 80 samples (16 bits PCM) */
/* */
/*****************************************************************************/
__attribute__ ((visibility ("default"))) void bcg729Decoder(bcg729DecoderChannelContextStruct *decoderChannelContext, uint8_t bitStream[], uint8_t frameErasureFlag, int16_t signal[]);
#endif /* ifndef DECODER_H */
/*
encoder.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef ENCODER_H
#define ENCODER_H
#include <stdint.h>
typedef struct bcg729EncoderChannelContextStruct_struct bcg729EncoderChannelContextStruct;
/*****************************************************************************/
/* initBcg729EncoderChannel : create context structure and initialise it */
/* return value : */
/* - the encoder channel context data */
/* */
/*****************************************************************************/
__attribute__ ((visibility ("default"))) bcg729EncoderChannelContextStruct *initBcg729EncoderChannel();
/*****************************************************************************/
/* closeBcg729EncoderChannel : free memory of context structure */
/* parameters: */
/* -(i) encoderChannelContext : the channel context data */
/* */
/*****************************************************************************/
__attribute__ ((visibility ("default"))) void closeBcg729EncoderChannel(bcg729EncoderChannelContextStruct *encoderChannelContext);
/*****************************************************************************/
/* bcg729Encoder : */
/* parameters: */
/* -(i) encoderChannelContext : context for this encoder channel */
/* -(i) inputFrame : 80 samples (16 bits PCM) */
/* -(o) bitStream : The 15 parameters for a frame on 80 bits */
/* on 80 bits (5 16bits words) */
/* */
/*****************************************************************************/
__attribute__ ((visibility ("default"))) void bcg729Encoder(bcg729EncoderChannelContextStruct *encoderChannelContext, int16_t inputFrame[], uint8_t bitStream[]);
#endif /* ifndef ENCODER_H */
/*
codebooks.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef CODEBOOKS_H
#define CODEBOOKS_H
#include "codecParameters.h"
/* this codebooks are defined in codebook.c */
/*** codebooks for quantization of the LSP coefficient - doc: 3.2.4 ***/
extern word16_t L1[L1_RANGE][NB_LSP_COEFF]; /* The first stage is a 10-dimensional VQ using codebook L1 with 128 entries (7 bits). in Q2.13 */
extern word16_t L2L3[L2_RANGE][NB_LSP_COEFF]; /* Doc : The second stage is a 10-bit VQ splitted in L2(first 5 values of a vector) and L3(last five value in each vector) containing 32 entries (5 bits). in Q0.13 but max value < 0.5 so fits in 13 bits. */
extern word16_t MAPredictor[L0_RANGE][MA_MAX_K][NB_LSP_COEFF]; /* the MA predictor coefficients in Q0.15 but max value < 0.5 so it fits on 15 bits */
extern word16_t MAPredictorSum[L0_RANGE][NB_LSP_COEFF]; /* 1 - Sum(MAPredictor) in Q0.15 */
extern word16_t invMAPredictorSum[L0_RANGE][NB_LSP_COEFF]; /* 1/(1 - Sum(MAPredictor)) in Q3.12 */
/* codebook for adaptative code vector */
extern word16_t b30[30];
/* codebook for gains */
extern uint16_t reverseIndexMappingGA[8];
extern uint16_t reverseIndexMappingGB[16];
extern uint16_t indexMappingGA[8];
extern uint16_t indexMappingGB[16];
extern word16_t GACodebook[8][2];
extern word16_t GBCodebook[16][2];
extern word16_t MAPredictionCoefficients[4];
/* codebook for LP Analysis */
extern word16_t wlp[L_LP_ANALYSIS_WINDOW];
extern word16_t wlag[NB_LSP_COEFF+1];
#endif /* ifndef CODEBOOKS_H */
/*
codecParameters.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef CODECPARAMETERS_H
#define CODECPARAMETERS_H
#define L_FRAME 80 /* Frame size. */
#define L_SUBFRAME 40 /* subFrame size. */
#define L_LP_ANALYSIS_WINDOW 240 /* Size of the window used in the LP Analysis */
/******************************************************************************/
/*** LSP coefficients ***/
/******************************************************************************/
/* define each coefficient bit number and range */
#define L0_LENGTH 1
#define L1_LENGTH 7
#define L2_LENGTH 5
#define L3_LENGTH 5
#define L0_RANGE (1<<L0_LENGTH)
#define L1_RANGE (1<<L1_LENGTH)
#define L2_RANGE (1<<L2_LENGTH)
#define L3_RANGE (1<<L3_LENGTH)
/* MA Prediction history length: maximum number of previous LSP used */
#define MA_MAX_K 4
/* Linear Prediction filters order: 10th order filters gives 10 (quantized) LP coefficients */
/* NB_LSP_COEFF is the number of LSP coefficient */
#define NB_LSP_COEFF 10
/* Maximum value of integer part of pitch delay */
#define MAXIMUM_INT_PITCH_DELAY 143
/* past excitation vector length: Maximum Pitch Delay (143 + 1(fractionnal part)) + Interpolation Windows Length (10) */
#define L_PAST_EXCITATION 154
/* rearrange coefficient gap in Q13 */
/* GAP1 is 0.0012, GAP2 is 0.0006 */
#define GAP1 10
#define GAP2 5
/* qLSF stability in Q13*/
/* Limits for quantized LSF */
/* in Q2.13, Max is 3.135 and Min is 0.005 */
#define qLSF_MIN 40
#define qLSF_MAX 25681
/* min distance between 2 consecutive qLSF is 0.0391 */
#define MIN_qLSF_DISTANCE 321
/* pitch gain boundaries in Q14 */
#define BOUNDED_PITCH_GAIN_MIN 3277
#define BOUNDED_PITCH_GAIN_MAX 13107
/* post filters values defined in 4.2.2 in Q15 pow 1 to 10 */
#define GAMMA_N1 18022
#define GAMMA_N2 9912
#define GAMMA_N3 5452
#define GAMMA_N4 2998
#define GAMMA_N5 1649
#define GAMMA_N6 907
#define GAMMA_N7 499
#define GAMMA_N8 274
#define GAMMA_N9 151
#define GAMMA_N10 83
#define GAMMA_D1 22938
#define GAMMA_D2 16056
#define GAMMA_D3 11239
#define GAMMA_D4 7868
#define GAMMA_D5 5507
#define GAMMA_D6 3855
#define GAMMA_D7 2699
#define GAMMA_D8 1889
#define GAMMA_D9 1322
#define GAMMA_D10 926
/* post filter value GAMMA_T 0.8 in Q15 (spec A.4.2.3)*/
#define GAMMA_T 26214
/* weighted speech for open-loop pitch delay (spec A3.3.3) in Q15 0.75^(1..10)*/
#define GAMMA_E1 24756
#define GAMMA_E2 18432
#define GAMMA_E3 13824
#define GAMMA_E4 10368
#define GAMMA_E5 7776
#define GAMMA_E6 5832
#define GAMMA_E7 4374
#define GAMMA_E8 3280
#define GAMMA_E9 2460
#define GAMMA_E10 1845
/*** Number of parameters in the encoded signal ***/
#define NB_PARAMETERS 15
/*** LP to LSP conversion ***/
#define NB_COMPUTED_VALUES_CHEBYSHEV_POLYNOMIAL 51
#endif /* ifndef CODECPARAMETERS_H */
/*
computeAdaptativeCodebookGain.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef COMPUTEADAPTATIVECODEBOOKGAIN_H
#define COMPUTEADAPTATIVECODEBOOKGAIN_H
/*****************************************************************************/
/* computeAdaptativeCodebookGain: compute gain, return result in Q14 */
/* in range [0,1.2]. Spec 3.7.3 */
/* parameters: */
/* -(i) targetSignal: 40 values in Q0 */
/* -(i) filteredAdaptativeCodebookVector: 40 values in Q0 */
/* -(o) gainQuantizationXy in Q0 on 64 bits used for gain quantization */
/* -(o) gainQuantizationYy in Q0 on 64 bits used for gain quantization */
/* return value: */
/* - the adaptative codebook gain on 16 bits in Q14 */
/* */
/*****************************************************************************/
word16_t computeAdaptativeCodebookGain(word16_t targetSignal[], word16_t filteredAdaptativeCodebookVector[], word64_t *gainQuantizationXy, word64_t *gainQuantizationYy);
#endif /* ifndef COMPUTEADAPTATIVECODEBOOKGAIN_H */
/*
computeLP.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef COMPUTELP_H
#define COMPUTELP_H
/*****************************************************************************/
/* computeLP : As described in spec 3.2.1 and 3.2.2 : Windowing, */
/* Autocorrelation and Levinson-Durbin algorithm */
/* parameters: */
/* -(i) signal: 240 samples in Q0, the last 40 are from next frame */
/* -(o) LPCoefficientsQ12: 10 LP coefficients in Q12 */
/* */
/*****************************************************************************/
void computeLP(word16_t signal[], word16_t LPCoefficientsQ12[]);
#endif /* ifndef COMPUTELP_H */
/*
computeWeightedSpeech.h
Copyright (C) 2011 Belledonne Communications, Grenoble, France
Author : Johan Pascal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef COMPUTEWEIGHTEDSPEECH
#define COMPUTEWEIGHTEDSPEECH
/*****************************************************************************/
/* computeWeightedSpeech: compute wieghted speech according to spec A3.3.3 */
/* parameters: */
/* -(i) inputSignal : 90 values buffer accessed in range [-10, 79] in Q0*/
/* -(i) qLPCoefficients: 20 coefficients(10 for each subframe) in Q12 */
/* -(i) weightedqLPCoefficients: 20 coefficients(10 for each subframe) */
/* in Q12 */
/* -(i/o) weightedInputSignal: 90 values in Q0: [-10, -1] as input */
/* [0,79] as output in Q0 */
/* -(o) LPResidualSignal: 80 values of residual signal in Q0 */
/* */
/*****************************************************************************/
void computeWeightedSpeech(word16_t inputSignal[], word16_t qLPCoefficients[], word16_t weightedqLPCoefficients[], word16_t weightedInputSignal[], word16_t LPResidualSignal[]);
#endif /* ifndef COMPUTEWEIGHTEDSPEECH */