2015-11-13 14:32:29 +00:00
|
|
|
/* GStreamer
|
2016-02-19 15:39:43 +00:00
|
|
|
* Copyright (C) <2016> Wim Taymans <wim.taymans@gmail.com>
|
2015-11-13 14:32:29 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2016-09-28 12:07:38 +00:00
|
|
|
#include "audio-resampler-macros.h"
|
|
|
|
#include "audio-resampler-x86-sse.h"
|
|
|
|
#include "audio-resampler-x86-sse2.h"
|
|
|
|
#include "audio-resampler-x86-sse41.h"
|
2016-01-15 11:45:47 +00:00
|
|
|
|
2016-01-12 17:55:19 +00:00
|
|
|
static void
|
2016-02-19 15:39:43 +00:00
|
|
|
audio_resampler_check_x86 (const gchar *option)
|
2016-01-12 17:55:19 +00:00
|
|
|
{
|
2016-02-19 15:39:43 +00:00
|
|
|
if (!strcmp (option, "sse")) {
|
2016-09-28 12:07:38 +00:00
|
|
|
#if defined (HAVE_XMMINTRIN_H) && HAVE_SSE
|
2016-01-13 16:44:39 +00:00
|
|
|
GST_DEBUG ("enable SSE optimisations");
|
2016-02-19 09:40:03 +00:00
|
|
|
resample_gfloat_full_1 = resample_gfloat_full_1_sse;
|
2016-02-10 11:04:12 +00:00
|
|
|
resample_gfloat_linear_1 = resample_gfloat_linear_1_sse;
|
2016-02-10 16:28:24 +00:00
|
|
|
resample_gfloat_cubic_1 = resample_gfloat_cubic_1_sse;
|
2016-02-22 12:19:02 +00:00
|
|
|
|
|
|
|
interpolate_gfloat_linear = interpolate_gfloat_linear_sse;
|
|
|
|
interpolate_gfloat_cubic = interpolate_gfloat_cubic_sse;
|
2016-02-11 16:40:56 +00:00
|
|
|
#else
|
|
|
|
GST_DEBUG ("SSE optimisations not enabled");
|
2016-01-15 11:45:47 +00:00
|
|
|
#endif
|
2016-02-19 15:39:43 +00:00
|
|
|
} else if (!strcmp (option, "sse2")) {
|
2016-09-28 12:07:38 +00:00
|
|
|
#if defined (HAVE_EMMINTRIN_H) && HAVE_SSE2
|
2016-01-13 16:44:39 +00:00
|
|
|
GST_DEBUG ("enable SSE2 optimisations");
|
2016-02-19 09:40:03 +00:00
|
|
|
resample_gint16_full_1 = resample_gint16_full_1_sse2;
|
2016-02-11 10:57:26 +00:00
|
|
|
resample_gint16_linear_1 = resample_gint16_linear_1_sse2;
|
|
|
|
resample_gint16_cubic_1 = resample_gint16_cubic_1_sse2;
|
|
|
|
|
2016-02-22 12:19:02 +00:00
|
|
|
interpolate_gint16_linear = interpolate_gint16_linear_sse2;
|
|
|
|
interpolate_gint16_cubic = interpolate_gint16_cubic_sse2;
|
|
|
|
|
2016-02-19 09:40:03 +00:00
|
|
|
resample_gdouble_full_1 = resample_gdouble_full_1_sse2;
|
2016-02-11 10:57:26 +00:00
|
|
|
resample_gdouble_linear_1 = resample_gdouble_linear_1_sse2;
|
|
|
|
resample_gdouble_cubic_1 = resample_gdouble_cubic_1_sse2;
|
|
|
|
|
2016-02-15 17:06:19 +00:00
|
|
|
interpolate_gdouble_linear = interpolate_gdouble_linear_sse2;
|
|
|
|
interpolate_gdouble_cubic = interpolate_gdouble_cubic_sse2;
|
2016-02-11 16:40:56 +00:00
|
|
|
#else
|
|
|
|
GST_DEBUG ("SSE2 optimisations not enabled");
|
2016-01-13 16:44:39 +00:00
|
|
|
#endif
|
2016-01-15 11:45:47 +00:00
|
|
|
} else if (!strcmp (option, "sse41")) {
|
2016-09-29 14:15:16 +00:00
|
|
|
#if defined (__x86_64__) && \
|
|
|
|
defined (HAVE_SMMINTRIN_H) && defined (HAVE_EMMINTRIN_H) && \
|
|
|
|
HAVE_SSE41
|
2016-01-15 11:45:47 +00:00
|
|
|
GST_DEBUG ("enable SSE41 optimisations");
|
2016-02-19 09:40:03 +00:00
|
|
|
resample_gint32_full_1 = resample_gint32_full_1_sse41;
|
2016-02-11 16:40:56 +00:00
|
|
|
resample_gint32_linear_1 = resample_gint32_linear_1_sse41;
|
|
|
|
resample_gint32_cubic_1 = resample_gint32_cubic_1_sse41;
|
|
|
|
#else
|
|
|
|
GST_DEBUG ("SSE41 optimisations not enabled");
|
2016-01-15 11:45:47 +00:00
|
|
|
#endif
|
|
|
|
}
|
2015-11-13 14:32:29 +00:00
|
|
|
}
|