codebooks.h 2.79 KB
Newer Older
johan's avatar
johan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 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
19
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
johan's avatar
johan committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33
 */
#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 */
34 35 36 37
/* same as above but used for SID frame */
extern word16_t noiseMAPredictor[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 noiseMAPredictorSum[L0_RANGE][NB_LSP_COEFF]; /* 1 - Sum(MAPredictor) in Q0.15 */
extern word16_t invNoiseMAPredictorSum[L0_RANGE][NB_LSP_COEFF]; /* 1/(1 - Sum(MAPredictor)) in Q3.12 */
johan's avatar
johan committed
38 39

/* codebook for adaptative code vector */
40
extern word16_t b30[31];
johan's avatar
johan committed
41 42 43 44 45 46 47 48 49

/* 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];
50 51 52 53 54 55 56
extern word16_t SIDGainCodebook[32];
extern uint8_t L1SubsetIndex[32];
extern uint8_t L2SubsetIndex[16];
extern uint8_t L3SubsetIndex[16];

/* codebook for VAD */
extern word16_t lowBandFilter[NB_LSP_COEFF+3];
johan's avatar
johan committed
57 58 59

/* codebook for LP Analysis */
extern word16_t wlp[L_LP_ANALYSIS_WINDOW];
60
extern word16_t wlag[NB_LSP_COEFF+3];
johan's avatar
johan committed
61
#endif /* ifndef CODEBOOKS_H */