]> git.sesse.net Git - ffmpeg/blob - libavcodec/aacsbr_tablegen.h
Merge commit '06f4b1e37a08f3fd269ecbfeb0181129e5bfc86e'
[ffmpeg] / libavcodec / aacsbr_tablegen.h
1 /*
2  * Header file for hardcoded AAC SBR windows
3  *
4  * Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22
23 #ifndef AVCODEC_AACSBR_TABLEGEN_H
24 #define AVCODEC_AACSBR_TABLEGEN_H
25
26 #if CONFIG_HARDCODED_TABLES
27 #define aacsbr_tableinit()
28 #include "libavcodec/aacsbr_tables.h"
29 #else
30 ///< window coefficients for analysis/synthesis QMF banks
31 static DECLARE_ALIGNED(32, float, sbr_qmf_window_ds)[320];
32 static DECLARE_ALIGNED(32, float, sbr_qmf_window_us)[640] = {
33      0.0000000000, -0.0005525286, -0.0005617692, -0.0004947518,
34     -0.0004875227, -0.0004893791, -0.0005040714, -0.0005226564,
35     -0.0005466565, -0.0005677802, -0.0005870930, -0.0006132747,
36     -0.0006312493, -0.0006540333, -0.0006777690, -0.0006941614,
37     -0.0007157736, -0.0007255043, -0.0007440941, -0.0007490598,
38     -0.0007681371, -0.0007724848, -0.0007834332, -0.0007779869,
39     -0.0007803664, -0.0007801449, -0.0007757977, -0.0007630793,
40     -0.0007530001, -0.0007319357, -0.0007215391, -0.0006917937,
41     -0.0006650415, -0.0006341594, -0.0005946118, -0.0005564576,
42     -0.0005145572, -0.0004606325, -0.0004095121, -0.0003501175,
43     -0.0002896981, -0.0002098337, -0.0001446380, -0.0000617334,
44      0.0000134949,  0.0001094383,  0.0002043017,  0.0002949531,
45      0.0004026540,  0.0005107388,  0.0006239376,  0.0007458025,
46      0.0008608443,  0.0009885988,  0.0011250155,  0.0012577884,
47      0.0013902494,  0.0015443219,  0.0016868083,  0.0018348265,
48      0.0019841140,  0.0021461583,  0.0023017254,  0.0024625616,
49      0.0026201758,  0.0027870464,  0.0029469447,  0.0031125420,
50      0.0032739613,  0.0034418874,  0.0036008268,  0.0037603922,
51      0.0039207432,  0.0040819753,  0.0042264269,  0.0043730719,
52      0.0045209852,  0.0046606460,  0.0047932560,  0.0049137603,
53      0.0050393022,  0.0051407353,  0.0052461166,  0.0053471681,
54      0.0054196775,  0.0054876040,  0.0055475714,  0.0055938023,
55      0.0056220643,  0.0056455196,  0.0056389199,  0.0056266114,
56      0.0055917128,  0.0055404363,  0.0054753783,  0.0053838975,
57      0.0052715758,  0.0051382275,  0.0049839687,  0.0048109469,
58      0.0046039530,  0.0043801861,  0.0041251642,  0.0038456408,
59      0.0035401246,  0.0032091885,  0.0028446757,  0.0024508540,
60      0.0020274176,  0.0015784682,  0.0010902329,  0.0005832264,
61      0.0000276045, -0.0005464280, -0.0011568135, -0.0018039472,
62     -0.0024826723, -0.0031933778, -0.0039401124, -0.0047222596,
63     -0.0055337211, -0.0063792293, -0.0072615816, -0.0081798233,
64     -0.0091325329, -0.0101150215, -0.0111315548, -0.0121849995,
65      0.0132718220,  0.0143904666,  0.0155405553,  0.0167324712,
66      0.0179433381,  0.0191872431,  0.0204531793,  0.0217467550,
67      0.0230680169,  0.0244160992,  0.0257875847,  0.0271859429,
68      0.0286072173,  0.0300502657,  0.0315017608,  0.0329754081,
69      0.0344620948,  0.0359697560,  0.0374812850,  0.0390053679,
70      0.0405349170,  0.0420649094,  0.0436097542,  0.0451488405,
71      0.0466843027,  0.0482165720,  0.0497385755,  0.0512556155,
72      0.0527630746,  0.0542452768,  0.0557173648,  0.0571616450,
73      0.0585915683,  0.0599837480,  0.0613455171,  0.0626857808,
74      0.0639715898,  0.0652247106,  0.0664367512,  0.0676075985,
75      0.0687043828,  0.0697630244,  0.0707628710,  0.0717002673,
76      0.0725682583,  0.0733620255,  0.0741003642,  0.0747452558,
77      0.0753137336,  0.0758008358,  0.0761992479,  0.0764992170,
78      0.0767093490,  0.0768173975,  0.0768230011,  0.0767204924,
79      0.0765050718,  0.0761748321,  0.0757305756,  0.0751576255,
80      0.0744664394,  0.0736406005,  0.0726774642,  0.0715826364,
81      0.0703533073,  0.0689664013,  0.0674525021,  0.0657690668,
82      0.0639444805,  0.0619602779,  0.0598166570,  0.0575152691,
83      0.0550460034,  0.0524093821,  0.0495978676,  0.0466303305,
84      0.0434768782,  0.0401458278,  0.0366418116,  0.0329583930,
85      0.0290824006,  0.0250307561,  0.0207997072,  0.0163701258,
86      0.0117623832,  0.0069636862,  0.0019765601, -0.0032086896,
87     -0.0085711749, -0.0141288827, -0.0198834129, -0.0258227288,
88     -0.0319531274, -0.0382776572, -0.0447806821, -0.0514804176,
89     -0.0583705326, -0.0654409853, -0.0726943300, -0.0801372934,
90     -0.0877547536, -0.0955533352, -0.1035329531, -0.1116826931,
91     -0.1200077984, -0.1285002850, -0.1371551761, -0.1459766491,
92     -0.1549607071, -0.1640958855, -0.1733808172, -0.1828172548,
93     -0.1923966745, -0.2021250176, -0.2119735853, -0.2219652696,
94     -0.2320690870, -0.2423016884, -0.2526480309, -0.2631053299,
95     -0.2736634040, -0.2843214189, -0.2950716717, -0.3059098575,
96     -0.3168278913, -0.3278113727, -0.3388722693, -0.3499914122,
97      0.3611589903,  0.3723795546,  0.3836350013,  0.3949211761,
98      0.4062317676,  0.4175696896,  0.4289119920,  0.4402553754,
99      0.4515996535,  0.4629308085,  0.4742453214,  0.4855253091,
100      0.4967708254,  0.5079817500,  0.5191234970,  0.5302240895,
101      0.5412553448,  0.5522051258,  0.5630789140,  0.5738524131,
102      0.5845403235,  0.5951123086,  0.6055783538,  0.6159109932,
103      0.6261242695,  0.6361980107,  0.6461269695,  0.6559016302,
104      0.6655139880,  0.6749663190,  0.6842353293,  0.6933282376,
105      0.7022388719,  0.7109410426,  0.7194462634,  0.7277448900,
106      0.7358211758,  0.7436827863,  0.7513137456,  0.7587080760,
107      0.7658674865,  0.7727780881,  0.7794287519,  0.7858353120,
108      0.7919735841,  0.7978466413,  0.8034485751,  0.8087695004,
109      0.8138191270,  0.8185776004,  0.8230419890,  0.8272275347,
110      0.8311038457,  0.8346937361,  0.8379717337,  0.8409541392,
111      0.8436238281,  0.8459818469,  0.8480315777,  0.8497805198,
112      0.8511971524,  0.8523047035,  0.8531020949,  0.8535720573,
113      0.8537385600,
114 };
115
116 static av_cold void aacsbr_tableinit(void)
117 {
118     int n;
119     for (n = 1; n < 320; n++)
120         sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n];
121     sbr_qmf_window_us[384] = -sbr_qmf_window_us[384];
122     sbr_qmf_window_us[512] = -sbr_qmf_window_us[512];
123
124     for (n = 0; n < 320; n++)
125         sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n];
126 }
127 #endif /* CONFIG_HARDCODED_TABLES */
128
129 #endif /* AVCODEC_AACSBR_TABLEGEN_H */