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

Showing the changes to libavcodec (2 of 2 files). Show all

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
109109
110110 #if CONFIG_HARDCODED_TABLES
111111 #define COSTABLE_CONST const
112+#define ff_init_ff_cos_tabs(index)
112113 #else
113114 #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+ */
121+void ff_init_ff_cos_tabs(int index);
114122 #endif
115123
116124 #define COSTABLE(size) \
@@ -132,14 +140,6 @@ extern COSTABLE(65536); · 15 unmodified lines
132140 extern COSTABLE(131072);
133141 extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[18];
134142
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− */
141−void ff_init_ff_cos_tabs(int index);
142−
143143 #define ff_fft_init FFT_NAME(ff_fft_init)
144144 #define ff_fft_end FFT_NAME(ff_fft_end)
145145
libavcodec/fft_template.c+4−6
@@ -113,6 +113,10 @@ static CosTabsInitOnce cos_tabs_init_once[] = { · 112 unmodified lines
113113 { init_ff_cos_tabs_131072, AV_ONCE_INIT },
114114 };
115115
116+av_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+}
116120 #endif
117121 COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = {
118122 NULL, NULL, NULL, NULL,
@@ -148,12 +152,6 @@ static int split_radix_permutation(int i, int n, int inverse) · 29 unmodified lines
148152 else return split_radix_permutation(i, m, inverse)*4 - 1;
149153 }
150154
151−av_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−}
157155
158156 static const int avx_tab[] = {
159157 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