FFmpeg
Loading...
Searching...
No Matches
aacps_tablegen_template.c
Go to the documentation of this file.
1/*
2 * Generate a header file for hardcoded Parametric Stereo tables
3 *
4 * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
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#include <stdlib.h>
24#define BUILD_TABLES
25#include "config.h"
26#undef ASSERT_LEVEL
27#undef CONFIG_HARDCODED_TABLES
28#define CONFIG_HARDCODED_TABLES 0
29#include "aac_defines.h"
30
31#if USE_FIXED
32#define TYPE_NAME "int32_t"
33typedef int32_t INT32FLOAT;
34#define ARRAY_RENAME(x) write_int32_t_ ## x
35#define ARRAY_URENAME(x) write_uint32_t_ ## x
37#else
38#define TYPE_NAME "float"
39typedef float INT32FLOAT;
40#define ARRAY_RENAME(x) write_float_ ## x
41#define ARRAY_URENAME(x) write_float_ ## x
42#include "aacps_tablegen.h"
43#endif /* USE_FIXED */
44#include "tableprint.h"
45
46void ARRAY_RENAME(3d_array) (const void *p, int b, int c, int d)
47{
48 int i;
49 const INT32FLOAT *f = p;
50 for (i = 0; i < b; i++) {
51 printf("{\n");
52 ARRAY_URENAME(2d_array)(f, c, d);
53 printf("},\n");
54 f += c * d;
55 }
56}
57
58void ARRAY_RENAME(4d_array) (const void *p, int a, int b, int c, int d)
59{
60 int i;
61 const INT32FLOAT *f = p;
62 for (i = 0; i < a; i++) {
63 printf("{\n");
64 ARRAY_RENAME(3d_array)(f, b, c, d);
65 printf("},\n");
66 f += b * c * d;
67 }
68}
69
70int main(void)
71{
73
75
76 printf("static const %s pd_re_smooth[8*8*8] = {\n", TYPE_NAME);
78 printf("};\n");
79 printf("static const %s pd_im_smooth[8*8*8] = {\n", TYPE_NAME);
81 printf("};\n");
82
83 printf("static const %s HA[46][8][4] = {\n", TYPE_NAME);
84 ARRAY_RENAME(3d_array)(HA, 46, 8, 4);
85 printf("};\n");
86 printf("static const %s HB[46][8][4] = {\n", TYPE_NAME);
87 ARRAY_RENAME(3d_array)(HB, 46, 8, 4);
88 printf("};\n");
89
90 printf("static const DECLARE_ALIGNED(16, %s, f20_0_8)[8][8][2] = {\n", TYPE_NAME);
91 ARRAY_RENAME(3d_array)(f20_0_8, 8, 8, 2);
92 printf("};\n");
93 printf("static const DECLARE_ALIGNED(16, %s, f34_0_12)[12][8][2] = {\n", TYPE_NAME);
94 ARRAY_RENAME(3d_array)(f34_0_12, 12, 8, 2);
95 printf("};\n");
96 printf("static const DECLARE_ALIGNED(16, %s, f34_1_8)[8][8][2] = {\n", TYPE_NAME);
97 ARRAY_RENAME(3d_array)(f34_1_8, 8, 8, 2);
98 printf("};\n");
99 printf("static const DECLARE_ALIGNED(16, %s, f34_2_4)[4][8][2] = {\n", TYPE_NAME);
100 ARRAY_RENAME(3d_array)(f34_2_4, 4, 8, 2);
101 printf("};\n");
102
103 printf("static const DECLARE_ALIGNED(16, %s, Q_fract_allpass)[2][50][3][2] = {\n", TYPE_NAME);
104 ARRAY_RENAME(4d_array)(Q_fract_allpass, 2, 50, 3, 2);
105 printf("};\n");
106 printf("static const DECLARE_ALIGNED(16, %s, phi_fract)[2][50][2] = {\n", TYPE_NAME);
107 ARRAY_RENAME(3d_array)(phi_fract, 2, 50, 2);
108 printf("};\n");
109
110 return 0;
111}
static int phi_fract[2][50][2]
static int f20_0_8[8][8][2]
static int pd_re_smooth[8 *8 *8]
static int HA[46][8][4]
static int HB[46][8][4]
static int pd_im_smooth[8 *8 *8]
static int f34_0_12[12][8][2]
static int f34_2_4[4][8][2]
static int f34_1_8[8][8][2]
static void ps_tableinit(void)
static TABLE_CONST int Q_fract_allpass[2][50][3][2]
#define ARRAY_URENAME(x)
float INT32FLOAT
int main(void)
#define TYPE_NAME
#define ARRAY_RENAME(x)
int32_t
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define f(width, name)
Definition cbs_vp8.c:236
__device__ int printf(const char *,...)
int a
#define b
Definition input.c:43
static void write_fileheader(void)
Definition tableprint.h:128
static int array[MAX_W *MAX_W]
static double c[64]