On Mon, Jun 13, 2016 at 2:19 AM, Michael Niedermayer
<mich...@niedermayer.cc> wrote:
> On Sun, Jun 12, 2016 at 07:56:31AM +0700, Muhammad Faiz wrote:
>> give high quality resampling
>> as good as with linear_interp=on
>> as fast as without linear_interp=on
>> tested visually with ffplay
>> ffplay -f lavfi "aevalsrc='sin(10000*t*t)', aresample=osr=48000,
>> showcqt=gamma=5"
>> ffplay -f lavfi "aevalsrc='sin(10000*t*t)',
>> aresample=osr=48000:linear_interp=on, showcqt=gamma=5"
>> ffplay -f lavfi "aevalsrc='sin(10000*t*t)',
>> aresample=osr=48000:exact_rational=on, showcqt=gamma=5"
>>
>> slightly speed improvement
>> for fair comparison with -cpuflags 0
>> audio.wav is ~ 1 hour 44100 stereo 16bit wav file
>> ffmpeg -i audio.wav -af aresample=osr=48000 -f null -
>>         old         new
>> real    13.498s     13.121s
>> user    13.364s     12.987s
>> sys      0.131s      0.129s
>>
>> linear_interp=on
>>         old         new
>> real    23.035s     23.050s
>> user    22.907s     22.917s
>> sys      0.119s     0.125s
>>
>> exact_rational=on
>> real    12.418s
>> user    12.298s
>> sys      0.114s
>>
>> possibility to decrease memory usage if soft compensation is ignored
>
> interresting
>
> can you add some fate tests ?
> (that way this also could be easily tested for platform specific bugs)
>
patch attached

thanks
From bddd8cff10cff568dcec8cb953168b6aedc2d5a2 Mon Sep 17 00:00:00 2001
From: Muhammad Faiz <mfc...@gmail.com>
Date: Mon, 13 Jun 2016 07:35:40 +0700
Subject: [PATCH] fate: add libswresample exact_rational test

Signed-off-by: Muhammad Faiz <mfc...@gmail.com>
---
 tests/fate/libswresample.mak | 256 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 256 insertions(+)

diff --git a/tests/fate/libswresample.mak b/tests/fate/libswresample.mak
index 064c0f6..4e76405 100644
--- a/tests/fate/libswresample.mak
+++ b/tests/fate/libswresample.mak
@@ -378,6 +378,257 @@ fate-swr-resample_async-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20310
 fate-swr-resample_async-s16p-8000-44100: CMP_TARGET = 11187.01
 fate-swr-resample_async-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20344
 
+define ARESAMPLE_EXACT
+FATE_SWR_RESAMPLE += fate-swr-resample_exact-$(3)-$(1)-$(2)
+fate-swr-resample_exact-$(3)-$(1)-$(2): tests/data/asynth-$(1)-1.wav
+fate-swr-resample_exact-$(3)-$(1)-$(2): CMD = ffmpeg -i $(TARGET_PATH)/tests/data/asynth-$(1)-1.wav -af atrim=end_sample=10240,aresample=$(2):internal_sample_fmt=$(3):exact_rational=on,aformat=$(3),aresample=$(1):internal_sample_fmt=$(3):exact_rational=on -f wav -acodec pcm_s16le -
+
+fate-swr-resample_exact-$(3)-$(1)-$(2): CMP = stddev
+fate-swr-resample_exact-$(3)-$(1)-$(2): CMP_UNIT = $(5)
+fate-swr-resample_exact-$(3)-$(1)-$(2): FUZZ = 0.1
+fate-swr-resample_exact-$(3)-$(1)-$(2): REF = tests/data/asynth-$(1)-1.wav
+endef
+
+fate-swr-resample_exact-dblp-2626-44100: CMP_TARGET = 1352.68
+fate-swr-resample_exact-dblp-2626-44100: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-dblp-2626-48000: CMP_TARGET = 1352.65
+fate-swr-resample_exact-dblp-2626-48000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-dblp-2626-8000: CMP_TARGET = 1353.08
+fate-swr-resample_exact-dblp-2626-8000: SIZE_TOLERANCE = 31512 - 20482
+
+fate-swr-resample_exact-dblp-2626-96000: CMP_TARGET = 1352.67
+fate-swr-resample_exact-dblp-2626-96000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-dblp-44100-2626: CMP_TARGET = 185.82
+fate-swr-resample_exact-dblp-44100-2626: SIZE_TOLERANCE = 529200 - 20490
+
+fate-swr-resample_exact-dblp-44100-48000: CMP_TARGET = 9.65
+fate-swr-resample_exact-dblp-44100-48000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-dblp-44100-8000: CMP_TARGET = 75.38
+fate-swr-resample_exact-dblp-44100-8000: SIZE_TOLERANCE = 529200 - 20486
+
+fate-swr-resample_exact-dblp-44100-96000: CMP_TARGET = 11.45
+fate-swr-resample_exact-dblp-44100-96000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-dblp-48000-2626: CMP_TARGET = 456.51
+fate-swr-resample_exact-dblp-48000-2626: SIZE_TOLERANCE = 576000 - 20510
+
+fate-swr-resample_exact-dblp-48000-44100: CMP_TARGET = 0.26
+fate-swr-resample_exact-dblp-48000-44100: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-dblp-48000-8000: CMP_TARGET = 62.36
+fate-swr-resample_exact-dblp-48000-8000: SIZE_TOLERANCE = 576000 - 20484
+
+fate-swr-resample_exact-dblp-48000-96000: CMP_TARGET = 0.47
+fate-swr-resample_exact-dblp-48000-96000: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-dblp-8000-2626: CMP_TARGET = 2506.02
+fate-swr-resample_exact-dblp-8000-2626: SIZE_TOLERANCE = 96000 - 20486
+
+fate-swr-resample_exact-dblp-8000-44100: CMP_TARGET = 14.59
+fate-swr-resample_exact-dblp-8000-44100: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-dblp-8000-48000: CMP_TARGET = 14.50
+fate-swr-resample_exact-dblp-8000-48000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-dblp-8000-96000: CMP_TARGET = 13.62
+fate-swr-resample_exact-dblp-8000-96000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-dblp-96000-2626: CMP_TARGET = 675.08
+fate-swr-resample_exact-dblp-96000-2626: SIZE_TOLERANCE = 1152000 - 20474
+
+fate-swr-resample_exact-dblp-96000-44100: CMP_TARGET = 1.26
+fate-swr-resample_exact-dblp-96000-44100: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-dblp-96000-48000: CMP_TARGET = 1.00
+fate-swr-resample_exact-dblp-96000-48000: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-dblp-96000-8000: CMP_TARGET = 58.52
+fate-swr-resample_exact-dblp-96000-8000: SIZE_TOLERANCE = 1152000 - 20496
+
+fate-swr-resample_exact-fltp-2626-44100: CMP_TARGET = 1352.68
+fate-swr-resample_exact-fltp-2626-44100: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-fltp-2626-48000: CMP_TARGET = 1352.65
+fate-swr-resample_exact-fltp-2626-48000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-fltp-2626-8000: CMP_TARGET = 1353.08
+fate-swr-resample_exact-fltp-2626-8000: SIZE_TOLERANCE = 31512 - 20482
+
+fate-swr-resample_exact-fltp-2626-96000: CMP_TARGET = 1352.67
+fate-swr-resample_exact-fltp-2626-96000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-fltp-44100-2626: CMP_TARGET = 185.82
+fate-swr-resample_exact-fltp-44100-2626: SIZE_TOLERANCE = 529200 - 20490
+
+fate-swr-resample_exact-fltp-44100-48000: CMP_TARGET = 9.65
+fate-swr-resample_exact-fltp-44100-48000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-fltp-44100-8000: CMP_TARGET = 75.38
+fate-swr-resample_exact-fltp-44100-8000: SIZE_TOLERANCE = 529200 - 20486
+
+fate-swr-resample_exact-fltp-44100-96000: CMP_TARGET = 11.45
+fate-swr-resample_exact-fltp-44100-96000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-fltp-48000-2626: CMP_TARGET = 456.51
+fate-swr-resample_exact-fltp-48000-2626: SIZE_TOLERANCE = 576000 - 20510
+
+fate-swr-resample_exact-fltp-48000-44100: CMP_TARGET = 0.26
+fate-swr-resample_exact-fltp-48000-44100: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-fltp-48000-8000: CMP_TARGET = 62.36
+fate-swr-resample_exact-fltp-48000-8000: SIZE_TOLERANCE = 576000 - 20484
+
+fate-swr-resample_exact-fltp-48000-96000: CMP_TARGET = 0.47
+fate-swr-resample_exact-fltp-48000-96000: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-fltp-8000-2626: CMP_TARGET = 2506.02
+fate-swr-resample_exact-fltp-8000-2626: SIZE_TOLERANCE = 96000 - 20486
+
+fate-swr-resample_exact-fltp-8000-44100: CMP_TARGET = 14.59
+fate-swr-resample_exact-fltp-8000-44100: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-fltp-8000-48000: CMP_TARGET = 14.50
+fate-swr-resample_exact-fltp-8000-48000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-fltp-8000-96000: CMP_TARGET = 13.62
+fate-swr-resample_exact-fltp-8000-96000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-fltp-96000-2626: CMP_TARGET = 675.08
+fate-swr-resample_exact-fltp-96000-2626: SIZE_TOLERANCE = 1152000 - 20474
+
+fate-swr-resample_exact-fltp-96000-44100: CMP_TARGET = 1.26
+fate-swr-resample_exact-fltp-96000-44100: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-fltp-96000-48000: CMP_TARGET = 1.00
+fate-swr-resample_exact-fltp-96000-48000: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-fltp-96000-8000: CMP_TARGET = 58.52
+fate-swr-resample_exact-fltp-96000-8000: SIZE_TOLERANCE = 1152000 - 20496
+
+fate-swr-resample_exact-s16p-2626-44100: CMP_TARGET = 1393.01
+fate-swr-resample_exact-s16p-2626-44100: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-s16p-2626-48000: CMP_TARGET = 1392.99
+fate-swr-resample_exact-s16p-2626-48000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-s16p-2626-8000: CMP_TARGET = 1393.90
+fate-swr-resample_exact-s16p-2626-8000: SIZE_TOLERANCE = 31512 - 20482
+
+fate-swr-resample_exact-s16p-2626-96000: CMP_TARGET = 1393.08
+fate-swr-resample_exact-s16p-2626-96000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-s16p-44100-2626: CMP_TARGET = 185.84
+fate-swr-resample_exact-s16p-44100-2626: SIZE_TOLERANCE = 529200 - 20490
+
+fate-swr-resample_exact-s16p-44100-48000: CMP_TARGET = 9.67
+fate-swr-resample_exact-s16p-44100-48000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-s16p-44100-8000: CMP_TARGET = 75.43
+fate-swr-resample_exact-s16p-44100-8000: SIZE_TOLERANCE = 529200 - 20486
+
+fate-swr-resample_exact-s16p-44100-96000: CMP_TARGET = 11.46
+fate-swr-resample_exact-s16p-44100-96000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-s16p-48000-2626: CMP_TARGET = 456.55
+fate-swr-resample_exact-s16p-48000-2626: SIZE_TOLERANCE = 576000 - 20510
+
+fate-swr-resample_exact-s16p-48000-44100: CMP_TARGET = 0.72
+fate-swr-resample_exact-s16p-48000-44100: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-s16p-48000-8000: CMP_TARGET = 62.39
+fate-swr-resample_exact-s16p-48000-8000: SIZE_TOLERANCE = 576000 - 20484
+
+fate-swr-resample_exact-s16p-48000-96000: CMP_TARGET = 0.50
+fate-swr-resample_exact-s16p-48000-96000: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-s16p-8000-2626: CMP_TARGET = 2506.02
+fate-swr-resample_exact-s16p-8000-2626: SIZE_TOLERANCE = 96000 - 20486
+
+fate-swr-resample_exact-s16p-8000-44100: CMP_TARGET = 14.63
+fate-swr-resample_exact-s16p-8000-44100: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-s16p-8000-48000: CMP_TARGET = 14.54
+fate-swr-resample_exact-s16p-8000-48000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-s16p-8000-96000: CMP_TARGET = 13.65
+fate-swr-resample_exact-s16p-8000-96000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-s16p-96000-2626: CMP_TARGET = 675.14
+fate-swr-resample_exact-s16p-96000-2626: SIZE_TOLERANCE = 1152000 - 20474
+
+fate-swr-resample_exact-s16p-96000-44100: CMP_TARGET = 1.45
+fate-swr-resample_exact-s16p-96000-44100: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-s16p-96000-48000: CMP_TARGET = 1.03
+fate-swr-resample_exact-s16p-96000-48000: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-s16p-96000-8000: CMP_TARGET = 58.56
+fate-swr-resample_exact-s16p-96000-8000: SIZE_TOLERANCE = 1152000 - 20496
+
+fate-swr-resample_exact-s32p-2626-44100: CMP_TARGET = 1393.01
+fate-swr-resample_exact-s32p-2626-44100: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-s32p-2626-48000: CMP_TARGET = 1392.99
+fate-swr-resample_exact-s32p-2626-48000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-s32p-2626-8000: CMP_TARGET = 1393.89
+fate-swr-resample_exact-s32p-2626-8000: SIZE_TOLERANCE = 31512 - 20482
+
+fate-swr-resample_exact-s32p-2626-96000: CMP_TARGET = 1393.00
+fate-swr-resample_exact-s32p-2626-96000: SIZE_TOLERANCE = 31512 - 20480
+
+fate-swr-resample_exact-s32p-44100-2626: CMP_TARGET = 185.82
+fate-swr-resample_exact-s32p-44100-2626: SIZE_TOLERANCE = 529200 - 20490
+
+fate-swr-resample_exact-s32p-44100-48000: CMP_TARGET = 9.65
+fate-swr-resample_exact-s32p-44100-48000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-s32p-44100-8000: CMP_TARGET = 75.38
+fate-swr-resample_exact-s32p-44100-8000: SIZE_TOLERANCE = 529200 - 20486
+
+fate-swr-resample_exact-s32p-44100-96000: CMP_TARGET = 11.45
+fate-swr-resample_exact-s32p-44100-96000: SIZE_TOLERANCE = 529200 - 20482
+
+fate-swr-resample_exact-s32p-48000-2626: CMP_TARGET = 456.51
+fate-swr-resample_exact-s32p-48000-2626: SIZE_TOLERANCE = 576000 - 20510
+
+fate-swr-resample_exact-s32p-48000-44100: CMP_TARGET = 0.26
+fate-swr-resample_exact-s32p-48000-44100: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-s32p-48000-8000: CMP_TARGET = 62.36
+fate-swr-resample_exact-s32p-48000-8000: SIZE_TOLERANCE = 576000 - 20484
+
+fate-swr-resample_exact-s32p-48000-96000: CMP_TARGET = 0.47
+fate-swr-resample_exact-s32p-48000-96000: SIZE_TOLERANCE = 576000 - 20480
+
+fate-swr-resample_exact-s32p-8000-2626: CMP_TARGET = 2506.02
+fate-swr-resample_exact-s32p-8000-2626: SIZE_TOLERANCE = 96000 - 20486
+
+fate-swr-resample_exact-s32p-8000-44100: CMP_TARGET = 14.59
+fate-swr-resample_exact-s32p-8000-44100: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-s32p-8000-48000: CMP_TARGET = 14.50
+fate-swr-resample_exact-s32p-8000-48000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-s32p-8000-96000: CMP_TARGET = 13.62
+fate-swr-resample_exact-s32p-8000-96000: SIZE_TOLERANCE = 96000 - 20480
+
+fate-swr-resample_exact-s32p-96000-2626: CMP_TARGET = 675.08
+fate-swr-resample_exact-s32p-96000-2626: SIZE_TOLERANCE = 1152000 - 20474
+
+fate-swr-resample_exact-s32p-96000-44100: CMP_TARGET = 1.26
+fate-swr-resample_exact-s32p-96000-44100: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-s32p-96000-48000: CMP_TARGET = 1.00
+fate-swr-resample_exact-s32p-96000-48000: SIZE_TOLERANCE = 1152000 - 20480
+
+fate-swr-resample_exact-s32p-96000-8000: CMP_TARGET = 58.52
+fate-swr-resample_exact-s32p-96000-8000: SIZE_TOLERANCE = 1152000 - 20496
+
 $(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s16p,s16le,s16)
 $(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,s32p,s32le,s16)
 $(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE,fltp,f32le,s16)
@@ -393,6 +644,11 @@ $(call CROSS_TEST,$(SAMPLERATES_NN),ARESAMPLE_NN,fltp,f32le,s16)
 $(call CROSS_TEST,$(SAMPLERATES_NN),ARESAMPLE_ASYNC,s16p,s16le,s16)
 $(call CROSS_TEST,$(SAMPLERATES_NN),ARESAMPLE_ASYNC,fltp,f32le,s16)
 
+$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE_EXACT,s16p,s16le,s16)
+$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE_EXACT,s32p,s32le,s16)
+$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE_EXACT,fltp,f32le,s16)
+$(call CROSS_TEST,$(SAMPLERATES),ARESAMPLE_EXACT,dblp,f64le,s16)
+
 
 FATE_SWR_RESAMPLE-$(call FILTERDEMDECENCMUX, ARESAMPLE, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_SWR_RESAMPLE)
 fate-swr-resample: $(FATE_SWR_RESAMPLE-yes)
-- 
2.5.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to