aacps: Adjust some const qualifiers to suppress warnings
[libav.git] / libavcodec / aacps_tablegen.c
CommitLineData
a2063901
AC
1/*
2 * Generate a header file for hardcoded Parametric Stereo tables
3 *
4 * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
5 *
2912e87a 6 * This file is part of Libav.
a2063901 7 *
2912e87a 8 * Libav is free software; you can redistribute it and/or
a2063901
AC
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 *
2912e87a 13 * Libav is distributed in the hope that it will be useful,
a2063901
AC
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
2912e87a 19 * License along with Libav; if not, write to the Free Software
a2063901
AC
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#include <stdlib.h>
24#define CONFIG_HARDCODED_TABLES 0
fd6eb4a0 25#include "aacps_tablegen.h"
a2063901
AC
26#include "tableprint.h"
27
28void write_float_3d_array (const void *p, int b, int c, int d)
29{
30 int i;
31 const float *f = p;
32 for (i = 0; i < b; i++) {
33 printf("{\n");
34 write_float_2d_array(f, c, d);
35 printf("},\n");
36 f += c * d;
37 }
38}
39
40void write_float_4d_array (const void *p, int a, int b, int c, int d)
41{
42 int i;
43 const float *f = p;
44 for (i = 0; i < a; i++) {
45 printf("{\n");
46 write_float_3d_array(f, b, c, d);
47 printf("},\n");
48 f += b * c * d;
49 }
50}
51
52int main(void)
53{
54 ps_tableinit();
55
56 write_fileheader();
57
58 printf("static const float pd_re_smooth[8*8*8] = {\n");
59 write_float_array(pd_re_smooth, 8*8*8);
60 printf("};\n");
61 printf("static const float pd_im_smooth[8*8*8] = {\n");
62 write_float_array(pd_im_smooth, 8*8*8);
63 printf("};\n");
64
65 printf("static const float HA[46][8][4] = {\n");
66 write_float_3d_array(HA, 46, 8, 4);
67 printf("};\n");
68 printf("static const float HB[46][8][4] = {\n");
69 write_float_3d_array(HB, 46, 8, 4);
70 printf("};\n");
71
47d18d53
MR
72 printf("static const DECLARE_ALIGNED(16, float, f20_0_8)[8][8][2] = {\n");
73 write_float_3d_array(f20_0_8, 8, 8, 2);
a2063901 74 printf("};\n");
47d18d53
MR
75 printf("static const DECLARE_ALIGNED(16, float, f34_0_12)[12][8][2] = {\n");
76 write_float_3d_array(f34_0_12, 12, 8, 2);
a2063901 77 printf("};\n");
47d18d53
MR
78 printf("static const DECLARE_ALIGNED(16, float, f34_1_8)[8][8][2] = {\n");
79 write_float_3d_array(f34_1_8, 8, 8, 2);
a2063901 80 printf("};\n");
47d18d53
MR
81 printf("static const DECLARE_ALIGNED(16, float, f34_2_4)[4][8][2] = {\n");
82 write_float_3d_array(f34_2_4, 4, 8, 2);
a2063901
AC
83 printf("};\n");
84
0ba8ba16 85 printf("static TABLE_CONST DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2] = {\n");
a2063901
AC
86 write_float_4d_array(Q_fract_allpass, 2, 50, 3, 2);
87 printf("};\n");
47d18d53 88 printf("static const DECLARE_ALIGNED(16, float, phi_fract)[2][50][2] = {\n");
a2063901
AC
89 write_float_3d_array(phi_fract, 2, 50, 2);
90 printf("};\n");
91
92 return 0;
93}