diff --git a/android/native/jni/Android.mk b/android/native/jni/Android.mk index 5f9e1772a4..83404db7be 100644 --- a/android/native/jni/Android.mk +++ b/android/native/jni/Android.mk @@ -53,7 +53,7 @@ else GLES_LIB := -lGLESv2 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 diff --git a/audio/filters/eq.c b/audio/filters/eq.c index bfea679658..c76160c73a 100644 --- a/audio/filters/eq.c +++ b/audio/filters/eq.c @@ -18,7 +18,7 @@ #include "rarch_dsp.h" #include #include -#include +#include //FIXME: This is a dependency missing pretty much everywhere except Linux #include #include #include diff --git a/audio/filters/iir.c b/audio/filters/iir.c index cfcfef2df6..24c0c74973 100644 --- a/audio/filters/iir.c +++ b/audio/filters/iir.c @@ -257,6 +257,7 @@ static void iir_init(void *data, int samplerate, int filter_type) #ifdef __SSE2__ static void iir_process_batch(void *data, float *out, const float *in, unsigned frames) { + unsigned i; struct iir_filter *iir = (struct iir_filter*)data; __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 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); @@ -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, const rarch_dsp_input_t *input) { + int i, num_samples; struct iir_filter_data *iir = (struct iir_filter_data*)data; output->samples = iir->buf; - int num_samples = input->frames * 2; - for (int i = 0; iframes * 2; + for (i = 0; ibuf[i] = iir_process(&iir->iir_l, input->samples[i]); i++; diff --git a/driver.c b/driver.c index 3bb08cb685..a62e622edb 100644 --- a/driver.c +++ b/driver.c @@ -973,7 +973,9 @@ static const struct dspfilter_implementation *(*dspfilter_drivers[]) (dspfilter_ NULL, &echo_dsp_plugin_init, #ifndef _WIN32 +#ifndef ANDROID &eq_dsp_plugin_init, +#endif #endif &iir_dsp_plugin_init, &phaser_dsp_plugin_init, diff --git a/gfx/filters/lq2x.c b/gfx/filters/lq2x.c index 4367a65bf1..ded745e0d9 100644 --- a/gfx/filters/lq2x.c +++ b/gfx/filters/lq2x.c @@ -80,29 +80,33 @@ static void lq2x_generic_rgb565(unsigned width, unsigned height, int first, int last, uint16_t *src, unsigned src_stride, uint16_t *dst, unsigned dst_stride) { - uint16_t *out0 = (uint16_t*)dst; - uint16_t *out1 = (uint16_t*)(dst + dst_stride); + unsigned x, y; + 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 nextline = (y == height - 1 || last) ? 0 : src_stride; + int prevline, nextline; + 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 B = (x > 0) ? *(src - 1) : *src; - uint16_t C = *src; - uint16_t D = (x < width - 1) ? *(src + 1) : *src; - uint16_t E = *(src++ + nextline); - uint16_t c = C; + uint16_t A, B, C, D, E, c; + A = *(src - prevline); + B = (x > 0) ? *(src - 1) : *src; + C = *src; + D = (x < width - 1) ? *(src + 1) : *src; + E = *(src++ + nextline); + c = C; if(A != E && B != D) { - *out0++ = (A == B ? 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 == D ? C + E - ((C ^ E) & 0x0821) >> 1 : c); + *out0++ = (A == B ? ((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 == D ? ((C + E - ((C ^ E) & 0x0821)) >> 1) : c); } else { @@ -123,15 +127,17 @@ static void lq2x_generic_xrgb8888(unsigned width, unsigned height, int first, int last, uint32_t *src, unsigned src_stride, uint32_t *dst, unsigned dst_stride) { - uint32_t *out0 = (uint32_t*)dst; - uint32_t *out1 = (uint32_t*)(dst + dst_stride); + unsigned x, y; + 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 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 B = (x > 0) ? *(src - 1) : *src; @@ -142,10 +148,10 @@ static void lq2x_generic_xrgb8888(unsigned width, unsigned height, if(A != E && B != D) { - *out0++ = (A == B ? 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 == D ? C + E - ((C ^ E) & 0x0421) >> 1 : c); + *out0++ = (A == B ? (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 == D ? (C + E - ((C ^ E) & 0x0421)) >> 1 : c); } else { diff --git a/griffin/griffin.c b/griffin/griffin.c index a8a2834aab..f283ae34fa 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -484,9 +484,11 @@ FILTERS #include "../gfx/filters/phosphor2x.c" #include "../audio/filters/echo.c" +#ifndef ANDROID #ifndef _WIN32 #include "../audio/filters/eq.c" #endif +#endif #include "../audio/filters/iir.c" #include "../audio/filters/phaser.c" #include "../audio/filters/reverb.c"