mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Compile with HAVE_BUILTIN_FILTERS for Android - and some C90 build
fixes for filters. Note/FIXME: We need to get rid of the complex.h dependency in the equalizer plugin
This commit is contained in:
parent
3b6f408a41
commit
cb53d65fc3
@ -53,7 +53,7 @@ else
|
|||||||
GLES_LIB := -lGLESv2
|
GLES_LIB := -lGLESv2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_SCREENSHOTS -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -I../../../deps/miniz -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_CAMERA -DRARCH_INTERNAL -DHAVE_LOCATION -DHAVE_CC_RESAMPLER
|
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_SCREENSHOTS -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -I../../../deps/miniz -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_CAMERA -DRARCH_INTERNAL -DHAVE_LOCATION -DHAVE_CC_RESAMPLER -DHAVE_FILTERS_BUILTIN
|
||||||
|
|
||||||
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL $(GLES_LIB) $(LOGGER_LDLIBS) -ldl
|
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL $(GLES_LIB) $(LOGGER_LDLIBS) -ldl
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "rarch_dsp.h"
|
#include "rarch_dsp.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <complex.h>
|
#include <complex.h> //FIXME: This is a dependency missing pretty much everywhere except Linux
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -257,6 +257,7 @@ static void iir_init(void *data, int samplerate, int filter_type)
|
|||||||
#ifdef __SSE2__
|
#ifdef __SSE2__
|
||||||
static void iir_process_batch(void *data, float *out, const float *in, unsigned frames)
|
static void iir_process_batch(void *data, float *out, const float *in, unsigned frames)
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
struct iir_filter *iir = (struct iir_filter*)data;
|
struct iir_filter *iir = (struct iir_filter*)data;
|
||||||
|
|
||||||
__m128 fir_coeff[2] = { iir->fir_coeff[0], iir->fir_coeff[1] };
|
__m128 fir_coeff[2] = { iir->fir_coeff[0], iir->fir_coeff[1] };
|
||||||
@ -264,7 +265,7 @@ static void iir_process_batch(void *data, float *out, const float *in, unsigned
|
|||||||
__m128 fir_buf[2] = { iir->fir_buf[0], iir->fir_buf[1] };
|
__m128 fir_buf[2] = { iir->fir_buf[0], iir->fir_buf[1] };
|
||||||
__m128 iir_buf = iir->iir_buf;
|
__m128 iir_buf = iir->iir_buf;
|
||||||
|
|
||||||
for (unsigned i = 0; (i + 4) <= (2 * frames); in += 4, i += 4, out += 4)
|
for (i = 0; (i + 4) <= (2 * frames); in += 4, i += 4, out += 4)
|
||||||
{
|
{
|
||||||
__m128 input = _mm_loadu_ps(in);
|
__m128 input = _mm_loadu_ps(in);
|
||||||
|
|
||||||
@ -341,12 +342,13 @@ static void * iir_dsp_init(const rarch_dsp_info_t *info)
|
|||||||
static void iir_dsp_process(void *data, rarch_dsp_output_t *output,
|
static void iir_dsp_process(void *data, rarch_dsp_output_t *output,
|
||||||
const rarch_dsp_input_t *input)
|
const rarch_dsp_input_t *input)
|
||||||
{
|
{
|
||||||
|
int i, num_samples;
|
||||||
struct iir_filter_data *iir = (struct iir_filter_data*)data;
|
struct iir_filter_data *iir = (struct iir_filter_data*)data;
|
||||||
|
|
||||||
output->samples = iir->buf;
|
output->samples = iir->buf;
|
||||||
|
|
||||||
int num_samples = input->frames * 2;
|
num_samples = input->frames * 2;
|
||||||
for (int i = 0; i<num_samples;)
|
for (i = 0; i<num_samples;)
|
||||||
{
|
{
|
||||||
iir->buf[i] = iir_process(&iir->iir_l, input->samples[i]);
|
iir->buf[i] = iir_process(&iir->iir_l, input->samples[i]);
|
||||||
i++;
|
i++;
|
||||||
|
2
driver.c
2
driver.c
@ -973,7 +973,9 @@ static const struct dspfilter_implementation *(*dspfilter_drivers[]) (dspfilter_
|
|||||||
NULL,
|
NULL,
|
||||||
&echo_dsp_plugin_init,
|
&echo_dsp_plugin_init,
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#ifndef ANDROID
|
||||||
&eq_dsp_plugin_init,
|
&eq_dsp_plugin_init,
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
&iir_dsp_plugin_init,
|
&iir_dsp_plugin_init,
|
||||||
&phaser_dsp_plugin_init,
|
&phaser_dsp_plugin_init,
|
||||||
|
@ -80,29 +80,33 @@ static void lq2x_generic_rgb565(unsigned width, unsigned height,
|
|||||||
int first, int last, uint16_t *src,
|
int first, int last, uint16_t *src,
|
||||||
unsigned src_stride, uint16_t *dst, unsigned dst_stride)
|
unsigned src_stride, uint16_t *dst, unsigned dst_stride)
|
||||||
{
|
{
|
||||||
uint16_t *out0 = (uint16_t*)dst;
|
unsigned x, y;
|
||||||
uint16_t *out1 = (uint16_t*)(dst + dst_stride);
|
uint16_t *out0, *out1;
|
||||||
|
out0 = (uint16_t*)dst;
|
||||||
|
out1 = (uint16_t*)(dst + dst_stride);
|
||||||
|
|
||||||
for(unsigned y = 0; y < height; y++)
|
for(y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
int prevline = (y == 0 ? 0 : src_stride);
|
int prevline, nextline;
|
||||||
int nextline = (y == height - 1 || last) ? 0 : src_stride;
|
prevline = (y == 0 ? 0 : src_stride);
|
||||||
|
nextline = (y == height - 1 || last) ? 0 : src_stride;
|
||||||
|
|
||||||
for(unsigned x = 0; x < width; x++)
|
for(x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
uint16_t A = *(src - prevline);
|
uint16_t A, B, C, D, E, c;
|
||||||
uint16_t B = (x > 0) ? *(src - 1) : *src;
|
A = *(src - prevline);
|
||||||
uint16_t C = *src;
|
B = (x > 0) ? *(src - 1) : *src;
|
||||||
uint16_t D = (x < width - 1) ? *(src + 1) : *src;
|
C = *src;
|
||||||
uint16_t E = *(src++ + nextline);
|
D = (x < width - 1) ? *(src + 1) : *src;
|
||||||
uint16_t c = C;
|
E = *(src++ + nextline);
|
||||||
|
c = C;
|
||||||
|
|
||||||
if(A != E && B != D)
|
if(A != E && B != D)
|
||||||
{
|
{
|
||||||
*out0++ = (A == B ? C + A - ((C ^ A) & 0x0821) >> 1 : c);
|
*out0++ = (A == B ? ((C + A - ((C ^ A) & 0x0821)) >> 1) : c);
|
||||||
*out0++ = (A == D ? C + A - ((C ^ A) & 0x0821) >> 1 : c);
|
*out0++ = (A == D ? ((C + A - ((C ^ A) & 0x0821)) >> 1) : c);
|
||||||
*out1++ = (E == B ? C + E - ((C ^ E) & 0x0821) >> 1 : c);
|
*out1++ = (E == B ? ((C + E - ((C ^ E) & 0x0821)) >> 1) : c);
|
||||||
*out1++ = (E == D ? C + E - ((C ^ E) & 0x0821) >> 1 : c);
|
*out1++ = (E == D ? ((C + E - ((C ^ E) & 0x0821)) >> 1) : c);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -123,15 +127,17 @@ static void lq2x_generic_xrgb8888(unsigned width, unsigned height,
|
|||||||
int first, int last, uint32_t *src,
|
int first, int last, uint32_t *src,
|
||||||
unsigned src_stride, uint32_t *dst, unsigned dst_stride)
|
unsigned src_stride, uint32_t *dst, unsigned dst_stride)
|
||||||
{
|
{
|
||||||
uint32_t *out0 = (uint32_t*)dst;
|
unsigned x, y;
|
||||||
uint32_t *out1 = (uint32_t*)(dst + dst_stride);
|
uint32_t *out0, *out1;
|
||||||
|
out0 = (uint32_t*)dst;
|
||||||
|
out1 = (uint32_t*)(dst + dst_stride);
|
||||||
|
|
||||||
for(unsigned y = 0; y < height; y++)
|
for(y = 0; y < height; y++)
|
||||||
{
|
{
|
||||||
int prevline = (y == 0 ? 0 : src_stride);
|
int prevline = (y == 0 ? 0 : src_stride);
|
||||||
int nextline = (y == height - 1 || last) ? 0 : src_stride;
|
int nextline = (y == height - 1 || last) ? 0 : src_stride;
|
||||||
|
|
||||||
for(unsigned x = 0; x < width; x++)
|
for(x = 0; x < width; x++)
|
||||||
{
|
{
|
||||||
uint32_t A = *(src - prevline);
|
uint32_t A = *(src - prevline);
|
||||||
uint32_t B = (x > 0) ? *(src - 1) : *src;
|
uint32_t B = (x > 0) ? *(src - 1) : *src;
|
||||||
@ -142,10 +148,10 @@ static void lq2x_generic_xrgb8888(unsigned width, unsigned height,
|
|||||||
|
|
||||||
if(A != E && B != D)
|
if(A != E && B != D)
|
||||||
{
|
{
|
||||||
*out0++ = (A == B ? C + A - ((C ^ A) & 0x0421) >> 1 : c);
|
*out0++ = (A == B ? (C + A - ((C ^ A) & 0x0421)) >> 1 : c);
|
||||||
*out0++ = (A == D ? C + A - ((C ^ A) & 0x0421) >> 1 : c);
|
*out0++ = (A == D ? (C + A - ((C ^ A) & 0x0421)) >> 1 : c);
|
||||||
*out1++ = (E == B ? C + E - ((C ^ E) & 0x0421) >> 1 : c);
|
*out1++ = (E == B ? (C + E - ((C ^ E) & 0x0421)) >> 1 : c);
|
||||||
*out1++ = (E == D ? C + E - ((C ^ E) & 0x0421) >> 1 : c);
|
*out1++ = (E == D ? (C + E - ((C ^ E) & 0x0421)) >> 1 : c);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -484,9 +484,11 @@ FILTERS
|
|||||||
#include "../gfx/filters/phosphor2x.c"
|
#include "../gfx/filters/phosphor2x.c"
|
||||||
|
|
||||||
#include "../audio/filters/echo.c"
|
#include "../audio/filters/echo.c"
|
||||||
|
#ifndef ANDROID
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include "../audio/filters/eq.c"
|
#include "../audio/filters/eq.c"
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#include "../audio/filters/iir.c"
|
#include "../audio/filters/iir.c"
|
||||||
#include "../audio/filters/phaser.c"
|
#include "../audio/filters/phaser.c"
|
||||||
#include "../audio/filters/reverb.c"
|
#include "../audio/filters/reverb.c"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user