avcodec: Remove the FFT_FIXED_32 define

Since the removal of the 16-bit FFT said define is unnecessary as
FFT_FIXED_32 is always !FFT_FLOAT. But one wouldn't believe it when
looking at the code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-07-31 22:20:47 +02:00
parent 763c501432
commit 211619ad7f
16 changed files with 11 additions and 45 deletions

View File

@ -30,7 +30,6 @@
#include "libavutil/softfloat.h"
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#define AAC_RENAME(x) x ## _fixed
#define AAC_RENAME_32(x) x ## _fixed_32
@ -80,7 +79,6 @@ typedef int AAC_SIGNE;
#else
#define FFT_FLOAT 1
#define FFT_FIXED_32 0
#define AAC_RENAME(x) x
#define AAC_RENAME_32(x) x

View File

@ -33,7 +33,6 @@
*/
#define FFT_FLOAT 1
#define FFT_FIXED_32 0
#define USE_FIXED 0
#include "libavutil/float_dsp.h"

View File

@ -59,7 +59,6 @@
*/
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#define USE_FIXED 1
#include "libavutil/fixed_dsp.h"

View File

@ -49,7 +49,6 @@
#define FFT_FLOAT 0
#define USE_FIXED 1
#define FFT_FIXED_32 1
#include "ac3dec.h"

View File

@ -28,7 +28,6 @@
#define AC3ENC_FLOAT 0
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#include "internal.h"
#include "audiodsp.h"
#include "ac3enc.h"

View File

@ -22,7 +22,6 @@
*/
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"

View File

@ -36,8 +36,6 @@
#else /* FFT_FLOAT */
#if FFT_FIXED_32
#define CMUL(dre, dim, are, aim, bre, bim) do { \
int64_t accu; \
(accu) = (int64_t)(bre) * (are); \
@ -48,8 +46,6 @@
(dim) = (int)(((accu) + 0x40000000) >> 31); \
} while (0)
#endif /* FFT_FIXED_32 */
#endif /* FFT_FLOAT */
#define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c)

View File

@ -26,10 +26,6 @@
#define FFT_FLOAT 1
#endif
#ifndef FFT_FIXED_32
#define FFT_FIXED_32 0
#endif
#include <stdint.h>
#include "config.h"
@ -45,15 +41,11 @@ typedef float FFTDouble;
#else
#if FFT_FIXED_32
#define Q31(x) (int)((x)*2147483648.0 + 0.5)
#define FFT_NAME(x) x ## _fixed_32
typedef int32_t FFTSample;
#endif /* FFT_FIXED_32 */
typedef struct FFTComplex {
FFTSample re, im;
} FFTComplex;

View File

@ -48,5 +48,4 @@
*/
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#include "fft_template.c"

View File

@ -17,5 +17,4 @@
*/
#define FFT_FLOAT 1
#define FFT_FIXED_32 0
#include "fft_template.c"

View File

@ -33,9 +33,9 @@
#include "fft.h"
#include "fft-internal.h"
#if FFT_FIXED_32
#if !FFT_FLOAT
#include "fft_table.h"
#else /* FFT_FIXED_32 */
#else /* !FFT_FLOAT */
/* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */
#if !CONFIG_HARDCODED_TABLES
@ -136,7 +136,7 @@ COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = {
FFT_NAME(ff_cos_131072),
};
#endif /* FFT_FIXED_32 */
#endif /* FFT_FLOAT */
static void fft_permute_c(FFTContext *s, FFTComplex *z);
static void fft_calc_c(FFTContext *s, FFTComplex *z);
@ -226,20 +226,18 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
s->mdct_calc = ff_mdct_calc_c;
#endif
#if FFT_FIXED_32
ff_fft_lut_init();
#else /* FFT_FIXED_32 */
#if FFT_FLOAT
if (ARCH_AARCH64) ff_fft_init_aarch64(s);
if (ARCH_ARM) ff_fft_init_arm(s);
if (ARCH_PPC) ff_fft_init_ppc(s);
if (ARCH_X86) ff_fft_init_x86(s);
if (HAVE_MIPSFPU) ff_fft_init_mips(s);
#endif
for(j=4; j<=nbits; j++) {
ff_init_ff_cos_tabs(j);
}
#endif /* FFT_FIXED_32 */
#else /* FFT_FLOAT */
ff_fft_lut_init();
#endif
if (ARCH_X86 && FFT_FLOAT && s->fft_permutation == FF_FFT_PERM_AVX) {
@ -312,7 +310,7 @@ av_cold void ff_fft_end(FFTContext *s)
av_freep(&s->tmp_buf);
}
#if FFT_FIXED_32
#if !FFT_FLOAT
static void fft_calc_c(FFTContext *s, FFTComplex *z) {
@ -470,7 +468,7 @@ static void fft_calc_c(FFTContext *s, FFTComplex *z) {
}
}
#else /* FFT_FIXED_32 */
#else /* !FFT_FLOAT */
#define BUTTERFLIES(a0,a1,a2,a3) {\
BF(t3, t5, t5, t1);\
@ -620,4 +618,4 @@ static void fft_calc_c(FFTContext *s, FFTComplex *z)
{
fft_dispatch[s->nbits-2](z);
}
#endif /* FFT_FIXED_32 */
#endif /* !FFT_FLOAT */

View File

@ -48,5 +48,4 @@
*/
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#include "mdct_template.c"

View File

@ -17,5 +17,4 @@
*/
#define FFT_FLOAT 1
#define FFT_FIXED_32 0
#include "mdct_template.c"

View File

@ -35,11 +35,7 @@
#if FFT_FLOAT
# define RSCALE(x, y) ((x) + (y))
#else
#if FFT_FIXED_32
# define RSCALE(x, y) ((int)((x) + (unsigned)(y) + 32) >> 6)
#else /* FFT_FIXED_32 */
# define RSCALE(x, y) ((int)((x) + (unsigned)(y)) >> 1)
#endif /* FFT_FIXED_32 */
#endif
/**
@ -82,7 +78,7 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
scale = sqrt(fabs(scale));
for(i=0;i<n4;i++) {
alpha = 2 * M_PI * (i + theta) / n;
#if FFT_FIXED_32
#if !FFT_FLOAT
s->tcos[i*tstep] = lrint(-cos(alpha) * 2147483648.0);
s->tsin[i*tstep] = lrint(-sin(alpha) * 2147483648.0);
#else

View File

@ -17,6 +17,5 @@
*/
#define FFT_FLOAT 0
#define FFT_FIXED_32 1
#define AVFFT 0
#include "fft.c"

View File

@ -68,14 +68,10 @@
#define RANGE 1.0
#define REF_SCALE(x, bits) (x)
#define FMT "%10.6f"
#elif FFT_FIXED_32
#else
#define RANGE 8388608
#define REF_SCALE(x, bits) (x)
#define FMT "%6d"
#else
#define RANGE 16384
#define REF_SCALE(x, bits) ((x) / (1 << (bits)))
#define FMT "%6d"
#endif
static struct {