vrshoot

diff libs/vorbis/mdct.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/vorbis/mdct.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,71 @@
     1.4 +/********************************************************************
     1.5 + *                                                                  *
     1.6 + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
     1.7 + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
     1.8 + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
     1.9 + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
    1.10 + *                                                                  *
    1.11 + * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009             *
    1.12 + * by the Xiph.Org Foundation http://www.xiph.org/                  *
    1.13 + *                                                                  *
    1.14 + ********************************************************************
    1.15 +
    1.16 + function: modified discrete cosine transform prototypes
    1.17 + last mod: $Id: mdct.h 16227 2009-07-08 06:58:46Z xiphmont $
    1.18 +
    1.19 + ********************************************************************/
    1.20 +
    1.21 +#ifndef _OGG_mdct_H_
    1.22 +#define _OGG_mdct_H_
    1.23 +
    1.24 +#include "vorbis/codec.h"
    1.25 +
    1.26 +
    1.27 +
    1.28 +
    1.29 +
    1.30 +/*#define MDCT_INTEGERIZED  <- be warned there could be some hurt left here*/
    1.31 +#ifdef MDCT_INTEGERIZED
    1.32 +
    1.33 +#define DATA_TYPE int
    1.34 +#define REG_TYPE  register int
    1.35 +#define TRIGBITS 14
    1.36 +#define cPI3_8 6270
    1.37 +#define cPI2_8 11585
    1.38 +#define cPI1_8 15137
    1.39 +
    1.40 +#define FLOAT_CONV(x) ((int)((x)*(1<<TRIGBITS)+.5))
    1.41 +#define MULT_NORM(x) ((x)>>TRIGBITS)
    1.42 +#define HALVE(x) ((x)>>1)
    1.43 +
    1.44 +#else
    1.45 +
    1.46 +#define DATA_TYPE float
    1.47 +#define REG_TYPE  float
    1.48 +#define cPI3_8 .38268343236508977175F
    1.49 +#define cPI2_8 .70710678118654752441F
    1.50 +#define cPI1_8 .92387953251128675613F
    1.51 +
    1.52 +#define FLOAT_CONV(x) (x)
    1.53 +#define MULT_NORM(x) (x)
    1.54 +#define HALVE(x) ((x)*.5f)
    1.55 +
    1.56 +#endif
    1.57 +
    1.58 +
    1.59 +typedef struct {
    1.60 +  int n;
    1.61 +  int log2n;
    1.62 +
    1.63 +  DATA_TYPE *trig;
    1.64 +  int       *bitrev;
    1.65 +
    1.66 +  DATA_TYPE scale;
    1.67 +} mdct_lookup;
    1.68 +
    1.69 +extern void mdct_init(mdct_lookup *lookup,int n);
    1.70 +extern void mdct_clear(mdct_lookup *l);
    1.71 +extern void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);
    1.72 +extern void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);
    1.73 +
    1.74 +#endif