mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
fft: remove 16-bit FFT and MDCT code
No longer used by anything. Unfortunately the old FFT_FLOAT/FFT_FIXED_32 is left as-is. It's simply too much work for code meant to be all removed anyway.
This commit is contained in:
parent
9e05421dbe
commit
151b41c8cc
@ -83,10 +83,9 @@ OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o
|
||||
OBJS-$(CONFIG_FAANDCT) += faandct.o
|
||||
OBJS-$(CONFIG_FAANIDCT) += faanidct.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o
|
||||
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
|
||||
fft_fixed_32.o fft_init_table.o \
|
||||
$(FFT-OBJS-yes)
|
||||
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_float.o fft_fixed_32.o \
|
||||
fft_init_table.o $(FFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_FLACDSP) += flacdsp.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
@ -115,7 +114,7 @@ OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o
|
||||
OBJS-$(CONFIG_LPC) += lpc.o
|
||||
OBJS-$(CONFIG_LSP) += lsp.o
|
||||
OBJS-$(CONFIG_LZF) += lzf.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_float.o mdct_fixed_32.o
|
||||
OBJS-$(CONFIG_ME_CMP) += me_cmp.o
|
||||
OBJS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.o mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o
|
||||
OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o
|
||||
@ -1217,7 +1216,7 @@ TESTPROGS = avpacket \
|
||||
|
||||
TESTPROGS-$(CONFIG_CABAC) += cabac
|
||||
TESTPROGS-$(CONFIG_DCT) += avfft
|
||||
TESTPROGS-$(CONFIG_FFT) += fft fft-fixed fft-fixed32
|
||||
TESTPROGS-$(CONFIG_FFT) += fft fft-fixed32
|
||||
TESTPROGS-$(CONFIG_GOLOMB) += golomb
|
||||
TESTPROGS-$(CONFIG_IDCTDSP) += dct
|
||||
TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter
|
||||
|
@ -5,8 +5,7 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
|
||||
arm/ac3dsp_arm.o
|
||||
OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o
|
||||
OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \
|
||||
arm/fft_fixed_init_arm.o
|
||||
OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o
|
||||
OBJS-$(CONFIG_FLACDSP) += arm/flacdsp_init_arm.o \
|
||||
arm/flacdsp_arm.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_init_arm.o
|
||||
@ -108,8 +107,7 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \
|
||||
arm/int_neon.o
|
||||
NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \
|
||||
arm/blockdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
|
||||
arm/fft_fixed_neon.o
|
||||
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o
|
||||
NEON-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_neon.o
|
||||
NEON-OBJS-$(CONFIG_G722DSP) += arm/g722dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
|
||||
@ -123,8 +121,7 @@ NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \
|
||||
NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \
|
||||
arm/idctdsp_neon.o \
|
||||
arm/simple_idct_neon.o
|
||||
NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
|
||||
arm/mdct_fixed_neon.o
|
||||
NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o
|
||||
NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
|
||||
NEON-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#define FFT_FLOAT 0
|
||||
#include "libavcodec/fft.h"
|
||||
|
||||
void ff_fft_fixed_calc_neon(FFTContext *s, FFTComplex *z);
|
||||
void ff_mdct_fixed_calc_neon(FFTContext *s, FFTSample *o, const FFTSample *i);
|
||||
void ff_mdct_fixed_calcw_neon(FFTContext *s, FFTDouble *o, const FFTSample *i);
|
||||
|
||||
av_cold void ff_fft_fixed_init_arm(FFTContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
|
||||
#if CONFIG_FFT
|
||||
s->fft_calc = ff_fft_fixed_calc_neon;
|
||||
#endif
|
||||
|
||||
#if CONFIG_MDCT
|
||||
if (!s->inverse && s->nbits >= 3) {
|
||||
s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
|
||||
s->mdct_calc = ff_mdct_fixed_calc_neon;
|
||||
s->mdct_calcw = ff_mdct_fixed_calcw_neon;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
@ -1,261 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
.macro bflies d0, d1, r0, r1
|
||||
vrev64.32 \r0, \d1 @ t5, t6, t1, t2
|
||||
vhsub.s16 \r1, \d1, \r0 @ t1-t5, t2-t6, t5-t1, t6-t2
|
||||
vhadd.s16 \r0, \d1, \r0 @ t1+t5, t2+t6, t5+t1, t6+t2
|
||||
vext.16 \r1, \r1, \r1, #1 @ t2-t6, t5-t1, t6-t2, t1-t5
|
||||
vtrn.32 \r0, \r1 @ t1+t5, t2+t6, t2-t6, t5-t1
|
||||
@ t5, t6, t4, t3
|
||||
vhsub.s16 \d1, \d0, \r0
|
||||
vhadd.s16 \d0, \d0, \r0
|
||||
.endm
|
||||
|
||||
.macro transform01 q0, q1, d3, c0, c1, r0, w0, w1
|
||||
vrev32.16 \r0, \d3
|
||||
vmull.s16 \w0, \d3, \c0
|
||||
vmlal.s16 \w0, \r0, \c1
|
||||
vshrn.s32 \d3, \w0, #15
|
||||
bflies \q0, \q1, \w0, \w1
|
||||
.endm
|
||||
|
||||
.macro transform2 d0, d1, d2, d3, q0, q1, c0, c1, c2, c3, \
|
||||
r0, r1, w0, w1
|
||||
vrev32.16 \r0, \d1
|
||||
vrev32.16 \r1, \d3
|
||||
vmull.s16 \w0, \d1, \c0
|
||||
vmlal.s16 \w0, \r0, \c1
|
||||
vmull.s16 \w1, \d3, \c2
|
||||
vmlal.s16 \w1, \r1, \c3
|
||||
vshrn.s32 \d1, \w0, #15
|
||||
vshrn.s32 \d3, \w1, #15
|
||||
bflies \q0, \q1, \w0, \w1
|
||||
.endm
|
||||
|
||||
.macro fft4 d0, d1, r0, r1
|
||||
vhsub.s16 \r0, \d0, \d1 @ t3, t4, t8, t7
|
||||
vhsub.s16 \r1, \d1, \d0
|
||||
vhadd.s16 \d0, \d0, \d1 @ t1, t2, t6, t5
|
||||
vmov.i64 \d1, #0xffff00000000
|
||||
vbit \r0, \r1, \d1
|
||||
vrev64.16 \r1, \r0 @ t7, t8, t4, t3
|
||||
vtrn.32 \r0, \r1 @ t3, t4, t7, t8
|
||||
vtrn.32 \d0, \r0 @ t1, t2, t3, t4, t6, t5, t8, t7
|
||||
vhsub.s16 \d1, \d0, \r0 @ r2, i2, r3, i1
|
||||
vhadd.s16 \d0, \d0, \r0 @ r0, i0, r1, i3
|
||||
.endm
|
||||
|
||||
.macro fft8 d0, d1, d2, d3, q0, q1, c0, c1, r0, r1, w0, w1
|
||||
fft4 \d0, \d1, \r0, \r1
|
||||
vtrn.32 \d0, \d1 @ z0, z2, z1, z3
|
||||
vhadd.s16 \r0, \d2, \d3 @ t1, t2, t3, t4
|
||||
vhsub.s16 \d3, \d2, \d3 @ z5, z7
|
||||
vmov \d2, \r0
|
||||
transform01 \q0, \q1, \d3, \c0, \c1, \r0, \w0, \w1
|
||||
.endm
|
||||
|
||||
function fft4_neon
|
||||
vld1.16 {d0-d1}, [r0]
|
||||
fft4 d0, d1, d2, d3
|
||||
vst1.16 {d0-d1}, [r0]
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function fft8_neon
|
||||
vld1.16 {d0-d3}, [r0,:128]
|
||||
movrel r1, coefs
|
||||
vld1.16 {d30}, [r1,:64]
|
||||
vdup.16 d31, d30[0]
|
||||
fft8 d0, d1, d2, d3, q0, q1, d31, d30, d20, d21, q8, q9
|
||||
vtrn.32 d0, d1
|
||||
vtrn.32 d2, d3
|
||||
vst1.16 {d0-d3}, [r0,:128]
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function fft16_neon
|
||||
vld1.16 {d0-d3}, [r0,:128]!
|
||||
vld1.16 {d4-d7}, [r0,:128]
|
||||
movrel r1, coefs
|
||||
sub r0, r0, #32
|
||||
vld1.16 {d28-d31},[r1,:128]
|
||||
vdup.16 d31, d28[0]
|
||||
fft8 d0, d1, d2, d3, q0, q1, d31, d28, d20, d21, q8, q9
|
||||
vswp d5, d6
|
||||
fft4 q2, q3, q8, q9
|
||||
vswp d5, d6
|
||||
vtrn.32 q0, q1 @ z0, z4, z2, z6, z1, z5, z3, z7
|
||||
vtrn.32 q2, q3 @ z8, z12,z10,z14,z9, z13,z11,z15
|
||||
vswp d1, d2
|
||||
vdup.16 d31, d28[0]
|
||||
transform01 q0, q2, d5, d31, d28, d20, q8, q9
|
||||
vdup.16 d26, d29[0]
|
||||
vdup.16 d27, d30[0]
|
||||
transform2 d2, d6, d3, d7, q1, q3, d26, d30, d27, d29, \
|
||||
d20, d21, q8, q9
|
||||
vtrn.32 q0, q1
|
||||
vtrn.32 q2, q3
|
||||
vst1.16 {d0-d3}, [r0,:128]!
|
||||
vst1.16 {d4-d7}, [r0,:128]
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
function fft_pass_neon
|
||||
push {r4,lr}
|
||||
movrel lr, coefs + 24
|
||||
vld1.16 {d30}, [lr,:64]
|
||||
lsl r12, r2, #3
|
||||
vmov d31, d30
|
||||
add r3, r1, r2, lsl #2
|
||||
mov lr, #-8
|
||||
sub r3, r3, #2
|
||||
mov r4, r0
|
||||
vld1.16 {d27[]}, [r3,:16]
|
||||
sub r3, r3, #6
|
||||
vld1.16 {q0}, [r4,:128], r12
|
||||
vld1.16 {q1}, [r4,:128], r12
|
||||
vld1.16 {q2}, [r4,:128], r12
|
||||
vld1.16 {q3}, [r4,:128], r12
|
||||
vld1.16 {d28}, [r1,:64]!
|
||||
vld1.16 {d29}, [r3,:64], lr
|
||||
vswp d1, d2
|
||||
vswp d5, d6
|
||||
vtrn.32 d0, d1
|
||||
vtrn.32 d4, d5
|
||||
vdup.16 d25, d28[1]
|
||||
vmul.s16 d27, d27, d31
|
||||
transform01 q0, q2, d5, d25, d27, d20, q8, q9
|
||||
b 2f
|
||||
1:
|
||||
mov r4, r0
|
||||
vdup.16 d26, d29[0]
|
||||
vld1.16 {q0}, [r4,:128], r12
|
||||
vld1.16 {q1}, [r4,:128], r12
|
||||
vld1.16 {q2}, [r4,:128], r12
|
||||
vld1.16 {q3}, [r4,:128], r12
|
||||
vld1.16 {d28}, [r1,:64]!
|
||||
vld1.16 {d29}, [r3,:64], lr
|
||||
vswp d1, d2
|
||||
vswp d5, d6
|
||||
vtrn.32 d0, d1
|
||||
vtrn.32 d4, d5
|
||||
vdup.16 d24, d28[0]
|
||||
vdup.16 d25, d28[1]
|
||||
vdup.16 d27, d29[3]
|
||||
vmul.s16 q13, q13, q15
|
||||
transform2 d0, d4, d1, d5, q0, q2, d24, d26, d25, d27, \
|
||||
d16, d17, q9, q10
|
||||
2:
|
||||
vtrn.32 d2, d3
|
||||
vtrn.32 d6, d7
|
||||
vdup.16 d24, d28[2]
|
||||
vdup.16 d26, d29[2]
|
||||
vdup.16 d25, d28[3]
|
||||
vdup.16 d27, d29[1]
|
||||
vmul.s16 q13, q13, q15
|
||||
transform2 d2, d6, d3, d7, q1, q3, d24, d26, d25, d27, \
|
||||
d16, d17, q9, q10
|
||||
vtrn.32 d0, d1
|
||||
vtrn.32 d2, d3
|
||||
vtrn.32 d4, d5
|
||||
vtrn.32 d6, d7
|
||||
vswp d1, d2
|
||||
vswp d5, d6
|
||||
mov r4, r0
|
||||
vst1.16 {q0}, [r4,:128], r12
|
||||
vst1.16 {q1}, [r4,:128], r12
|
||||
vst1.16 {q2}, [r4,:128], r12
|
||||
vst1.16 {q3}, [r4,:128], r12
|
||||
add r0, r0, #16
|
||||
subs r2, r2, #2
|
||||
bgt 1b
|
||||
pop {r4,pc}
|
||||
endfunc
|
||||
|
||||
#define F_SQRT1_2 23170
|
||||
#define F_COS_16_1 30274
|
||||
#define F_COS_16_3 12540
|
||||
|
||||
const coefs, align=4
|
||||
.short F_SQRT1_2, -F_SQRT1_2, -F_SQRT1_2, F_SQRT1_2
|
||||
.short F_COS_16_1,-F_COS_16_1,-F_COS_16_1, F_COS_16_1
|
||||
.short F_COS_16_3,-F_COS_16_3,-F_COS_16_3, F_COS_16_3
|
||||
.short 1, -1, -1, 1
|
||||
endconst
|
||||
|
||||
.macro def_fft n, n2, n4
|
||||
function fft\n\()_neon
|
||||
push {r4, lr}
|
||||
mov r4, r0
|
||||
bl fft\n2\()_neon
|
||||
add r0, r4, #\n4*2*4
|
||||
bl fft\n4\()_neon
|
||||
add r0, r4, #\n4*3*4
|
||||
bl fft\n4\()_neon
|
||||
mov r0, r4
|
||||
pop {r4, lr}
|
||||
movrelx r1, X(ff_cos_\n\()_fixed)
|
||||
mov r2, #\n4/2
|
||||
b fft_pass_neon
|
||||
endfunc
|
||||
.endm
|
||||
|
||||
def_fft 32, 16, 8
|
||||
def_fft 64, 32, 16
|
||||
def_fft 128, 64, 32
|
||||
def_fft 256, 128, 64
|
||||
def_fft 512, 256, 128
|
||||
def_fft 1024, 512, 256
|
||||
def_fft 2048, 1024, 512
|
||||
def_fft 4096, 2048, 1024
|
||||
def_fft 8192, 4096, 2048
|
||||
def_fft 16384, 8192, 4096
|
||||
def_fft 32768, 16384, 8192
|
||||
def_fft 65536, 32768, 16384
|
||||
|
||||
function ff_fft_fixed_calc_neon, export=1
|
||||
ldr r2, [r0]
|
||||
sub r2, r2, #2
|
||||
movrel r3, fft_fixed_tab_neon
|
||||
ldr r3, [r3, r2, lsl #2]
|
||||
mov r0, r1
|
||||
bx r3
|
||||
endfunc
|
||||
|
||||
const fft_fixed_tab_neon, relocate=1
|
||||
.word fft4_neon
|
||||
.word fft8_neon
|
||||
.word fft16_neon
|
||||
.word fft32_neon
|
||||
.word fft64_neon
|
||||
.word fft128_neon
|
||||
.word fft256_neon
|
||||
.word fft512_neon
|
||||
.word fft1024_neon
|
||||
.word fft2048_neon
|
||||
.word fft4096_neon
|
||||
.word fft8192_neon
|
||||
.word fft16384_neon
|
||||
.word fft32768_neon
|
||||
.word fft65536_neon
|
||||
endconst
|
@ -1,193 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Mans Rullgard <mans@mansr.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
.macro prerot dst, rt
|
||||
lsr r3, r6, #2 @ n4
|
||||
add \rt, r4, r6, lsr #1 @ revtab + n4
|
||||
add r9, r3, r3, lsl #1 @ n3
|
||||
add r8, r7, r6 @ tcos + n4
|
||||
add r3, r2, r6, lsr #1 @ in + n4
|
||||
add r9, r2, r9, lsl #1 @ in + n3
|
||||
sub r8, r8, #16
|
||||
sub r10, r3, #16
|
||||
sub r11, r9, #16
|
||||
mov r12, #-16
|
||||
1:
|
||||
vld2.16 {d0,d1}, [r9, :128]!
|
||||
vld2.16 {d2,d3}, [r11,:128], r12
|
||||
vld2.16 {d4,d5}, [r3, :128]!
|
||||
vld2.16 {d6,d7}, [r10,:128], r12
|
||||
vld2.16 {d16,d17},[r7, :128]! @ cos, sin
|
||||
vld2.16 {d18,d19},[r8, :128], r12
|
||||
vrev64.16 q1, q1
|
||||
vrev64.16 q3, q3
|
||||
vrev64.16 q9, q9
|
||||
vneg.s16 d0, d0
|
||||
vneg.s16 d2, d2
|
||||
vneg.s16 d16, d16
|
||||
vneg.s16 d18, d18
|
||||
vhsub.s16 d0, d0, d3 @ re
|
||||
vhsub.s16 d4, d7, d4 @ im
|
||||
vhsub.s16 d6, d6, d5
|
||||
vhsub.s16 d2, d2, d1
|
||||
vmull.s16 q10, d0, d16
|
||||
vmlsl.s16 q10, d4, d17
|
||||
vmull.s16 q11, d0, d17
|
||||
vmlal.s16 q11, d4, d16
|
||||
vmull.s16 q12, d6, d18
|
||||
vmlsl.s16 q12, d2, d19
|
||||
vmull.s16 q13, d6, d19
|
||||
vmlal.s16 q13, d2, d18
|
||||
vshrn.s32 d0, q10, #15
|
||||
vshrn.s32 d1, q11, #15
|
||||
vshrn.s32 d2, q12, #15
|
||||
vshrn.s32 d3, q13, #15
|
||||
vzip.16 d0, d1
|
||||
vzip.16 d2, d3
|
||||
ldrh lr, [r4], #2
|
||||
ldrh r2, [\rt, #-2]!
|
||||
add lr, \dst, lr, lsl #2
|
||||
add r2, \dst, r2, lsl #2
|
||||
vst1.32 {d0[0]}, [lr,:32]
|
||||
vst1.32 {d2[0]}, [r2,:32]
|
||||
ldrh lr, [r4], #2
|
||||
ldrh r2, [\rt, #-2]!
|
||||
add lr, \dst, lr, lsl #2
|
||||
add r2, \dst, r2, lsl #2
|
||||
vst1.32 {d0[1]}, [lr,:32]
|
||||
vst1.32 {d2[1]}, [r2,:32]
|
||||
ldrh lr, [r4], #2
|
||||
ldrh r2, [\rt, #-2]!
|
||||
add lr, \dst, lr, lsl #2
|
||||
add r2, \dst, r2, lsl #2
|
||||
vst1.32 {d1[0]}, [lr,:32]
|
||||
vst1.32 {d3[0]}, [r2,:32]
|
||||
ldrh lr, [r4], #2
|
||||
ldrh r2, [\rt, #-2]!
|
||||
add lr, \dst, lr, lsl #2
|
||||
add r2, \dst, r2, lsl #2
|
||||
vst1.32 {d1[1]}, [lr,:32]
|
||||
vst1.32 {d3[1]}, [r2,:32]
|
||||
subs r6, r6, #32
|
||||
bgt 1b
|
||||
.endm
|
||||
|
||||
function ff_mdct_fixed_calc_neon, export=1
|
||||
push {r1,r4-r11,lr}
|
||||
|
||||
ldr r4, [r0, #8] @ revtab
|
||||
ldr r6, [r0, #16] @ mdct_size; n
|
||||
ldr r7, [r0, #24] @ tcos
|
||||
|
||||
prerot r1, r5
|
||||
|
||||
mov r4, r0
|
||||
bl X(ff_fft_fixed_calc_neon)
|
||||
|
||||
pop {r5}
|
||||
mov r12, #-16
|
||||
ldr r6, [r4, #16] @ mdct_size; n
|
||||
ldr r7, [r4, #24] @ tcos
|
||||
add r5, r5, r6, lsr #1
|
||||
add r7, r7, r6, lsr #1
|
||||
sub r1, r5, #16
|
||||
sub r2, r7, #16
|
||||
1:
|
||||
vld2.16 {d4,d5}, [r7,:128]!
|
||||
vld2.16 {d6,d7}, [r2,:128], r12
|
||||
vld2.16 {d0,d1}, [r5,:128]
|
||||
vld2.16 {d2,d3}, [r1,:128]
|
||||
vrev64.16 q3, q3
|
||||
vrev64.16 q1, q1
|
||||
vneg.s16 q3, q3
|
||||
vneg.s16 q2, q2
|
||||
vmull.s16 q11, d2, d6
|
||||
vmlal.s16 q11, d3, d7
|
||||
vmull.s16 q8, d0, d5
|
||||
vmlsl.s16 q8, d1, d4
|
||||
vmull.s16 q9, d0, d4
|
||||
vmlal.s16 q9, d1, d5
|
||||
vmull.s16 q10, d2, d7
|
||||
vmlsl.s16 q10, d3, d6
|
||||
vshrn.s32 d0, q11, #15
|
||||
vshrn.s32 d1, q8, #15
|
||||
vshrn.s32 d2, q9, #15
|
||||
vshrn.s32 d3, q10, #15
|
||||
vrev64.16 q0, q0
|
||||
vst2.16 {d2,d3}, [r5,:128]!
|
||||
vst2.16 {d0,d1}, [r1,:128], r12
|
||||
subs r6, r6, #32
|
||||
bgt 1b
|
||||
|
||||
pop {r4-r11,pc}
|
||||
endfunc
|
||||
|
||||
function ff_mdct_fixed_calcw_neon, export=1
|
||||
push {r1,r4-r11,lr}
|
||||
|
||||
ldrd r4, r5, [r0, #8] @ revtab, tmp_buf
|
||||
ldr r6, [r0, #16] @ mdct_size; n
|
||||
ldr r7, [r0, #24] @ tcos
|
||||
|
||||
prerot r5, r1
|
||||
|
||||
mov r4, r0
|
||||
mov r1, r5
|
||||
bl X(ff_fft_fixed_calc_neon)
|
||||
|
||||
pop {r7}
|
||||
mov r12, #-16
|
||||
ldr r6, [r4, #16] @ mdct_size; n
|
||||
ldr r9, [r4, #24] @ tcos
|
||||
add r5, r5, r6, lsr #1
|
||||
add r7, r7, r6
|
||||
add r9, r9, r6, lsr #1
|
||||
sub r3, r5, #16
|
||||
sub r1, r7, #16
|
||||
sub r2, r9, #16
|
||||
1:
|
||||
vld2.16 {d4,d5}, [r9,:128]!
|
||||
vld2.16 {d6,d7}, [r2,:128], r12
|
||||
vld2.16 {d0,d1}, [r5,:128]!
|
||||
vld2.16 {d2,d3}, [r3,:128], r12
|
||||
vrev64.16 q3, q3
|
||||
vrev64.16 q1, q1
|
||||
vneg.s16 q3, q3
|
||||
vneg.s16 q2, q2
|
||||
vmull.s16 q8, d2, d6
|
||||
vmlal.s16 q8, d3, d7
|
||||
vmull.s16 q9, d0, d5
|
||||
vmlsl.s16 q9, d1, d4
|
||||
vmull.s16 q10, d0, d4
|
||||
vmlal.s16 q10, d1, d5
|
||||
vmull.s16 q11, d2, d7
|
||||
vmlsl.s16 q11, d3, d6
|
||||
vrev64.32 q8, q8
|
||||
vrev64.32 q9, q9
|
||||
vst2.32 {q10,q11},[r7,:128]!
|
||||
vst2.32 {d16,d18},[r1,:128], r12
|
||||
vst2.32 {d17,d19},[r1,:128], r12
|
||||
subs r6, r6, #32
|
||||
bgt 1b
|
||||
|
||||
pop {r4-r11,pc}
|
||||
endfunc
|
@ -34,7 +34,7 @@
|
||||
(dim) = (are) * (bim) + (aim) * (bre); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
#else /* FFT_FLOAT */
|
||||
|
||||
#define SCALE_FLOAT(a, bits) lrint((a) * (double)(1 << (bits)))
|
||||
|
||||
@ -52,33 +52,6 @@
|
||||
|
||||
#define FIX15(a) av_clip(SCALE_FLOAT(a, 31), -2147483647, 2147483647)
|
||||
|
||||
#else /* FFT_FIXED_32 */
|
||||
|
||||
#include "fft.h"
|
||||
#include "mathops.h"
|
||||
|
||||
void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input);
|
||||
|
||||
#define FIX15(a) av_clip(SCALE_FLOAT(a, 15), -32767, 32767)
|
||||
|
||||
#define sqrthalf ((int16_t)((1<<15)*M_SQRT1_2))
|
||||
|
||||
#define BF(x, y, a, b) do { \
|
||||
x = (a - b) >> 1; \
|
||||
y = (a + b) >> 1; \
|
||||
} while (0)
|
||||
|
||||
#define CMULS(dre, dim, are, aim, bre, bim, sh) do { \
|
||||
(dre) = (MUL16(are, bre) - MUL16(aim, bim)) >> sh; \
|
||||
(dim) = (MUL16(are, bim) + MUL16(aim, bre)) >> sh; \
|
||||
} while (0)
|
||||
|
||||
#define CMUL(dre, dim, are, aim, bre, bim) \
|
||||
CMULS(dre, dim, are, aim, bre, bim, 15)
|
||||
|
||||
#define CMULL(dre, dim, are, aim, bre, bim) \
|
||||
CMULS(dre, dim, are, aim, bre, bim, 0)
|
||||
|
||||
#endif /* FFT_FIXED_32 */
|
||||
|
||||
#endif /* FFT_FLOAT */
|
||||
|
@ -52,12 +52,6 @@ typedef float FFTDouble;
|
||||
|
||||
typedef int32_t FFTSample;
|
||||
|
||||
#else /* FFT_FIXED_32 */
|
||||
|
||||
#define FFT_NAME(x) x ## _fixed
|
||||
|
||||
typedef int16_t FFTSample;
|
||||
|
||||
#endif /* FFT_FIXED_32 */
|
||||
|
||||
typedef struct FFTComplex {
|
||||
@ -108,7 +102,6 @@ struct FFTContext {
|
||||
void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
|
||||
void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
|
||||
void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
|
||||
void (*mdct_calcw)(struct FFTContext *s, FFTDouble *output, const FFTSample *input);
|
||||
enum fft_permutation_type fft_permutation;
|
||||
enum mdct_permutation_type mdct_permutation;
|
||||
uint32_t *revtab32;
|
||||
@ -163,8 +156,6 @@ void ff_fft_init_arm(FFTContext *s);
|
||||
void ff_fft_init_mips(FFTContext *s);
|
||||
void ff_fft_init_ppc(FFTContext *s);
|
||||
|
||||
void ff_fft_fixed_init_arm(FFTContext *s);
|
||||
|
||||
void ff_fft_end(FFTContext *s);
|
||||
|
||||
#define ff_mdct_init FFT_NAME(ff_mdct_init)
|
||||
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FFT_FLOAT 0
|
||||
#define FFT_FIXED_32 0
|
||||
#include "fft_template.c"
|
@ -236,11 +236,7 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
|
||||
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 (CONFIG_MDCT) s->mdct_calcw = s->mdct_calc;
|
||||
if (HAVE_MIPSFPU) ff_fft_init_mips(s);
|
||||
#else
|
||||
if (CONFIG_MDCT) s->mdct_calcw = ff_mdct_calcw_c;
|
||||
if (ARCH_ARM) ff_fft_fixed_init_arm(s);
|
||||
#endif
|
||||
for(j=4; j<=nbits; j++) {
|
||||
ff_init_ff_cos_tabs(j);
|
||||
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FFT_FLOAT 0
|
||||
#define FFT_FIXED_32 0
|
||||
#include "mdct_template.c"
|
||||
|
||||
/* same as ff_mdct_calcw_c with double-width unscaled output */
|
||||
void ff_mdct_calcw_c(FFTContext *s, FFTDouble *out, const FFTSample *input)
|
||||
{
|
||||
int i, j, n, n8, n4, n2, n3;
|
||||
FFTDouble re, im;
|
||||
const uint16_t *revtab = s->revtab;
|
||||
const FFTSample *tcos = s->tcos;
|
||||
const FFTSample *tsin = s->tsin;
|
||||
FFTComplex *x = s->tmp_buf;
|
||||
FFTDComplex *o = (FFTDComplex *)out;
|
||||
|
||||
n = 1 << s->mdct_bits;
|
||||
n2 = n >> 1;
|
||||
n4 = n >> 2;
|
||||
n8 = n >> 3;
|
||||
n3 = 3 * n4;
|
||||
|
||||
/* pre rotation */
|
||||
for(i=0;i<n8;i++) {
|
||||
re = RSCALE(-input[2*i+n3], - input[n3-1-2*i]);
|
||||
im = RSCALE(-input[n4+2*i], + input[n4-1-2*i]);
|
||||
j = revtab[i];
|
||||
CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
|
||||
|
||||
re = RSCALE( input[2*i] , - input[n2-1-2*i]);
|
||||
im = RSCALE(-input[n2+2*i], - input[ n-1-2*i]);
|
||||
j = revtab[n8 + i];
|
||||
CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
|
||||
}
|
||||
|
||||
s->fft_calc(s, x);
|
||||
|
||||
/* post rotation */
|
||||
for(i=0;i<n8;i++) {
|
||||
FFTDouble r0, i0, r1, i1;
|
||||
CMULL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]);
|
||||
CMULL(i0, r1, x[n8+i ].re, x[n8+i ].im, -tsin[n8+i ], -tcos[n8+i ]);
|
||||
o[n8-i-1].re = r0;
|
||||
o[n8-i-1].im = i0;
|
||||
o[n8+i ].re = r1;
|
||||
o[n8+i ].im = i1;
|
||||
}
|
||||
}
|
1
libavcodec/tests/.gitignore
vendored
1
libavcodec/tests/.gitignore
vendored
@ -5,7 +5,6 @@
|
||||
/codec_desc
|
||||
/dct
|
||||
/fft
|
||||
/fft-fixed
|
||||
/fft-fixed32
|
||||
/golomb
|
||||
/h264_levels
|
||||
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define FFT_FLOAT 0
|
||||
#define AVFFT 0
|
||||
#include "fft.c"
|
@ -26,27 +26,7 @@ FATE_FFT_ALL = $(FATE_DCT-yes) $(FATE_FFT-yes) $(FATE_MDCT-yes) $(FATE_RDFT-yes)
|
||||
$(FATE_FFT_ALL): libavcodec/tests/fft$(EXESUF)
|
||||
$(FATE_FFT_ALL): CMD = run libavcodec/tests/fft$(EXESUF) $(CPUFLAGS:%=-c%) $(ARGS)
|
||||
|
||||
define DEF_FFT_FIXED
|
||||
FATE_FFT_FIXED-$(CONFIG_FFT) += fate-fft-fixed-$(1) fate-ifft-fixed-$(1)
|
||||
FATE_MDCT_FIXED-$(CONFIG_MDCT) += fate-mdct-fixed-$(1) fate-imdct-fixed-$(1)
|
||||
|
||||
fate-fft-fixed-$(1): ARGS = -n$(1)
|
||||
fate-ifft-fixed-$(1): ARGS = -n$(1) -i
|
||||
fate-mdct-fixed-$(1): ARGS = -n$(1) -m
|
||||
fate-imdct-fixed-$(1): ARGS = -n$(1) -m -i
|
||||
endef
|
||||
|
||||
$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT_FIXED,$(N))))
|
||||
|
||||
fate-fft-fixed: $(FATE_FFT_FIXED-yes)
|
||||
fate-mdct-fixed: $(FATE_MDCT_FIXED-yes)
|
||||
|
||||
FATE_FFT_FIXED_ALL = $(FATE_FFT_FIXED-yes) $(FATE_MDCT_FIXED-yes)
|
||||
|
||||
$(FATE_FFT_FIXED_ALL): libavcodec/tests/fft-fixed$(EXESUF)
|
||||
$(FATE_FFT_FIXED_ALL): CMD = run libavcodec/tests/fft-fixed$(EXESUF) $(CPUFLAGS:%=-c%) $(ARGS)
|
||||
|
||||
$(FATE_FFT_ALL) $(FATE_FFT_FIXED_ALL): CMP = null
|
||||
$(FATE_FFT_ALL): CMP = null
|
||||
|
||||
define DEF_FFT_FIXED32
|
||||
FATE_FFT_FIXED32 += fate-fft-fixed32-$(1) fate-ifft-fixed32-$(1) \
|
||||
@ -95,9 +75,9 @@ $(FATE_AV_FFT_ALL): CMD = run libavcodec/tests/avfft$(EXESUF) $(CPUFLAGS:%=-c%)
|
||||
$(FATE_AV_FFT_ALL): CMP = null
|
||||
|
||||
fate-dct: fate-dct-float
|
||||
fate-fft: fate-fft-float fate-fft-fixed fate-fft-fixed32
|
||||
fate-mdct: fate-mdct-float fate-mdct-fixed
|
||||
fate-fft: fate-fft-float fate-fft-fixed32
|
||||
fate-mdct: fate-mdct-float
|
||||
fate-rdft: fate-rdft-float
|
||||
|
||||
FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT_ALL) $(FATE_FFT_FIXED_ALL) $(FATE_FFT_FIXED32) $(FATE_AV_FFT_ALL)
|
||||
fate-fft-all: $(FATE_FFT_ALL) $(FATE_FFT_FIXED_ALL) $(FATE_FFT_FIXED32) $(FATE_AV_FFT_ALL)
|
||||
FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT_ALL) $(FATE_FFT_FIXED32) $(FATE_AV_FFT_ALL)
|
||||
fate-fft-all: $(FATE_FFT_ALL) $(FATE_FFT_FIXED32) $(FATE_AV_FFT_ALL)
|
||||
|
Loading…
Reference in New Issue
Block a user