xref: /aosp_15_r20/external/tremolo/Tremolo/mdct.h (revision bda690e46497e1f65c5077173b9c548e6e0cd5a1)
1*bda690e4SXin Li /************************************************************************
2*bda690e4SXin Li  * Copyright (C) 2002-2009, Xiph.org Foundation
3*bda690e4SXin Li  * Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
4*bda690e4SXin Li  * All rights reserved.
5*bda690e4SXin Li  *
6*bda690e4SXin Li  * Redistribution and use in source and binary forms, with or without
7*bda690e4SXin Li  * modification, are permitted provided that the following conditions
8*bda690e4SXin Li  * are met:
9*bda690e4SXin Li  *
10*bda690e4SXin Li  *     * Redistributions of source code must retain the above copyright
11*bda690e4SXin Li  * notice, this list of conditions and the following disclaimer.
12*bda690e4SXin Li  *     * Redistributions in binary form must reproduce the above
13*bda690e4SXin Li  * copyright notice, this list of conditions and the following disclaimer
14*bda690e4SXin Li  * in the documentation and/or other materials provided with the
15*bda690e4SXin Li  * distribution.
16*bda690e4SXin Li  *     * Neither the names of the Xiph.org Foundation nor Pinknoise
17*bda690e4SXin Li  * Productions Ltd nor the names of its contributors may be used to
18*bda690e4SXin Li  * endorse or promote products derived from this software without
19*bda690e4SXin Li  * specific prior written permission.
20*bda690e4SXin Li  *
21*bda690e4SXin Li  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22*bda690e4SXin Li  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23*bda690e4SXin Li  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24*bda690e4SXin Li  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25*bda690e4SXin Li  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26*bda690e4SXin Li  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27*bda690e4SXin Li  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28*bda690e4SXin Li  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29*bda690e4SXin Li  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30*bda690e4SXin Li  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31*bda690e4SXin Li  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32*bda690e4SXin Li  ************************************************************************
33*bda690e4SXin Li 
34*bda690e4SXin Li  function: modified discrete cosine transform prototypes
35*bda690e4SXin Li 
36*bda690e4SXin Li  ************************************************************************/
37*bda690e4SXin Li 
38*bda690e4SXin Li #ifndef _OGG_mdct_H_
39*bda690e4SXin Li #define _OGG_mdct_H_
40*bda690e4SXin Li 
41*bda690e4SXin Li #include "ivorbiscodec.h"
42*bda690e4SXin Li #include "misc.h"
43*bda690e4SXin Li 
44*bda690e4SXin Li #define DATA_TYPE ogg_int32_t
45*bda690e4SXin Li #define REG_TYPE  register ogg_int32_t
46*bda690e4SXin Li 
47*bda690e4SXin Li #ifdef _LOW_ACCURACY_
48*bda690e4SXin Li #define cPI3_8 (0x0062)
49*bda690e4SXin Li #define cPI2_8 (0x00b5)
50*bda690e4SXin Li #define cPI1_8 (0x00ed)
51*bda690e4SXin Li #else
52*bda690e4SXin Li #define cPI3_8 (0x30fbc54d)
53*bda690e4SXin Li #define cPI2_8 (0x5a82799a)
54*bda690e4SXin Li #define cPI1_8 (0x7641af3d)
55*bda690e4SXin Li #endif
56*bda690e4SXin Li 
57*bda690e4SXin Li extern void mdct_backward(int n, DATA_TYPE *in);
58*bda690e4SXin Li extern void mdct_shift_right(int n, DATA_TYPE *in, DATA_TYPE *right);
59*bda690e4SXin Li extern void mdct_unroll_lap(int n0,int n1,
60*bda690e4SXin Li 			    int lW,int W,
61*bda690e4SXin Li 			    DATA_TYPE *in,DATA_TYPE *right,
62*bda690e4SXin Li 			    LOOKUP_T *w0,LOOKUP_T *w1,
63*bda690e4SXin Li 			    ogg_int16_t *out,
64*bda690e4SXin Li 			    int step,
65*bda690e4SXin Li 			    int start,int end /* samples, this frame */);
66*bda690e4SXin Li 
67*bda690e4SXin Li #endif
68*bda690e4SXin Li 
69*bda690e4SXin Li 
70*bda690e4SXin Li 
71*bda690e4SXin Li 
72*bda690e4SXin Li 
73*bda690e4SXin Li 
74*bda690e4SXin Li 
75*bda690e4SXin Li 
76*bda690e4SXin Li 
77*bda690e4SXin Li 
78*bda690e4SXin Li 
79*bda690e4SXin Li 
80