Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /******************************************************************** |
michael@0 | 2 | * * |
michael@0 | 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * |
michael@0 | 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
michael@0 | 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
michael@0 | 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
michael@0 | 7 | * * |
michael@0 | 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * |
michael@0 | 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * |
michael@0 | 10 | * * |
michael@0 | 11 | ******************************************************************** |
michael@0 | 12 | |
michael@0 | 13 | function: modified discrete cosine transform prototypes |
michael@0 | 14 | last mod: $Id: mdct.h 16227 2009-07-08 06:58:46Z xiphmont $ |
michael@0 | 15 | |
michael@0 | 16 | ********************************************************************/ |
michael@0 | 17 | |
michael@0 | 18 | #ifndef _OGG_mdct_H_ |
michael@0 | 19 | #define _OGG_mdct_H_ |
michael@0 | 20 | |
michael@0 | 21 | #include "vorbis/codec.h" |
michael@0 | 22 | |
michael@0 | 23 | |
michael@0 | 24 | |
michael@0 | 25 | |
michael@0 | 26 | |
michael@0 | 27 | /*#define MDCT_INTEGERIZED <- be warned there could be some hurt left here*/ |
michael@0 | 28 | #ifdef MDCT_INTEGERIZED |
michael@0 | 29 | |
michael@0 | 30 | #define DATA_TYPE int |
michael@0 | 31 | #define REG_TYPE register int |
michael@0 | 32 | #define TRIGBITS 14 |
michael@0 | 33 | #define cPI3_8 6270 |
michael@0 | 34 | #define cPI2_8 11585 |
michael@0 | 35 | #define cPI1_8 15137 |
michael@0 | 36 | |
michael@0 | 37 | #define FLOAT_CONV(x) ((int)((x)*(1<<TRIGBITS)+.5)) |
michael@0 | 38 | #define MULT_NORM(x) ((x)>>TRIGBITS) |
michael@0 | 39 | #define HALVE(x) ((x)>>1) |
michael@0 | 40 | |
michael@0 | 41 | #else |
michael@0 | 42 | |
michael@0 | 43 | #define DATA_TYPE float |
michael@0 | 44 | #define REG_TYPE float |
michael@0 | 45 | #define cPI3_8 .38268343236508977175F |
michael@0 | 46 | #define cPI2_8 .70710678118654752441F |
michael@0 | 47 | #define cPI1_8 .92387953251128675613F |
michael@0 | 48 | |
michael@0 | 49 | #define FLOAT_CONV(x) (x) |
michael@0 | 50 | #define MULT_NORM(x) (x) |
michael@0 | 51 | #define HALVE(x) ((x)*.5f) |
michael@0 | 52 | |
michael@0 | 53 | #endif |
michael@0 | 54 | |
michael@0 | 55 | |
michael@0 | 56 | typedef struct { |
michael@0 | 57 | int n; |
michael@0 | 58 | int log2n; |
michael@0 | 59 | |
michael@0 | 60 | DATA_TYPE *trig; |
michael@0 | 61 | int *bitrev; |
michael@0 | 62 | |
michael@0 | 63 | DATA_TYPE scale; |
michael@0 | 64 | } mdct_lookup; |
michael@0 | 65 | |
michael@0 | 66 | extern void mdct_init(mdct_lookup *lookup,int n); |
michael@0 | 67 | extern void mdct_clear(mdct_lookup *l); |
michael@0 | 68 | extern void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out); |
michael@0 | 69 | extern void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out); |
michael@0 | 70 | |
michael@0 | 71 | #endif |