Skip to content

Commit

Permalink
[Var] minimp3: Update to fork <https://github.com/manxorist/minimp3/r…
Browse files Browse the repository at this point in the history
…eleases/tag/openmpt-2024-08-15-v2> commit 30b5aea9b6d000f197798ddd44476b641a4d0ba7 (2024-08-15). This applies the following pull requests: <lieff/minimp3#126>, <lieff/minimp3#96>, <lieff/minimp3#97>.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@21443 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Aug 15, 2024
1 parent 42366bc commit b712fe8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
8 changes: 6 additions & 2 deletions include/minimp3/OpenMPT.txt
Original file line number Diff line number Diff line change
@@ -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 */
17 changes: 7 additions & 10 deletions include/minimp3/minimp3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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)
{
Expand Down Expand Up @@ -945,15 +941,16 @@ 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++)
{
unsigned ipos = ist_pos[i];
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];
Expand Down Expand Up @@ -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]);
}
Expand All @@ -1787,15 +1784,15 @@ 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)))
{
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)
Expand Down

0 comments on commit b712fe8

Please sign in to comment.