diff mbox series

[FFmpeg-devel,02/13] avcodec/fft_template: Avoid useless function

Message ID 20210129052302.3124447-2-andreas.rheinhardt@gmail.com
State Accepted
Commit b91b04473abef3058e28cb4a05288426549e784b
Headers show
Series [FFmpeg-devel,01/13] avfilter/drawutils: Remove remnants of old API | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 29, 2021, 5:22 a.m. UTC
ff_init_ff_cos_tabs is only used for the floating point FFT and only
if hardcoded tables are disabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/fft.h          | 16 ++++++++--------
 libavcodec/fft_template.c | 10 ++++------
 2 files changed, 12 insertions(+), 14 deletions(-)

Comments

Lynne Jan. 29, 2021, 8:18 a.m. UTC | #1
Jan 29, 2021, 06:22 by andreas.rheinhardt@gmail.com:

> ff_init_ff_cos_tabs is only used for the floating point FFT and only
> if hardcoded tables are disabled.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/fft.h          | 16 ++++++++--------
>  libavcodec/fft_template.c | 10 ++++------
>  2 files changed, 12 insertions(+), 14 deletions(-)
>

LGTM
diff mbox series

Patch

diff --git a/libavcodec/fft.h b/libavcodec/fft.h
index 5ca2d18432..e03ca01abf 100644
--- a/libavcodec/fft.h
+++ b/libavcodec/fft.h
@@ -109,8 +109,16 @@  struct FFTContext {
 
 #if CONFIG_HARDCODED_TABLES
 #define COSTABLE_CONST const
+#define ff_init_ff_cos_tabs(index)
 #else
 #define COSTABLE_CONST
+#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs)
+
+/**
+ * Initialize the cosine table in ff_cos_tabs[index]
+ * @param index index in ff_cos_tabs array of the table to initialize
+ */
+void ff_init_ff_cos_tabs(int index);
 #endif
 
 #define COSTABLE(size) \
@@ -132,14 +140,6 @@  extern COSTABLE(65536);
 extern COSTABLE(131072);
 extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[18];
 
-#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs)
-
-/**
- * Initialize the cosine table in ff_cos_tabs[index]
- * @param index index in ff_cos_tabs array of the table to initialize
- */
-void ff_init_ff_cos_tabs(int index);
-
 #define ff_fft_init FFT_NAME(ff_fft_init)
 #define ff_fft_end  FFT_NAME(ff_fft_end)
 
diff --git a/libavcodec/fft_template.c b/libavcodec/fft_template.c
index 2d05990ca9..3012372a74 100644
--- a/libavcodec/fft_template.c
+++ b/libavcodec/fft_template.c
@@ -113,6 +113,10 @@  static CosTabsInitOnce cos_tabs_init_once[] = {
     { init_ff_cos_tabs_131072, AV_ONCE_INIT },
 };
 
+av_cold void ff_init_ff_cos_tabs(int index)
+{
+    ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func);
+}
 #endif
 COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = {
     NULL, NULL, NULL, NULL,
@@ -148,12 +152,6 @@  static int split_radix_permutation(int i, int n, int inverse)
     else                  return split_radix_permutation(i, m, inverse)*4 - 1;
 }
 
-av_cold void ff_init_ff_cos_tabs(int index)
-{
-#if (!CONFIG_HARDCODED_TABLES) && (!FFT_FIXED_32)
-    ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func);
-#endif
-}
 
 static const int avx_tab[] = {
     0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15