diff --git a/include/minimp3/OpenMPT.txt b/include/minimp3/OpenMPT.txt index ff728e8762f..24d84c20a33 100644 --- a/include/minimp3/OpenMPT.txt +++ b/include/minimp3/OpenMPT.txt @@ -1,6 +1,10 @@ minimp3 library from https://github.com/lieff/minimp3 -commit 50d2aaf360a53653b718fead8e258d654c3a7e41 (2021-11-27) +Fork https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v2 +commit 30b5aea9b6d000f197798ddd44476b641a4d0ba7 (2024-08-15) The following changes have been made: * minimp3.c has been added - * some warnings have been fixed + * The following pull rquests have been merged: + * https://github.com/lieff/minimp3/pull/126 + * https://github.com/lieff/minimp3/pull/96 + * https://github.com/lieff/minimp3/pull/97 * all modifications are marked by /* OpenMPT */ diff --git a/include/minimp3/minimp3.h b/include/minimp3/minimp3.h index 0ed72088f76..a9c93ac7923 100644 --- a/include/minimp3/minimp3.h +++ b/include/minimp3/minimp3.h @@ -176,11 +176,7 @@ static int have_simd(void) #define VMUL_S(x, s) vmulq_f32(x, vmovq_n_f32(s)) #define VREV(x) vcombine_f32(vget_high_f32(vrev64q_f32(x)), vget_low_f32(vrev64q_f32(x))) typedef float32x4_t f4; -#if 1 /* OpenMPT */ static int have_simd(void) -#else /* OpenMPT */ -static int have_simd() -#endif /* OpenMPT */ { /* TODO: detect neon for !MINIMP3_ONLY_SIMD */ return 1; } @@ -195,7 +191,7 @@ static int have_simd() #define HAVE_SIMD 0 #endif /* !defined(MINIMP3_NO_SIMD) */ -#if defined(__ARM_ARCH) && (__ARM_ARCH >= 6) && !defined(__aarch64__) && !defined(_M_ARM64) +#if defined(__ARM_ARCH) && (__ARM_ARCH >= 6) && !defined(__aarch64__) && !defined(_M_ARM64) && !defined(__ARM_ARCH_6M__) #define HAVE_ARMV6 1 static __inline__ __attribute__((always_inline)) int32_t minimp3_clip_int16_arm(int32_t a) { @@ -945,7 +941,8 @@ static void L3_stereo_top_band(const float *right, const uint8_t *sfb, int nband static void L3_stereo_process(float *left, const uint8_t *ist_pos, const uint8_t *sfb, const uint8_t *hdr, int max_band[3], int mpeg2_sh) { static const float g_pan[7*2] = { 0,1,0.21132487f,0.78867513f,0.36602540f,0.63397460f,0.5f,0.5f,0.63397460f,0.36602540f,0.78867513f,0.21132487f,1,0 }; - unsigned i, max_pos = HDR_TEST_MPEG1(hdr) ? 7 : 64; + const uint8_t mpeg1 = HDR_TEST_MPEG1(hdr); + unsigned i, max_pos = mpeg1 ? 7 : 64; for (i = 0; sfb[i]; i++) { @@ -953,7 +950,7 @@ static void L3_stereo_process(float *left, const uint8_t *ist_pos, const uint8_t if ((int)i > max_band[i % 3] && ipos < max_pos) { float kl, kr, s = HDR_TEST_MS_STEREO(hdr) ? 1.41421356f : 1; - if (HDR_TEST_MPEG1(hdr)) + if (mpeg1) { kl = g_pan[2*ipos]; kr = g_pan[2*ipos + 1]; @@ -1773,7 +1770,7 @@ int mp3dec_decode_frame(mp3dec_t *dec, const uint8_t *mp3, int mp3_bytes, mp3d_s { for (igr = 0; igr < (HDR_TEST_MPEG1(hdr) ? 2 : 1); igr++, pcm += 576*info->channels) { - memset(scratch.grbuf[0], 0, 576*2*sizeof(float)); + memset(scratch.grbuf, 0, sizeof(scratch.grbuf)); L3_decode(dec, &scratch, scratch.gr_info + igr*info->channels, info->channels); mp3d_synth_granule(dec->qmf_state, scratch.grbuf[0], 18, info->channels, pcm, scratch.syn[0]); } @@ -1787,7 +1784,7 @@ int mp3dec_decode_frame(mp3dec_t *dec, const uint8_t *mp3, int mp3_bytes, mp3d_s L12_scale_info sci[1]; L12_read_scale_info(hdr, bs_frame, sci); - memset(scratch.grbuf[0], 0, 576*2*sizeof(float)); + memset(scratch.grbuf, 0, sizeof(scratch.grbuf)); for (i = 0, igr = 0; igr < 3; igr++) { if (12 == (i += L12_dequantize_granule(scratch.grbuf[0] + i, bs_frame, sci, info->layer | 1))) @@ -1795,7 +1792,7 @@ int mp3dec_decode_frame(mp3dec_t *dec, const uint8_t *mp3, int mp3_bytes, mp3d_s i = 0; L12_apply_scf_384(sci, sci->scf + igr, scratch.grbuf[0]); mp3d_synth_granule(dec->qmf_state, scratch.grbuf[0], 12, info->channels, pcm, scratch.syn[0]); - memset(scratch.grbuf[0], 0, 576*2*sizeof(float)); + memset(scratch.grbuf, 0, sizeof(scratch.grbuf)); pcm += 384*info->channels; } if (bs_frame->pos > bs_frame->limit)