|
Packit |
971217 |
/* GStreamer
|
|
Packit |
971217 |
* Copyright (C) <2016> Wim Taymans <wim.taymans@gmail.com>
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
971217 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
971217 |
* License as published by the Free Software Foundation; either
|
|
Packit |
971217 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
971217 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
971217 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
971217 |
* Library General Public License for more details.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
971217 |
* License along with this library; if not, write to the
|
|
Packit |
971217 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
971217 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#include "audio-resampler-macros.h"
|
|
Packit |
971217 |
#include "audio-resampler-x86-sse.h"
|
|
Packit |
971217 |
#include "audio-resampler-x86-sse2.h"
|
|
Packit |
971217 |
#include "audio-resampler-x86-sse41.h"
|
|
Packit |
971217 |
|
|
Packit |
971217 |
static void
|
|
Packit |
971217 |
audio_resampler_check_x86 (const gchar *option)
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
if (!strcmp (option, "sse")) {
|
|
Packit |
971217 |
#if defined (HAVE_XMMINTRIN_H) && HAVE_SSE
|
|
Packit |
971217 |
GST_DEBUG ("enable SSE optimisations");
|
|
Packit |
971217 |
resample_gfloat_full_1 = resample_gfloat_full_1_sse;
|
|
Packit |
971217 |
resample_gfloat_linear_1 = resample_gfloat_linear_1_sse;
|
|
Packit |
971217 |
resample_gfloat_cubic_1 = resample_gfloat_cubic_1_sse;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
interpolate_gfloat_linear = interpolate_gfloat_linear_sse;
|
|
Packit |
971217 |
interpolate_gfloat_cubic = interpolate_gfloat_cubic_sse;
|
|
Packit |
971217 |
#else
|
|
Packit |
971217 |
GST_DEBUG ("SSE optimisations not enabled");
|
|
Packit |
971217 |
#endif
|
|
Packit |
971217 |
} else if (!strcmp (option, "sse2")) {
|
|
Packit |
971217 |
#if defined (HAVE_EMMINTRIN_H) && HAVE_SSE2
|
|
Packit |
971217 |
GST_DEBUG ("enable SSE2 optimisations");
|
|
Packit |
971217 |
resample_gint16_full_1 = resample_gint16_full_1_sse2;
|
|
Packit |
971217 |
resample_gint16_linear_1 = resample_gint16_linear_1_sse2;
|
|
Packit |
971217 |
resample_gint16_cubic_1 = resample_gint16_cubic_1_sse2;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
interpolate_gint16_linear = interpolate_gint16_linear_sse2;
|
|
Packit |
971217 |
interpolate_gint16_cubic = interpolate_gint16_cubic_sse2;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
resample_gdouble_full_1 = resample_gdouble_full_1_sse2;
|
|
Packit |
971217 |
resample_gdouble_linear_1 = resample_gdouble_linear_1_sse2;
|
|
Packit |
971217 |
resample_gdouble_cubic_1 = resample_gdouble_cubic_1_sse2;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
interpolate_gdouble_linear = interpolate_gdouble_linear_sse2;
|
|
Packit |
971217 |
interpolate_gdouble_cubic = interpolate_gdouble_cubic_sse2;
|
|
Packit |
971217 |
#else
|
|
Packit |
971217 |
GST_DEBUG ("SSE2 optimisations not enabled");
|
|
Packit |
971217 |
#endif
|
|
Packit |
971217 |
} else if (!strcmp (option, "sse41")) {
|
|
Packit |
971217 |
#if defined (__x86_64__) && \
|
|
Packit |
971217 |
defined (HAVE_SMMINTRIN_H) && defined (HAVE_EMMINTRIN_H) && \
|
|
Packit |
971217 |
HAVE_SSE41
|
|
Packit |
971217 |
GST_DEBUG ("enable SSE41 optimisations");
|
|
Packit |
971217 |
resample_gint32_full_1 = resample_gint32_full_1_sse41;
|
|
Packit |
971217 |
resample_gint32_linear_1 = resample_gint32_linear_1_sse41;
|
|
Packit |
971217 |
resample_gint32_cubic_1 = resample_gint32_cubic_1_sse41;
|
|
Packit |
971217 |
#else
|
|
Packit |
971217 |
GST_DEBUG ("SSE41 optimisations not enabled");
|
|
Packit |
971217 |
#endif
|
|
Packit |
971217 |
}
|
|
Packit |
971217 |
}
|