FFmpeg
cbrt_data.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVCODEC_CBRT_DATA_H
22 #define AVCODEC_CBRT_DATA_H
23 
24 #include <stdint.h>
25 
26 #define LUT_SIZE (1 << 13)
27 
28 #ifndef BUILD_TABLES
29 #include "config.h"
30 #define BUILD_TABLES !CONFIG_HARDCODED_TABLES
31 #endif
32 
33 #if !BUILD_TABLES
34 #define ff_cbrt_tableinit_fixed()
35 #define ff_cbrt_tableinit()
36 extern const uint32_t ff_cbrt_tab[LUT_SIZE];
37 extern const uint32_t ff_cbrt_tab_fixed[LUT_SIZE];
38 #else
39 void ff_cbrt_tableinit(void);
40 void ff_cbrt_tableinit_fixed(void);
41 
42 #define TMP_LUT_SIZE (LUT_SIZE / 2)
43 /**
44  * Creates a LUT (of doubles) for the powers of
45  * the odd integers: tmp_lut[idx] will be set to (2 * idx + 1)^{4/3}.
46  */
47 void ff_cbrt_dbl_tableinit(double tmp_lut[TMP_LUT_SIZE]);
48 
49 extern union CBRT {
50  uint32_t cbrt_tab[LUT_SIZE];
51  double tmp[TMP_LUT_SIZE];
53 
54 #define ff_cbrt_tab ff_cbrt_tab_internal.cbrt_tab
55 #define ff_cbrt_tab_fixed ff_cbrt_tab_internal_fixed.cbrt_tab
56 #endif
57 
58 #endif
ff_cbrt_tab_internal
union CBRT ff_cbrt_tab_internal
ff_cbrt_tableinit
void ff_cbrt_tableinit(void)
Definition: cbrt_tablegen.h:42
TMP_LUT_SIZE
#define TMP_LUT_SIZE
Definition: cbrt_data.h:42
ff_cbrt_tab_internal_fixed
union CBRT ff_cbrt_tab_internal_fixed
CBRT
Definition: cbrt_data.h:49
ff_cbrt_tab
#define ff_cbrt_tab
Definition: cbrt_data.h:54
LUT_SIZE
#define LUT_SIZE
Definition: cbrt_data.h:26
ff_cbrt_dbl_tableinit
void ff_cbrt_dbl_tableinit(double tmp_lut[TMP_LUT_SIZE])
Creates a LUT (of doubles) for the powers of the odd integers: tmp_lut[idx] will be set to (2 * idx +...
Definition: cbrt_tablegen_common.c:31
ff_cbrt_tab_fixed
#define ff_cbrt_tab_fixed
Definition: cbrt_data.h:55
CBRT::cbrt_tab
uint32_t cbrt_tab[LUT_SIZE]
Definition: cbrt_data.h:50
CBRT::tmp
double tmp[TMP_LUT_SIZE]
Definition: cbrt_data.h:51
ff_cbrt_tableinit_fixed
void ff_cbrt_tableinit_fixed(void)