Home | History | Annotate | Download | only in include
      1 /*---------------------------------------------------------------------------*
      2  *  fronttyp.h  *
      3  *                                                                           *
      4  *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
      5  *                                                                           *
      6  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
      7  *  you may not use this file except in compliance with the License.         *
      8  *                                                                           *
      9  *  You may obtain a copy of the License at                                  *
     10  *      http://www.apache.org/licenses/LICENSE-2.0                           *
     11  *                                                                           *
     12  *  Unless required by applicable law or agreed to in writing, software      *
     13  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
     14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
     15  *  See the License for the specific language governing permissions and      *
     16  *  limitations under the License.                                           *
     17  *                                                                           *
     18  *---------------------------------------------------------------------------*/
     19 
     20 #ifndef _h_fronttyp_
     21 #define _h_fronttyp_
     22 
     23 typedef long     bigdata;
     24 typedef int     coefdata;
     25 typedef short     samdata;
     26 typedef int     fftdata; /* TODO: Swap in fixed point datatype when working */
     27 typedef int     cepdata;
     28 
     29 /******************************************************************************
     30 **  Fixed point processing macros. These are defined in non-fixed point build also.
     31 *******************************************************************************/
     32 
     33 #define COEFDATA_SIZE   32 /* coefficients */
     34 #define SAMDATA_SIZE    16 /* samples */
     35 #define FFTDATA_SIZE    32 /* fft internal data */
     36 #define CEPDATA_SIZE    32 /* cepstrum internal data */
     37 
     38 #define HALF_COEFDATA_SIZE      (COEFDATA_SIZE >> 1)
     39 #define HALF_SAMDATA_SIZE       (SAMDATA_SIZE >> 1)
     40 #define HALF_FFTDATA_SIZE       (FFTDATA_SIZE >> 1)
     41 #define HALF_CEPDATA_SIZE       (CEPDATA_SIZE >> 1)
     42 #define QUART_CEPDATA_SIZE      (CEPDATA_SIZE >> 2)
     43 #define QUART_FFTDATA_SIZE      (CEPDATA_SIZE >> 2)
     44 
     45 /*  scaling in terms of shifts */
     46 #define COSINE_TABLE_SHIFT HALF_CEPDATA_SIZE   /* minimum 5 */
     47 #define RAMP_SHIFT  6
     48 #define HALF_RAMP_SHIFT  (RAMP_SHIFT >> 1)
     49 #define COEFDATA_SHIFT  8
     50 #define HALF_COEFDATA_SHIFT (COEFDATA_SHIFT >> 1)
     51 #define WAVE_SHIFT  0
     52 #define BYTERANGE_SHIFT  1
     53 
     54 #endif
     55