/*
***********************************************************************
*
* Copyright (C) 1999 Ericsson Radio Systems AB
* 
* The Association of Radio Industries and Businesses (ARIB) has the
* licence to reproduce, distribute and publish the Bit Exact C Code
* programs in this CD-ROM together with the other parts of the RCR
* STD-27 (Personal Digital Cellular Telecommunication System)
* specification.
* 
* Ericsson has declared Option 1 (royalty-free licence) to ARIB for
* its Essential Industrial Property Rights related to the ACELP
* specification and the Bit Exact C Code programs. The royalty-free
* licence is limited to the development and manufacturing of
* products complying with the RCR STD-27H specification (or
* subsequent versions) for sale and use in Japan. Copying of the
* program(s) for any other purpose requires the prior written
* permission from Ericsson.
* 
* The user of the Bit Exact C Code hereby acknowledges the
* following:
* 
* 1.  Ericsson does not provide the user with any warranties,
*     whether express or implied, including but not limited to
*     warranties of merchantability and fitness for a particular
*     purpose relating to the Bit Exact C Code.
* 
* 2.  Ericsson shall have no responsibility whatsoever to indemnify
*     the user against actions or claims for infringement of any
*     intellectual property rights, e.g. patents, copyrights,
*     registered designs or any other rights, by reason of the
*     user's use of the Bit Exact C Code.
* 
***********************************************************************
*/

/*************************************************************************
 *    FILE NAME: cnst.h
 *
 *    PURPOSE: defines codec constant parameters
 *
 *************************************************************************/

#define  L_TOTAL      240     /* Total size of speech buffer.               */
#define  L_WINDOW     240     /* window size in LP analysis                 */
#define  L_NEXT       40      /* Overhead in LP analysis                    */
#define  L_FRAME      160     /* Frame size                                 */
#define  L_FRAME_BY2  80      /* Frame size divided by 2                    */
#define  L_SUBFR      40      /* Subframe size                              */
#define  M            10      /* Order of LP filter                         */
#define  MP1          (M+1)   /* Order of LP filter + 1                     */
#define  AZ_SIZE      (4*M+4) /* Size of array of LP filters in 4 subframes */
#define  PIT_MIN      20      /* Minimum pitch lag                          */
#define  PIT_MAX      143     /* Maximum pitch lag                          */
#define  L_INTERPOL   (10+1)  /* Length of filter for interpolation         */
#define  GAMMA1       30802   /* Weighting factor (numerator)               */
#define  GAMMA2       19661   /* Weighting factor (denominator)             */

#define SHARPMAX  13017       /* Maximum value of pitch sharpening          */
#define SHARPMIN  0           /* Minimum value of pitch sharpening          */

#define  PRM_SIZE     21      /* Size of vector of analysis parameters      */
#define  SERIAL_SIZE  137     /* bits per frame                             */

#define  GAMMA3   18022       /* Formant postfilt factor (numerator)        */
#define  GAMMA4   22938       /* Formant postfilt factor (denominator)      */

#define  MU       26214       /* Factor for tilt compensation filter        */
#define  AGC_FAC  29491       /* Factor for automatic gain control          */
#define  NB_PULSE 10          /* number of random pulses in VOX operation   */

#define GP_CLIP   15565       /* Pitch gain clipping = 0.95                 */
#define N_FRAME   7           /* old pitch gains in average calculation     */
