From 69b591c03d5cfc884925a0a916ba95e2d25441eb Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 8 Aug 2021 23:51:56 +0300
Subject: [PATCH] dr_mp3.h: minor updates from mainstream.
---
src/dr_mp3.h | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/dr_mp3.h b/src/dr_mp3.h
index 6d5bb5e..2cb5a71 100644
--- a/src/dr_mp3.h
+++ b/src/dr_mp3.h
@@ -1,6 +1,6 @@
/*
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
-dr_mp3 - v0.6.28 - 2021-07-31
+dr_mp3 - v0.6.29 - 2021-08-08
David Reid - mackron@gmail.com
@@ -101,7 +101,7 @@ extern "C" {
#define DRMP3_VERSION_MAJOR 0
#define DRMP3_VERSION_MINOR 6
-#define DRMP3_VERSION_REVISION 28
+#define DRMP3_VERSION_REVISION 29
#define DRMP3_VERSION_STRING DRMP3_XSTRINGIFY(DRMP3_VERSION_MAJOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_MINOR) "." DRMP3_XSTRINGIFY(DRMP3_VERSION_REVISION)
#include <stddef.h> /* For size_t. */
@@ -1407,12 +1407,22 @@ static void drmp3_L3_midside_stereo(float *left, int n)
int i = 0;
float *right = left + 576;
#if DRMP3_HAVE_SIMD
- if (drmp3_have_simd()) for (; i < n - 3; i += 4)
+ if (drmp3_have_simd())
{
- drmp3_f4 vl = DRMP3_VLD(left + i);
- drmp3_f4 vr = DRMP3_VLD(right + i);
- DRMP3_VSTORE(left + i, DRMP3_VADD(vl, vr));
- DRMP3_VSTORE(right + i, DRMP3_VSUB(vl, vr));
+ for (; i < n - 3; i += 4)
+ {
+ drmp3_f4 vl = DRMP3_VLD(left + i);
+ drmp3_f4 vr = DRMP3_VLD(right + i);
+ DRMP3_VSTORE(left + i, DRMP3_VADD(vl, vr));
+ DRMP3_VSTORE(right + i, DRMP3_VSUB(vl, vr));
+ }
+#ifdef __GNUC__
+ /* Workaround for spurious -Waggressive-loop-optimizations warning from gcc.
+ * For more info see: https://github.com/lieff/minimp3/issues/88
+ */
+ if (__builtin_constant_p(n % 4 == 0) && n % 4 == 0)
+ return;
+#endif
}
#endif
for (; i < n; i++)
@@ -4479,6 +4489,9 @@ counts rather than sample counts.
/*
REVISION HISTORY
================
+v0.6.29 - 2021-08-08
+ - Bring up to date with minimp3.
+
v0.6.28 - 2021-07-31
- Fix platform detection for ARM64.
- Fix a compilation error with C89.