Unified · Split
| @@ -68,6 +68,7 @@ First, we need to initialize the decoder structure: · 67 unmodified lines | |||
| 68 | 68 | ||
| 69 | ``` | 69 | ``` |
| 70 | //#define MINIMP3_ONLY_MP3 | 70 | //#define MINIMP3_ONLY_MP3 |
| 71 | //#define MINIMP3_ONLY_SIMD | ||
| 71 | #define MINIMP3_IMPLEMENTATION | 72 | #define MINIMP3_IMPLEMENTATION |
| 72 | #include "minimp3.h" | 73 | #include "minimp3.h" |
| 73 | ... | 74 | ... |
| @@ -80,7 +80,7 @@ int mp3dec_decode_frame(mp3dec_t *dec, const unsigned char *mp3, int mp3_bytes, · 79 unmodified lines | |||
| 80 | #define MINIMP3_MIN(a, b) ((a) > (b) ? (b) : (a)) | 80 | #define MINIMP3_MIN(a, b) ((a) > (b) ? (b) : (a)) |
| 81 | #define MINIMP3_MAX(a, b) ((a) < (b) ? (b) : (a)) | 81 | #define MINIMP3_MAX(a, b) ((a) < (b) ? (b) : (a)) |
| 82 | 82 | ||
| 83 | #if defined(_M_X64) || defined(_M_ARM64) || (defined(__x86_64__) && defined(__SSE2__)) || defined(__aarch64__) | 83 | #if !defined(MINIMP3_ONLY_SIMD) && (defined(_M_X64) || defined(_M_ARM64) || (defined(__x86_64__) && defined(__SSE2__)) || defined(__aarch64__)) |
| 84 | // x64 always have SSE2, arm64 always have neon, no need for generic code | 84 | // x64 always have SSE2, arm64 always have neon, no need for generic code |
| 85 | #define MINIMP3_ONLY_SIMD | 85 | #define MINIMP3_ONLY_SIMD |
| 86 | #endif | 86 | #endif |
| @@ -6,7 +6,7 @@ pushd $CUR_DIR/.. · 5 unmodified lines | |||
| 6 | 6 | ||
| 7 | set -e | 7 | set -e |
| 8 | 8 | ||
| 9 | gcc -coverage -O0 -DMINIMP3_TEST -DMINIMP3_NO_WAV -o minimp3 minimp3_test.c -lm | 9 | gcc -coverage -O0 -m32 -msse2 -DMINIMP3_TEST -DMINIMP3_NO_WAV -o minimp3 minimp3_test.c -lm |
| 10 | scripts/test.sh | 10 | scripts/test.sh |
| 11 | gcov minimp3_test.c | 11 | gcov minimp3_test.c |
| 12 | 12 | ||