History

avcodec/fft_template: Avoid useless function

ff_init_ff_cos_tabs is only used for the floating point FFT and only if hardcoded tables are disabled.

Andreas Rheinhardt committed 5 years ago

Commit b91b0441 parent 124e2a72 files · +12 −14Browse files

Unified · Split

2 files
  1. libavcodec/fft.h +8 −8
  2. libavcodec/fft_template.c +4 −6
libavcodec/fft.h+8−8
@@ -109,8 +109,16 @@ struct FFTContext { · 108 unmodified lines
109 109
110#if CONFIG_HARDCODED_TABLES110#if CONFIG_HARDCODED_TABLES
111#define COSTABLE_CONST const111#define COSTABLE_CONST const
112#define ff_init_ff_cos_tabs(index)
112#else113#else
113#define COSTABLE_CONST114#define COSTABLE_CONST
115#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs)
116
117/**
118 * Initialize the cosine table in ff_cos_tabs[index]
119 * @param index index in ff_cos_tabs array of the table to initialize
120 */
121void ff_init_ff_cos_tabs(int index);
114#endif122#endif
115 123
116#define COSTABLE(size) \124#define COSTABLE(size) \
@@ -132,14 +140,6 @@ extern COSTABLE(65536); · 15 unmodified lines
132extern COSTABLE(131072);140extern COSTABLE(131072);
133extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[18];141extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[18];
134 142
135#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs)
136
137/**
138 * Initialize the cosine table in ff_cos_tabs[index]
139 * @param index index in ff_cos_tabs array of the table to initialize
140 */
141void ff_init_ff_cos_tabs(int index);
142
143#define ff_fft_init FFT_NAME(ff_fft_init)143#define ff_fft_init FFT_NAME(ff_fft_init)
144#define ff_fft_end FFT_NAME(ff_fft_end)144#define ff_fft_end FFT_NAME(ff_fft_end)
145 145
libavcodec/fft_template.c+4−6
@@ -113,6 +113,10 @@ static CosTabsInitOnce cos_tabs_init_once[] = { · 112 unmodified lines
113 { init_ff_cos_tabs_131072, AV_ONCE_INIT },113 { init_ff_cos_tabs_131072, AV_ONCE_INIT },
114};114};
115 115
116av_cold void ff_init_ff_cos_tabs(int index)
117{
118 ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func);
119}
116#endif120#endif
117COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = {121COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = {
118 NULL, NULL, NULL, NULL,122 NULL, NULL, NULL, NULL,
@@ -148,12 +152,6 @@ static int split_radix_permutation(int i, int n, int inverse) · 29 unmodified lines
148 else return split_radix_permutation(i, m, inverse)*4 - 1;152 else return split_radix_permutation(i, m, inverse)*4 - 1;
149}153}
150 154
151av_cold void ff_init_ff_cos_tabs(int index)
152{
153#if (!CONFIG_HARDCODED_TABLES) && (!FFT_FIXED_32)
154 ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func);
155#endif
156}
157 155
158static const int avx_tab[] = {156static const int avx_tab[] = {
159 0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15157 0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t