2012-04-21 23:13:50 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2012-04-07 13:26:27 +02:00
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2012-04-07 13:26:27 +02:00
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2012-04-07 13:26:27 +02:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 23:31:57 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2012-04-07 13:26:27 +02:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2011-10-15 17:47:29 +02:00
|
|
|
#ifndef AUDIO_UTILS_H
|
|
|
|
#define AUDIO_UTILS_H
|
|
|
|
|
2014-05-28 21:45:58 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2011-10-15 17:47:29 +02:00
|
|
|
#include <stdint.h>
|
2011-12-02 01:34:02 +01:00
|
|
|
#include <stddef.h>
|
2011-10-15 17:47:29 +02:00
|
|
|
|
2012-12-09 17:28:49 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../config.h"
|
|
|
|
#endif
|
|
|
|
|
2012-12-05 23:17:07 +01:00
|
|
|
#if defined(__SSE2__)
|
2011-10-15 18:09:44 +02:00
|
|
|
#define audio_convert_s16_to_float audio_convert_s16_to_float_SSE2
|
|
|
|
#define audio_convert_float_to_s16 audio_convert_float_to_s16_SSE2
|
2011-10-23 02:56:33 +02:00
|
|
|
|
2011-12-02 01:34:02 +01:00
|
|
|
void audio_convert_s16_to_float_SSE2(float *out,
|
2012-11-03 14:15:03 +01:00
|
|
|
const int16_t *in, size_t samples, float gain);
|
2011-10-23 02:56:33 +02:00
|
|
|
|
2011-12-02 01:34:02 +01:00
|
|
|
void audio_convert_float_to_s16_SSE2(int16_t *out,
|
|
|
|
const float *in, size_t samples);
|
2011-10-15 18:09:44 +02:00
|
|
|
|
2012-12-05 23:17:07 +01:00
|
|
|
#elif defined(__ALTIVEC__)
|
2011-12-02 01:34:02 +01:00
|
|
|
#define audio_convert_s16_to_float audio_convert_s16_to_float_altivec
|
|
|
|
#define audio_convert_float_to_s16 audio_convert_float_to_s16_altivec
|
2011-10-15 18:09:44 +02:00
|
|
|
|
2011-12-02 01:34:02 +01:00
|
|
|
void audio_convert_s16_to_float_altivec(float *out,
|
2012-11-03 14:15:03 +01:00
|
|
|
const int16_t *in, size_t samples, float gain);
|
2011-10-15 18:09:44 +02:00
|
|
|
|
2011-12-02 01:34:02 +01:00
|
|
|
void audio_convert_float_to_s16_altivec(int16_t *out,
|
|
|
|
const float *in, size_t samples);
|
2011-10-15 18:09:44 +02:00
|
|
|
|
2014-07-26 20:18:37 +02:00
|
|
|
#elif defined(__ARM_NEON__)
|
2013-01-24 18:37:42 +01:00
|
|
|
#define audio_convert_s16_to_float audio_convert_s16_to_float_arm
|
|
|
|
#define audio_convert_float_to_s16 audio_convert_float_to_s16_arm
|
2012-12-05 22:45:29 +01:00
|
|
|
|
2013-01-24 18:37:42 +01:00
|
|
|
void (*audio_convert_s16_to_float_arm)(float *out,
|
2012-12-05 22:45:29 +01:00
|
|
|
const int16_t *in, size_t samples, float gain);
|
2013-01-24 18:37:42 +01:00
|
|
|
void (*audio_convert_float_to_s16_arm)(int16_t *out,
|
2012-12-05 22:45:29 +01:00
|
|
|
const float *in, size_t samples);
|
2014-03-14 15:12:47 +01:00
|
|
|
#elif defined(_MIPS_ARCH_ALLEGREX)
|
|
|
|
#define audio_convert_s16_to_float audio_convert_s16_to_float_ALLEGREX
|
|
|
|
#define audio_convert_float_to_s16 audio_convert_float_to_s16_ALLEGREX
|
2012-12-05 22:45:29 +01:00
|
|
|
|
2014-03-14 15:12:47 +01:00
|
|
|
void audio_convert_s16_to_float_ALLEGREX(float *out,
|
|
|
|
const int16_t *in, size_t samples, float gain);
|
|
|
|
void audio_convert_float_to_s16_ALLEGREX(int16_t *out,
|
|
|
|
const float *in, size_t samples);
|
2011-12-02 01:34:02 +01:00
|
|
|
#else
|
|
|
|
#define audio_convert_s16_to_float audio_convert_s16_to_float_C
|
|
|
|
#define audio_convert_float_to_s16 audio_convert_float_to_s16_C
|
2011-10-15 18:09:44 +02:00
|
|
|
#endif
|
|
|
|
|
2011-12-02 01:34:02 +01:00
|
|
|
void audio_convert_s16_to_float_C(float *out,
|
2012-11-03 14:15:03 +01:00
|
|
|
const int16_t *in, size_t samples, float gain);
|
2011-12-02 01:34:02 +01:00
|
|
|
void audio_convert_float_to_s16_C(int16_t *out,
|
|
|
|
const float *in, size_t samples);
|
|
|
|
|
2013-01-24 18:37:42 +01:00
|
|
|
void audio_convert_init_simd(void);
|
|
|
|
|
2014-05-28 21:45:58 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2011-10-15 17:47:29 +02:00
|
|
|
#endif
|
|
|
|
|
2014-07-26 20:18:37 +02:00
|
|
|
#endif
|