|
From: <sv...@op...> - 2025-11-07 09:38:01
|
Author: manx Date: Fri Nov 7 10:37:54 2025 New Revision: 24373 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=24373 Log: Merged revision(s) 18570, 21443, 21446, 21451 from trunk/OpenMPT: [Ref] minimp3: Silence warning. ........ [Var] minimp3: Update to fork <https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v2> commit 30b5aea9b6d000f197798ddd44476b641a4d0ba7 (2024-08-15). This applies the following pull requests: <https://github.com/lieff/minimp3/pull/126>, <https://github.com/lieff/minimp3/pull/96>, <https://github.com/lieff/minimp3/pull/97>. ........ [Var] minimp3: Update to fork <https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v3> commit 2811a29e4115199209fe91ae5217c9c5fc611fa6 (2024-08-15). This applies the following pull requests: <https://github.com/lieff/minimp3/pull/125>. ........ [Var] minimp3: Update to fork <https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v4> commit 2811a29e4115199209fe91ae5217c9c5fc611fa6 (2024-08-15). This applies the following pull requests: <https://github.com/lieff/minimp3/pull/127>. ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/include/minimp3/OpenMPT.txt branches/OpenMPT-1.29/include/minimp3/minimp3.h Modified: branches/OpenMPT-1.29/include/minimp3/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.29/include/minimp3/OpenMPT.txt Fri Nov 7 10:36:12 2025 (r24372) +++ branches/OpenMPT-1.29/include/minimp3/OpenMPT.txt Fri Nov 7 10:37:54 2025 (r24373) @@ -1,4 +1,12 @@ 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-v4 +commit 2116754771b79347ad2f39127abace2a093c383e (2024-08-15) The following changes have been made: * minimp3.c has been added + * 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 + * https://github.com/lieff/minimp3/pull/125 + * https://github.com/lieff/minimp3/pull/127 + * all modifications are marked by /* OpenMPT */ Modified: branches/OpenMPT-1.29/include/minimp3/minimp3.h ============================================================================== --- branches/OpenMPT-1.29/include/minimp3/minimp3.h Fri Nov 7 10:36:12 2025 (r24372) +++ branches/OpenMPT-1.29/include/minimp3/minimp3.h Fri Nov 7 10:37:54 2025 (r24373) @@ -8,6 +8,10 @@ */ #include <stdint.h> +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + #define MINIMP3_MAX_SAMPLES_PER_FRAME (1152*2) typedef struct @@ -22,10 +26,6 @@ unsigned char header[4], reserv_buf[511]; } mp3dec_t; -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - void mp3dec_init(mp3dec_t *dec); #ifndef MINIMP3_FLOAT_OUTPUT typedef int16_t mp3d_sample_t; @@ -176,7 +176,7 @@ #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; -static int have_simd() +static int have_simd(void) { /* TODO: detect neon for !MINIMP3_ONLY_SIMD */ return 1; } @@ -191,7 +191,7 @@ #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) { @@ -941,7 +941,8 @@ 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++) { @@ -949,7 +950,7 @@ 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]; @@ -1654,6 +1655,21 @@ } } +static int hdr_is_tag(const uint8_t* hdr) +{ + return hdr[0] == 'T' && hdr[1] == 'A' && hdr[2] == 'G' && hdr[3] == '\0'; +} + +static int hdr_is_null(const uint8_t* hdr) +{ + return hdr[0] == '\0' && hdr[1] == '\0' && hdr[2] == '\0' && hdr[3] == '\0'; +} + +static int hdr_is_null_or_tag(const uint8_t* hdr) +{ + return hdr_is_tag(hdr) > 0 || hdr_is_null(hdr) > 0; +} + static int mp3d_match_frame(const uint8_t *hdr, int mp3_bytes, int frame_bytes) { int i, nmatch; @@ -1662,6 +1678,8 @@ i += hdr_frame_bytes(hdr + i, frame_bytes) + hdr_padding(hdr + i); if (i + HDR_SIZE > mp3_bytes) return nmatch > 0; + if (hdr_is_null_or_tag(hdr + i)) + return nmatch > 0; if (!hdr_compare(hdr, hdr + i)) return 0; } @@ -1769,7 +1787,7 @@ { 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]); } @@ -1783,7 +1801,7 @@ 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))) @@ -1791,7 +1809,7 @@ 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) |