Fix function signature mismatches for avfft*.c (#5)master
authorMyungchul Keum <[email protected]>
Sat, 21 Dec 2024 14:25:39 +0000 (21 23:25 +0900)
committerGitHub <[email protected]>
Sat, 21 Dec 2024 14:25:39 +0000 (21 23:25 +0900)
* Refactoring to minimize changes

* Fix function signature mismatches for avfft*.c

* Add test WITH_AVFFT=ON

* Add test -DWITH_PFFFT=OFF

.github/workflows/build-test.yml
src/avfft32.c
src/avfft32s.c
src/fft4g32.c
src/fft4g32s.c
src/fft4g64.c

index 1373aa6..64658f1 100644 (file)
@@ -34,3 +34,37 @@ jobs:
       with:
         name: ${{ matrix.os }}-${{ matrix.build_type }}
         path: ${{ matrix.build_type }}
+
+  build-ffts:
+    strategy:
+      fail-fast: false
+      matrix:
+        build_type: [Release]
+        fft_flag: [-DWITH_AVFFT=ON, -DWITH_PFFFT=OFF]
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v4
+
+    - name: Install libavcodec
+      run: sudo apt install libavcodec-dev
+
+    - name: Configure CMake
+      run: >
+        cmake -B ${{ matrix.build_type }}
+        -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+        ${{ matrix.fft_flag }}
+        -S ${{ github.workspace }}
+
+    - name: Build
+      run: cmake --build ${{ matrix.build_type }} --config ${{ matrix.build_type }}
+
+    - name: Test
+      working-directory: ${{ matrix.build_type }}
+      run: ctest --build-config ${{ matrix.build_type }}
+
+    - uses: actions/upload-artifact@v4
+      if: ${{ !cancelled() }}
+      with:
+        name: ${{ matrix.fft_flag }}-${{ matrix.build_type }}
+        path: ${{ matrix.build_type }}
index fe651f5..8d8e048 100644 (file)
@@ -9,9 +9,9 @@
 
 static void * forward_setup(int len) {return av_rdft_init((int)(log(len)/log(2)+.5),DFT_R2C);}
 static void * backward_setup(int len) {return av_rdft_init((int)(log(len)/log(2)+.5),IDFT_C2R);}
-static void rdft(int length, void * setup, float * h) {av_rdft_calc(setup, h); (void)length;}
+static void rdft(int length, void * setup, float * h, void * scratch) {av_rdft_calc(setup, h); (void)length; (void)scratch;}
 static int multiplier(void) {return 2;}
-static void nothing(void) {}
+static void nothing(int length, void * setup, void * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
 static int flags(void) {return 0;}
 
 fn_t _soxr_rdft32_cb[] = {
index 5a7e62d..0c9e30d 100644 (file)
@@ -8,9 +8,9 @@
 
 static void * forward_setup(int len) {return av_rdft_init((int)(log(len)/log(2)+.5),DFT_R2C);}
 static void * backward_setup(int len) {return av_rdft_init((int)(log(len)/log(2)+.5),IDFT_C2R);}
-static void rdft(int length, void * setup, float * h) {av_rdft_calc(setup, h); (void)length;}
+static void rdft(int length, void * setup, float * h, void * scratch) {av_rdft_calc(setup, h); (void)length; (void)scratch;}
 static int multiplier(void) {return 2;}
-static void nothing(void) {}
+static void nothing(int length, void * setup, void * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
 static int flags(void) {return RDFT_IS_SIMD;}
 
 fn_t _soxr_rdft32s_cb[] = {
index ebb2e13..4773f1e 100644 (file)
 #include "rdft_t.h"
 static void * null(int length) {(void)length; return 0;}
 static void nothing(void * setup) {(void)setup;}
-static void forward(int length, void * setup, double * H, void * scratch) {(void)setup; (void)scratch; lsx_safe_rdft_f(length, 1, H);}
-static void backward(int length, void * setup, double * H, void * scratch) {(void)setup; (void)scratch; lsx_safe_rdft_f(length, -1, H);}
+static void forward (int length, void * setup, double * H, void * scratch) {lsx_safe_rdft_f(length,  1, H); (void)setup; (void)scratch;}
+static void backward(int length, void * setup, double * H, void * scratch) {lsx_safe_rdft_f(length, -1, H); (void)setup; (void)scratch;}
 static int multiplier(void) {return 2;}
-static void nothing2(int length, void * setup, double * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
+static void nothing2(int length, void * setup, void * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
 static int flags(void) {return 0;}
 
 fn_t _soxr_rdft32_cb[] = {
index 7723c4c..8a4f1f1 100644 (file)
@@ -7,10 +7,10 @@
 
 static void * null(int length) {(void)length; return 0;}
 static void nothing(void * setup) {(void)setup;}
-static void forward(int length, void * setup, float * H, void * scratch) {(void)setup; (void)scratch; lsx_safe_rdft_f(length, 1, H);}
-static void backward(int length, void * setup, float * H, void * scratch) {(void)setup; (void)scratch; lsx_safe_rdft_f(length, -1, H);}
+static void forward (int length, void * setup, float * H, void * scratch) {lsx_safe_rdft_f(length,  1, H); (void)setup; (void)scratch;}
+static void backward(int length, void * setup, float * H, void * scratch) {lsx_safe_rdft_f(length, -1, H); (void)setup; (void)scratch;}
 static int multiplier(void) {return 2;}
-static void nothing2(int length, void * setup, float * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
+static void nothing2(int length, void * setup, void * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
 static int flags(void) {return RDFT_IS_SIMD;}
 
 fn_t _soxr_rdft32s_cb[] = {
index 287c669..5b66934 100644 (file)
@@ -9,10 +9,10 @@
 #if WITH_CR64
 static void * null(int length) {(void)length; return 0;}
 static void nothing(void * setup) {(void)setup;}
-static void forward(int length, void * setup, double * H, void * scratch) {(void)setup; (void)scratch; lsx_safe_rdft(length, 1, H);}
-static void backward(int length, void * setup, double * H, void * scratch) {(void)setup; (void)scratch; lsx_safe_rdft(length, -1, H);}
+static void forward (int length, void * setup, double * H, void * scratch) {lsx_safe_rdft(length,  1, H); (void)setup; (void)scratch;}
+static void backward(int length, void * setup, double * H, void * scratch) {lsx_safe_rdft(length, -1, H); (void)setup; (void)scratch;}
 static int multiplier(void) {return 2;}
-static void nothing2(int length, void * setup, double * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
+static void nothing2(int length, void * setup, void * H, void * scratch) {(void)length; (void)setup; (void)H; (void)scratch;}
 static int flags(void) {return 0;}
 
 typedef void (* fn_t)(void);