mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
audioresample: convert from liboil to orc
This commit is contained in:
parent
84832877a6
commit
e39e729a70
2 changed files with 15 additions and 26 deletions
|
@ -1,13 +1,5 @@
|
|||
plugin_LTLIBRARIES = libgstaudioresample.la
|
||||
|
||||
if AUDIORESAMPLE_NEEDS_LIBOIL
|
||||
COND_LIBOIL_CFLAGS=$(LIBOIL_CFLAGS)
|
||||
COND_LIBOIL_LIBS=$(LIBOIL_LIBS)
|
||||
else
|
||||
COND_LIBOIL_CFLAGS=
|
||||
COND_LIBOIL_LIBS=
|
||||
endif
|
||||
|
||||
libgstaudioresample_la_SOURCES = \
|
||||
gstaudioresample.c \
|
||||
speex_resampler_int.c \
|
||||
|
@ -18,13 +10,13 @@ libgstaudioresample_la_CFLAGS = \
|
|||
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||
$(GST_BASE_CFLAGS) \
|
||||
$(GST_CFLAGS) \
|
||||
$(COND_LIBOIL_CFLAGS)
|
||||
$(ORC_CFLAGS)
|
||||
|
||||
libgstaudioresample_la_LIBADD = \
|
||||
$(GST_PLUGINS_BASE_LIBS) \
|
||||
$(GST_BASE_LIBS) \
|
||||
$(GST_LIBS) \
|
||||
$(COND_LIBOIL_LIBS) \
|
||||
$(ORC_LIBS) -lorc-test-0.4 \
|
||||
$(LIBM)
|
||||
|
||||
libgstaudioresample_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||
|
|
|
@ -50,11 +50,10 @@
|
|||
#include <gst/audio/audio.h>
|
||||
#include <gst/base/gstbasetransform.h>
|
||||
|
||||
#if defined AUDIORESAMPLE_FORMAT_AUTO
|
||||
#define OIL_ENABLE_UNSTABLE_API
|
||||
#include <liboil/liboilprofile.h>
|
||||
#include <liboil/liboil.h>
|
||||
#endif
|
||||
#include <orc/orc.h>
|
||||
#include <orc-test/orctest.h>
|
||||
#include <orc-test/orcprofile.h>
|
||||
|
||||
|
||||
GST_DEBUG_CATEGORY (audio_resample_debug);
|
||||
#define GST_CAT_DEFAULT audio_resample_debug
|
||||
|
@ -1391,13 +1390,13 @@ _benchmark_int_int (SpeexResamplerState * st)
|
|||
static gboolean
|
||||
_benchmark_integer_resampling (void)
|
||||
{
|
||||
OilProfile a, b;
|
||||
OrcProfile a, b;
|
||||
gdouble av, bv;
|
||||
SpeexResamplerState *sta, *stb;
|
||||
int i;
|
||||
|
||||
oil_profile_init (&a);
|
||||
oil_profile_init (&b);
|
||||
orc_profile_init (&a);
|
||||
orc_profile_init (&b);
|
||||
|
||||
sta = resample_float_resampler_init (1, 48000, 24000, 4, NULL);
|
||||
if (sta == NULL) {
|
||||
|
@ -1414,23 +1413,23 @@ _benchmark_integer_resampling (void)
|
|||
|
||||
/* Benchmark */
|
||||
for (i = 0; i < 10; i++) {
|
||||
oil_profile_start (&a);
|
||||
orc_profile_start (&a);
|
||||
if (!_benchmark_int_float (sta))
|
||||
goto error;
|
||||
oil_profile_stop (&a);
|
||||
orc_profile_stop (&a);
|
||||
}
|
||||
|
||||
/* Benchmark */
|
||||
for (i = 0; i < 10; i++) {
|
||||
oil_profile_start (&b);
|
||||
orc_profile_start (&b);
|
||||
if (!_benchmark_int_int (stb))
|
||||
goto error;
|
||||
oil_profile_stop (&b);
|
||||
orc_profile_stop (&b);
|
||||
}
|
||||
|
||||
/* Handle results */
|
||||
oil_profile_get_ave_std (&a, &av, NULL);
|
||||
oil_profile_get_ave_std (&b, &bv, NULL);
|
||||
orc_profile_get_ave_std (&a, &av, NULL);
|
||||
orc_profile_get_ave_std (&b, &bv, NULL);
|
||||
|
||||
/* Remember benchmark result in global variable */
|
||||
gst_audio_resample_use_int = (av > bv);
|
||||
|
@ -1458,8 +1457,6 @@ plugin_init (GstPlugin * plugin)
|
|||
GST_DEBUG_CATEGORY_INIT (audio_resample_debug, "audioresample", 0,
|
||||
"audio resampling element");
|
||||
#if defined AUDIORESAMPLE_FORMAT_AUTO
|
||||
oil_init ();
|
||||
|
||||
if (!_benchmark_integer_resampling ())
|
||||
return FALSE;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue