RetroArch/audio/utils.h

73 lines
2.3 KiB
C
Raw Normal View History

2012-04-21 21:13:50 +00:00
/* RetroArch - A frontend for libretro.
2013-01-01 00:37:37 +00:00
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
2012-04-07 11:26:27 +00:00
*
2012-04-21 21:13:50 +00:00
* RetroArch is free software: you can redistribute it and/or modify it under the terms
2012-04-07 11:26:27 +00: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 21:13:50 +00:00
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
2012-04-07 11:26:27 +00: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 21:31:57 +00:00
* You should have received a copy of the GNU General Public License along with RetroArch.
2012-04-07 11:26:27 +00:00
* If not, see <http://www.gnu.org/licenses/>.
*/
2011-10-15 15:47:29 +00:00
#ifndef AUDIO_UTILS_H
#define AUDIO_UTILS_H
#include <stdint.h>
2011-12-02 00:34:02 +00:00
#include <stddef.h>
2011-10-15 15:47:29 +00:00
2012-12-09 15:28:49 +00:00
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
2012-12-05 22:17:07 +00:00
#if defined(__SSE2__)
2011-10-15 16:09:44 +00: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 00:56:33 +00:00
2011-12-02 00:34:02 +00:00
void audio_convert_s16_to_float_SSE2(float *out,
const int16_t *in, size_t samples, float gain);
2011-10-23 00:56:33 +00:00
2011-12-02 00:34:02 +00:00
void audio_convert_float_to_s16_SSE2(int16_t *out,
const float *in, size_t samples);
2011-10-15 16:09:44 +00:00
2012-12-05 22:17:07 +00:00
#elif defined(__ALTIVEC__)
2011-12-02 00:34:02 +00: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 16:09:44 +00:00
2011-12-02 00:34:02 +00:00
void audio_convert_s16_to_float_altivec(float *out,
const int16_t *in, size_t samples, float gain);
2011-10-15 16:09:44 +00:00
2011-12-02 00:34:02 +00:00
void audio_convert_float_to_s16_altivec(int16_t *out,
const float *in, size_t samples);
2011-10-15 16:09:44 +00:00
2012-12-05 21:45:29 +00:00
#elif defined(HAVE_NEON)
#define audio_convert_s16_to_float audio_convert_s16_to_float_neon
#define audio_convert_float_to_s16 audio_convert_float_to_s16_neon
void audio_convert_s16_to_float_neon(float *out,
const int16_t *in, size_t samples, float gain);
void audio_convert_float_to_s16_neon(int16_t *out,
const float *in, size_t samples);
2011-12-02 00:34:02 +00: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 16:09:44 +00:00
#endif
2011-12-02 00:34:02 +00:00
void audio_convert_s16_to_float_C(float *out,
const int16_t *in, size_t samples, float gain);
2011-12-02 00:34:02 +00:00
void audio_convert_float_to_s16_C(int16_t *out,
const float *in, size_t samples);
#ifdef HAVE_RSOUND
bool rarch_rsound_start(const char *ip);
void rarch_rsound_stop(void);
#endif
2011-10-15 15:47:29 +00:00
#endif