Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
*.o
*.Po
*.a
*.la
*.lai
*.lo
*.slo
*.Plo
*.so
*.dylib
*~
*.log
*.swp
*.cache/*

*Makefile

config.h
config.status
compile
libtool
ffts.pc
stamp-h1
tests/test

java/android/local.properties
java/android/gen/*
java/android/obj/*
java/android/bin/*

1 change: 0 additions & 1 deletion README.md

This file was deleted.

153 changes: 153 additions & 0 deletions alloc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/* ---- memory allocation ---- */
#include "alloc.h"


#define alloc_error_check(p) { \
if ((p) == NULL) { \
fprintf(stderr, "Allocation Failure!\n"); \
exit(1); \
} \
}


int *alloc_1d_int(int n1)
{
int *i;

i = (int *) malloc(sizeof(int) * n1);
alloc_error_check(i);
return i;
}


void free_1d_int(int *i)
{
free(i);
}


double *alloc_1d_double(int n1)
{
double *d;

d = (double *) malloc(sizeof(double) * n1);
alloc_error_check(d);
return d;
}


void free_1d_double(double *d)
{
free(d);
}


int **alloc_2d_int(int n1, int n2)
{
int **ii, *i;
int j;

ii = (int **) malloc(sizeof(int *) * n1);
alloc_error_check(ii);
i = (int *) malloc(sizeof(int) * n1 * n2);
alloc_error_check(i);
ii[0] = i;
for (j = 1; j < n1; j++) {
ii[j] = ii[j - 1] + n2;
}
return ii;
}


void free_2d_int(int **ii)
{
free(ii[0]);
free(ii);
}


double **alloc_2d_double(int n1, int n2)
{
double **dd, *d;
int j;

dd = (double **) malloc(sizeof(double *) * n1);
alloc_error_check(dd);
d = (double *) malloc(sizeof(double) * n1 * n2);
alloc_error_check(d);
dd[0] = d;
for (j = 1; j < n1; j++) {
dd[j] = dd[j - 1] + n2;
}
return dd;
}


void free_2d_double(double **dd)
{
free(dd[0]);
free(dd);
}


int ***alloc_3d_int(int n1, int n2, int n3)
{
int ***iii, **ii, *i;
int j;

iii = (int ***) malloc(sizeof(int **) * n1);
alloc_error_check(iii);
ii = (int **) malloc(sizeof(int *) * n1 * n2);
alloc_error_check(ii);
iii[0] = ii;
for (j = 1; j < n1; j++) {
iii[j] = iii[j - 1] + n2;
}
i = (int *) malloc(sizeof(int) * n1 * n2 * n3);
alloc_error_check(i);
ii[0] = i;
for (j = 1; j < n1 * n2; j++) {
ii[j] = ii[j - 1] + n3;
}
return iii;
}


void free_3d_int(int ***iii)
{
free(iii[0][0]);
free(iii[0]);
free(iii);
}


double ***alloc_3d_double(int n1, int n2, int n3)
{
double ***ddd, **dd, *d;
int j;

ddd = (double ***) malloc(sizeof(double **) * n1);
alloc_error_check(ddd);
dd = (double **) malloc(sizeof(double *) * n1 * n2);
alloc_error_check(dd);
ddd[0] = dd;
for (j = 1; j < n1; j++) {
ddd[j] = ddd[j - 1] + n2;
}
d = (double *) malloc(sizeof(double) * n1 * n2 * n3);
alloc_error_check(d);
dd[0] = d;
for (j = 1; j < n1 * n2; j++) {
dd[j] = dd[j - 1] + n3;
}
return ddd;
}


void free_3d_double(double ***ddd)
{
free(ddd[0][0]);
free(ddd[0]);
free(ddd);
}

20 changes: 20 additions & 0 deletions alloc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* ---- memory allocation ---- */


#include <stdlib.h>
#include <stdio.h>


int *alloc_1d_int(int n1);
void free_1d_int(int *i);
double *alloc_1d_double(int n1);
void free_1d_double(double *d);
int **alloc_2d_int(int n1, int n2);
void free_2d_int(int **ii);
double **alloc_2d_double(int n1, int n2);
void free_2d_double(double **dd);
int ***alloc_3d_int(int n1, int n2, int n3);
void free_3d_int(int ***iii);
double ***alloc_3d_double(int n1, int n2, int n3);
void free_3d_double(double ***ddd);

75 changes: 75 additions & 0 deletions debian/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

project(fft2d C)

cmake_minimum_required(VERSION 3.25)

set(FFT2D_SOURCE_DIR "" CACHE PATH
"Directory that contains the fft2d project"
)
if(NOT FFT2D_SOURCE_DIR)
message(FATAL_ERROR "Must specify source directory")
endif()

# fft2d doesn't have a CMake project so define it here transcribed from
# sample2d/Makefile.

# A developer should link this library if they haven't provided their own
# implementation of these allocation methods.
add_library(fft2d_alloc
"${FFT2D_SOURCE_DIR}/alloc.c"
"${FFT2D_SOURCE_DIR}/alloc.h"
)
target_include_directories(fft2d_alloc PUBLIC "${FFT2D_SOURCE_DIR}")

# Requires implementation of fft2d_alloc.
add_library(fft2d_fft4f2d "${FFT2D_SOURCE_DIR}/fft4f2d.c")
target_include_directories(fft2d_fft4f2d PRIVATE "${FFT2D_SOURCE_DIR}")

add_library(fft2d_fftsg "${FFT2D_SOURCE_DIR}/fftsg.c")
if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(fft2d_fftsg m)
endif()

install(
TARGETS fft2d_fftsg
EXPORT tensorflow-liteTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

# Requires implementation of fft2d_alloc.
add_library(fft2d_fftsg2d "${FFT2D_SOURCE_DIR}/fftsg2d.c")
target_link_libraries(fft2d_fftsg2d fft2d_fftsg)
target_include_directories(fft2d_fftsg2d PRIVATE "${FFT2D_SOURCE_DIR}")

# Requires implementation of fft2d_alloc.
add_library(fft2d_fftsg3d "${FFT2D_SOURCE_DIR}/fftsg3d.c")
target_link_libraries(fft2d_fftsg3d fft2d_fftsg)
target_include_directories(fft2d_fftsg3d PRIVATE "${FFT2D_SOURCE_DIR}")

add_library(fft2d_shrtdct "${FFT2D_SOURCE_DIR}/shrtdct.c")

add_library(fft2d ALIAS fft2d_fftsg2d)

install(
TARGETS fft2d_fftsg2d
EXPORT tensorflow-liteTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
21 changes: 18 additions & 3 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
template-repository (1.0-1) unstable; urgency=medium
oourafft (1.0-3) unstable; urgency=medium

* Initial release
* Set cmake_minimum_required to 3.25 (Closes: #1113347)

-- Tsic404 <liuheng@deepin.org> Sat, 28 Jan 2023 13:46:49 +0800
-- Dylan Aïssi <daissi@debian.org> Thu, 25 Sep 2025 23:10:51 +0200

oourafft (1.0-2) unstable; urgency=medium

* Upload to unstable.

-- Dylan Aïssi <daissi@debian.org> Fri, 29 Aug 2025 07:29:45 +0200

oourafft (1.0-1) experimental; urgency=medium

* Initial packaging.
* fft2d is a build dependency of TensorFlow Lite (TFLite).
* Clarification of the license with its original author:
Takuya OOURA <ooura@kurims.kyoto-u.ac.jp>

-- Dylan Aïssi <daissi@debian.org> Wed, 14 May 2025 23:51:21 +0200
1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

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

Package: template-repository
Package: libfft2d-dev
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Multi-Arch: same
Section: libdevel
Depends: ${shlibs:Depends},
${misc:Depends},
Description: calculate Discrete Fourier/Cosine/Sine Transforms
A package to calculate Discrete Fourier/Cosine/Sine Transforms of
1,2,3-dimensional sequences of length 2^N.
Loading
Loading