Skip to content

Commit 840013a

Browse files
feat: update oourafft to 1.0-3
1 parent fea6664 commit 840013a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+30288
-34
lines changed

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
*.o
2+
*.Po
3+
*.a
4+
*.la
5+
*.lai
6+
*.lo
7+
*.slo
8+
*.Plo
9+
*.so
10+
*.dylib
11+
*~
12+
*.log
13+
*.swp
14+
*.cache/*
15+
16+
*Makefile
17+
18+
config.h
19+
config.status
20+
compile
21+
libtool
22+
ffts.pc
23+
stamp-h1
24+
tests/test
25+
26+
java/android/local.properties
27+
java/android/gen/*
28+
java/android/obj/*
29+
java/android/bin/*
30+

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

alloc.c

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/* ---- memory allocation ---- */
2+
#include "alloc.h"
3+
4+
5+
#define alloc_error_check(p) { \
6+
if ((p) == NULL) { \
7+
fprintf(stderr, "Allocation Failure!\n"); \
8+
exit(1); \
9+
} \
10+
}
11+
12+
13+
int *alloc_1d_int(int n1)
14+
{
15+
int *i;
16+
17+
i = (int *) malloc(sizeof(int) * n1);
18+
alloc_error_check(i);
19+
return i;
20+
}
21+
22+
23+
void free_1d_int(int *i)
24+
{
25+
free(i);
26+
}
27+
28+
29+
double *alloc_1d_double(int n1)
30+
{
31+
double *d;
32+
33+
d = (double *) malloc(sizeof(double) * n1);
34+
alloc_error_check(d);
35+
return d;
36+
}
37+
38+
39+
void free_1d_double(double *d)
40+
{
41+
free(d);
42+
}
43+
44+
45+
int **alloc_2d_int(int n1, int n2)
46+
{
47+
int **ii, *i;
48+
int j;
49+
50+
ii = (int **) malloc(sizeof(int *) * n1);
51+
alloc_error_check(ii);
52+
i = (int *) malloc(sizeof(int) * n1 * n2);
53+
alloc_error_check(i);
54+
ii[0] = i;
55+
for (j = 1; j < n1; j++) {
56+
ii[j] = ii[j - 1] + n2;
57+
}
58+
return ii;
59+
}
60+
61+
62+
void free_2d_int(int **ii)
63+
{
64+
free(ii[0]);
65+
free(ii);
66+
}
67+
68+
69+
double **alloc_2d_double(int n1, int n2)
70+
{
71+
double **dd, *d;
72+
int j;
73+
74+
dd = (double **) malloc(sizeof(double *) * n1);
75+
alloc_error_check(dd);
76+
d = (double *) malloc(sizeof(double) * n1 * n2);
77+
alloc_error_check(d);
78+
dd[0] = d;
79+
for (j = 1; j < n1; j++) {
80+
dd[j] = dd[j - 1] + n2;
81+
}
82+
return dd;
83+
}
84+
85+
86+
void free_2d_double(double **dd)
87+
{
88+
free(dd[0]);
89+
free(dd);
90+
}
91+
92+
93+
int ***alloc_3d_int(int n1, int n2, int n3)
94+
{
95+
int ***iii, **ii, *i;
96+
int j;
97+
98+
iii = (int ***) malloc(sizeof(int **) * n1);
99+
alloc_error_check(iii);
100+
ii = (int **) malloc(sizeof(int *) * n1 * n2);
101+
alloc_error_check(ii);
102+
iii[0] = ii;
103+
for (j = 1; j < n1; j++) {
104+
iii[j] = iii[j - 1] + n2;
105+
}
106+
i = (int *) malloc(sizeof(int) * n1 * n2 * n3);
107+
alloc_error_check(i);
108+
ii[0] = i;
109+
for (j = 1; j < n1 * n2; j++) {
110+
ii[j] = ii[j - 1] + n3;
111+
}
112+
return iii;
113+
}
114+
115+
116+
void free_3d_int(int ***iii)
117+
{
118+
free(iii[0][0]);
119+
free(iii[0]);
120+
free(iii);
121+
}
122+
123+
124+
double ***alloc_3d_double(int n1, int n2, int n3)
125+
{
126+
double ***ddd, **dd, *d;
127+
int j;
128+
129+
ddd = (double ***) malloc(sizeof(double **) * n1);
130+
alloc_error_check(ddd);
131+
dd = (double **) malloc(sizeof(double *) * n1 * n2);
132+
alloc_error_check(dd);
133+
ddd[0] = dd;
134+
for (j = 1; j < n1; j++) {
135+
ddd[j] = ddd[j - 1] + n2;
136+
}
137+
d = (double *) malloc(sizeof(double) * n1 * n2 * n3);
138+
alloc_error_check(d);
139+
dd[0] = d;
140+
for (j = 1; j < n1 * n2; j++) {
141+
dd[j] = dd[j - 1] + n3;
142+
}
143+
return ddd;
144+
}
145+
146+
147+
void free_3d_double(double ***ddd)
148+
{
149+
free(ddd[0][0]);
150+
free(ddd[0]);
151+
free(ddd);
152+
}
153+

alloc.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* ---- memory allocation ---- */
2+
3+
4+
#include <stdlib.h>
5+
#include <stdio.h>
6+
7+
8+
int *alloc_1d_int(int n1);
9+
void free_1d_int(int *i);
10+
double *alloc_1d_double(int n1);
11+
void free_1d_double(double *d);
12+
int **alloc_2d_int(int n1, int n2);
13+
void free_2d_int(int **ii);
14+
double **alloc_2d_double(int n1, int n2);
15+
void free_2d_double(double **dd);
16+
int ***alloc_3d_int(int n1, int n2, int n3);
17+
void free_3d_int(int ***iii);
18+
double ***alloc_3d_double(int n1, int n2, int n3);
19+
void free_3d_double(double ***ddd);
20+

debian/CMakeLists.txt

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#
2+
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
project(fft2d C)
17+
18+
cmake_minimum_required(VERSION 3.25)
19+
20+
set(FFT2D_SOURCE_DIR "" CACHE PATH
21+
"Directory that contains the fft2d project"
22+
)
23+
if(NOT FFT2D_SOURCE_DIR)
24+
message(FATAL_ERROR "Must specify source directory")
25+
endif()
26+
27+
# fft2d doesn't have a CMake project so define it here transcribed from
28+
# sample2d/Makefile.
29+
30+
# A developer should link this library if they haven't provided their own
31+
# implementation of these allocation methods.
32+
add_library(fft2d_alloc
33+
"${FFT2D_SOURCE_DIR}/alloc.c"
34+
"${FFT2D_SOURCE_DIR}/alloc.h"
35+
)
36+
target_include_directories(fft2d_alloc PUBLIC "${FFT2D_SOURCE_DIR}")
37+
38+
# Requires implementation of fft2d_alloc.
39+
add_library(fft2d_fft4f2d "${FFT2D_SOURCE_DIR}/fft4f2d.c")
40+
target_include_directories(fft2d_fft4f2d PRIVATE "${FFT2D_SOURCE_DIR}")
41+
42+
add_library(fft2d_fftsg "${FFT2D_SOURCE_DIR}/fftsg.c")
43+
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
44+
target_link_libraries(fft2d_fftsg m)
45+
endif()
46+
47+
install(
48+
TARGETS fft2d_fftsg
49+
EXPORT tensorflow-liteTargets
50+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
51+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
52+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
53+
)
54+
55+
# Requires implementation of fft2d_alloc.
56+
add_library(fft2d_fftsg2d "${FFT2D_SOURCE_DIR}/fftsg2d.c")
57+
target_link_libraries(fft2d_fftsg2d fft2d_fftsg)
58+
target_include_directories(fft2d_fftsg2d PRIVATE "${FFT2D_SOURCE_DIR}")
59+
60+
# Requires implementation of fft2d_alloc.
61+
add_library(fft2d_fftsg3d "${FFT2D_SOURCE_DIR}/fftsg3d.c")
62+
target_link_libraries(fft2d_fftsg3d fft2d_fftsg)
63+
target_include_directories(fft2d_fftsg3d PRIVATE "${FFT2D_SOURCE_DIR}")
64+
65+
add_library(fft2d_shrtdct "${FFT2D_SOURCE_DIR}/shrtdct.c")
66+
67+
add_library(fft2d ALIAS fft2d_fftsg2d)
68+
69+
install(
70+
TARGETS fft2d_fftsg2d
71+
EXPORT tensorflow-liteTargets
72+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
73+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
74+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
75+
)

debian/changelog

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
template-repository (1.0-1) unstable; urgency=medium
1+
oourafft (1.0-3) unstable; urgency=medium
22

3-
* Initial release
3+
* Set cmake_minimum_required to 3.25 (Closes: #1113347)
44

5-
-- Tsic404 <liuheng@deepin.org> Sat, 28 Jan 2023 13:46:49 +0800
5+
-- Dylan Aïssi <daissi@debian.org> Thu, 25 Sep 2025 23:10:51 +0200
6+
7+
oourafft (1.0-2) unstable; urgency=medium
8+
9+
* Upload to unstable.
10+
11+
-- Dylan Aïssi <daissi@debian.org> Fri, 29 Aug 2025 07:29:45 +0200
12+
13+
oourafft (1.0-1) experimental; urgency=medium
14+
15+
* Initial packaging.
16+
* fft2d is a build dependency of TensorFlow Lite (TFLite).
17+
* Clarification of the license with its original author:
18+
Takuya OOURA <ooura@kurims.kyoto-u.ac.jp>
19+
20+
-- Dylan Aïssi <daissi@debian.org> Wed, 14 May 2025 23:51:21 +0200

debian/compat

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/control

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
Source: template-repository
2-
Section: unknown
1+
Source: oourafft
2+
Section: science
33
Priority: optional
4-
Maintainer: Tsic404 <liuheng@deepin.org>
5-
Build-Depends: debhelper (>= 11)
6-
Standards-Version: 4.1.3
7-
Homepage: https://github.com/deepin-community/template-repository
8-
#Vcs-Browser: https://salsa.debian.org/debian/deepin-community-template-repository
9-
#Vcs-Git: https://salsa.debian.org/debian/deepin-community-template-repository.git
4+
Maintainer: Debian Deep Learning Team <debian-ai@lists.debian.org>
5+
Uploaders: Dylan Aïssi <daissi@debian.org>
6+
Build-Depends: debhelper-compat (= 13),
7+
cmake
8+
Standards-Version: 4.7.2
9+
Rules-Requires-Root: no
10+
Homepage: https://github.com/petewarden/OouraFFT
11+
Vcs-Browser: https://salsa.debian.org/deeplearning-team/oourafft
12+
Vcs-Git: https://salsa.debian.org/deeplearning-team/oourafft.git
1013

11-
Package: template-repository
14+
Package: libfft2d-dev
1215
Architecture: any
13-
Depends: ${shlibs:Depends}, ${misc:Depends}
14-
Description: <insert up to 60 chars description>
15-
<insert long description, indented with spaces>
16+
Multi-Arch: same
17+
Section: libdevel
18+
Depends: ${shlibs:Depends},
19+
${misc:Depends},
20+
Description: calculate Discrete Fourier/Cosine/Sine Transforms
21+
A package to calculate Discrete Fourier/Cosine/Sine Transforms of
22+
1,2,3-dimensional sequences of length 2^N.

0 commit comments

Comments
 (0)