History

avcodec/mpegaudiodsp: Init dct32 directly

This avoids using dct.c and will allow removing it.

Andreas Rheinhardt committed 3 years ago

Commit d9464f31 parent 145db385 files · +10 −8Browse files

Unified · Split

5 files
  1. configure +0 −1
  2. libavcodec/Makefile +2 −1
  3. libavcodec/mpegaudiodsp.c +1 −5
  4. libavcodec/x86/Makefile +1 −1
  5. libavcodec/x86/mpegaudiodsp.c +6 −0
configure+0−1
@@ -2790,7 +2790,6 @@ mdct_select="fft" · 2789 unmodified lines
27902790 me_cmp_select="idctdsp"
27912791 mpeg_er_select="error_resilience"
27922792 mpegaudio_select="mpegaudiodsp mpegaudioheader"
2793−mpegaudiodsp_select="dct"
27942793 mpegvideo_select="blockdsp hpeldsp idctdsp videodsp"
27952794 mpegvideodec_select="h264chroma mpegvideo mpeg_er"
27962795 mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
libavcodec/Makefile+2−1
@@ -134,7 +134,8 @@ OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodec_common.o \ · 133 unmodified lines
134134 OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \
135135 mpegaudiodsp_data.o \
136136 mpegaudiodsp_fixed.o \
137− mpegaudiodsp_float.o
137+ mpegaudiodsp_float.o \
138+ dct32_fixed.o dct32_float.o
138139 OBJS-$(CONFIG_MPEGAUDIOHEADER) += mpegaudiodecheader.o mpegaudiotabs.o
139140 OBJS-$(CONFIG_MPEG4AUDIO) += mpeg4audio.o mpeg4audio_sample_rates.o
140141 OBJS-$(CONFIG_MPEGVIDEO) += mpegvideo.o rl.o \
libavcodec/mpegaudiodsp.c+1−5
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include "libavutil/thread.h"
2424 #include "mpegaudio.h"
2525 #include "mpegaudiodsp.h"
26−#include "dct.h"
2726 #include "dct32.h"
2827
2928 static AVOnce mpadsp_table_init = AV_ONCE_INIT;
@@ -81,15 +80,12 @@ static av_cold void mpadsp_init_tabs(void) · 51 unmodified lines
8180
8281 av_cold void ff_mpadsp_init(MPADSPContext *s)
8382 {
84− DCTContext dct;
85−
86− ff_dct_init(&dct, 5, DCT_II);
8783 ff_thread_once(&mpadsp_table_init, &mpadsp_init_tabs);
8884
8985 s->apply_window_float = ff_mpadsp_apply_window_float;
9086 s->apply_window_fixed = ff_mpadsp_apply_window_fixed;
9187
92− s->dct32_float = dct.dct32;
88+ s->dct32_float = ff_dct32_float;
9389 s->dct32_fixed = ff_dct32_fixed;
9490
9591 s->imdct36_blocks_float = ff_imdct36_blocks_float;
libavcodec/x86/Makefile+1−1
@@ -126,7 +126,7 @@ X86ASM-OBJS-$(CONFIG_LLVIDDSP) += x86/lossless_videodsp.o · 125 unmodified lines
126126 X86ASM-OBJS-$(CONFIG_LLVIDENCDSP) += x86/lossless_videoencdsp.o
127127 X86ASM-OBJS-$(CONFIG_LPC) += x86/lpc.o
128128 X86ASM-OBJS-$(CONFIG_ME_CMP) += x86/me_cmp.o
129−X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o
129+X86ASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/dct32.o x86/imdct36.o
130130 X86ASM-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoencdsp.o
131131 X86ASM-OBJS-$(CONFIG_OPUS_DECODER) += x86/opusdsp.o
132132 X86ASM-OBJS-$(CONFIG_OPUS_ENCODER) += x86/celt_pvq_search.o
libavcodec/x86/mpegaudiodsp.c+6−0
@@ -45,6 +45,9 @@ void ff_four_imdct36_float_sse(float *out, float *buf, float *in, float *win, · 44 unmodified lines
4545 void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win,
4646 float *tmpbuf);
4747
48+void ff_dct32_float_sse2(float *out, const float *in);
49+void ff_dct32_float_avx (float *out, const float *in);
50+
4851 DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40];
4952
5053 #if HAVE_6REGS && HAVE_SSE_INLINE
@@ -267,6 +270,7 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) · 216 unmodified lines
267270 #if HAVE_SSE
268271 if (EXTERNAL_SSE2(cpu_flags)) {
269272 s->imdct36_blocks_float = imdct36_blocks_sse2;
273+ s->dct32_float = ff_dct32_float_sse2;
270274 }
271275 if (EXTERNAL_SSE3(cpu_flags)) {
272276 s->imdct36_blocks_float = imdct36_blocks_sse3;
@@ -279,6 +283,8 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) · 6 unmodified lines
279283 if (EXTERNAL_AVX(cpu_flags)) {
280284 s->imdct36_blocks_float = imdct36_blocks_avx;
281285 }
286+ if (EXTERNAL_AVX_FAST(cpu_flags))
287+ s->dct32_float = ff_dct32_float_avx;
282288 #endif
283289 #endif /* HAVE_X86ASM */
284290 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t