cnst.h revision 956c553ab0ce72f8074ad0fda2ffd66a0305700c
1/*
2 ** Copyright 2003-2010, VisualOn, Inc.
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 **     http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16
17
18/*--------------------------------------------------------------------------*
19 *                         CNST.H                                           *
20 *--------------------------------------------------------------------------*
21 *       Codec constant parameters (coder and decoder)                      *
22 *--------------------------------------------------------------------------*/
23
24#ifndef __CNST_H__
25#define __CNST_H__
26
27#define L_FRAME16k   320                   /* Frame size at 16kHz                        */
28#define L_FRAME      256                   /* Frame size                                 */
29#define L_SUBFR16k   80                    /* Subframe size at 16kHz                     */
30
31#define L_SUBFR      64                    /* Subframe size                              */
32#define NB_SUBFR     4                     /* Number of subframe per frame               */
33
34#define L_NEXT       64                    /* Overhead in LP analysis                    */
35#define L_WINDOW     384                   /* window size in LP analysis                 */
36#define L_TOTAL      384                   /* Total size of speech buffer.               */
37#define M            16                    /* Order of LP filter                         */
38#define M16k         20
39
40#define L_FILT16k    15                    /* Delay of down-sampling filter              */
41#define L_FILT       12                    /* Delay of up-sampling filter                */
42
43#define GP_CLIP      15565                 /* Pitch gain clipping = 0.95 Q14             */
44#define PIT_SHARP    27853                 /* pitch sharpening factor = 0.85 Q15         */
45
46#define PIT_MIN      34                    /* Minimum pitch lag with resolution 1/4      */
47#define PIT_FR2      128                   /* Minimum pitch lag with resolution 1/2      */
48#define PIT_FR1_9b   160                   /* Minimum pitch lag with resolution 1        */
49#define PIT_FR1_8b   92                    /* Minimum pitch lag with resolution 1        */
50#define PIT_MAX      231                   /* Maximum pitch lag                          */
51#define L_INTERPOL   (16+1)                /* Length of filter for interpolation         */
52
53#define OPL_DECIM    2                     /* Decimation in open-loop pitch analysis     */
54
55#define PREEMPH_FAC  22282                 /* preemphasis factor (0.68 in Q15)           */
56#define GAMMA1       30147                 /* Weighting factor (numerator) (0.92 in Q15) */
57#define TILT_FAC     22282                 /* tilt factor (denominator) (0.68 in Q15)    */
58
59#define Q_MAX        8                     /* scaling max for signal (see syn_filt_32)   */
60
61#define RANDOM_INITSEED  21845             /* own random init value                      */
62
63#define L_MEANBUF        3
64#define ONE_PER_MEANBUF 10923
65
66#define MODE_7k       0
67#define MODE_9k       1
68#define MODE_12k      2
69#define MODE_14k      3
70#define MODE_16k      4
71#define MODE_18k      5
72#define MODE_20k      6
73#define MODE_23k      7
74#define MODE_24k      8
75#define MRDTX         9
76#define NUM_OF_MODES  10                   /* see bits.h for bits definition             */
77
78#define EHF_MASK (Word16)0x0008            /* homing frame pattern                       */
79
80#endif //__CNST_H__
81
82