From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3] libmad: Add optimization config options
Date: Fri, 13 Jul 2012 22:14:05 +0200 (CEST) [thread overview]
Message-ID: <1591143229.1340033.1342210445309.JavaMail.root@advansee.com> (raw)
In-Reply-To: <17811032.1339793.1342209079006.JavaMail.root@advansee.com>
Configuring libmad with --enable-speed compromises accuracy and can cause audio
clipping in some cases (heard on ARM platform with some loud MP3s), so give
users the choice of MAD optimizations.
The default config corresponds to the default behavior of libmad's configure.
Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
---
Note that, if applicable, the options are always passed with either '--enable-'
or '--disable-' to be more robust than a simple omission, since this can avoid a
mismatch in config options if the package version is changed and its new default
configure options are different.
Changes for v2:
- Factorize the 'able' in the $(if ).
Changes for v3 (according to Thomas Petazzoni's comments):
- Undo v2.
- Rename the speed vs. accuracy choice configs to
BR2_PACKAGE_LIBMAD_OPTIMIZATION_*.
- Use 'default' naming if neither speed nor accuracy is compromised for the
other.
.../package/libmad/Config.in | 41 ++++++++++++++++++++
.../package/libmad/libmad.mk | 6 ++-
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git buildroot.orig/package/libmad/Config.in buildroot/package/libmad/Config.in
index 4d4f930..d0edc49 100644
--- buildroot.orig/package/libmad/Config.in
+++ buildroot/package/libmad/Config.in
@@ -6,3 +6,44 @@ config BR2_PACKAGE_LIBMAD
without a floating-point unit.
http://www.underbit.com/products/mad/
+
+if BR2_PACKAGE_LIBMAD
+
+choice
+ prompt "Speed vs. accuracy"
+ default BR2_PACKAGE_LIBMAD_OPTIMIZATION_DEFAULT
+
+config BR2_PACKAGE_LIBMAD_OPTIMIZATION_DEFAULT
+ bool "Default"
+ help
+ Keep optimizations balanced between speed and accuracy.
+
+config BR2_PACKAGE_LIBMAD_OPTIMIZATION_SPEED
+ bool "Optimize for speed over accuracy"
+ help
+ Compromise accuracy for speed.
+
+config BR2_PACKAGE_LIBMAD_OPTIMIZATION_ACCURACY
+ bool "Optimize for accuracy over speed"
+ help
+ Compromise speed for accuracy.
+
+endchoice
+
+config BR2_PACKAGE_LIBMAD_SSO
+ bool "Subband synthesis optimization"
+ help
+ Use the subband synthesis optimization, with reduced accuracy.
+
+config BR2_PACKAGE_LIBMAD_ASO
+ bool "Architecture-specific optimizations"
+ default y
+ help
+ Use certain architecture-specific optimizations.
+
+config BR2_PACKAGE_LIBMAD_STRICT_ISO
+ bool "Strict ISO/IEC interpretations"
+ help
+ Use strict ISO/IEC interpretations.
+
+endif
diff --git buildroot.orig/package/libmad/libmad.mk buildroot/package/libmad/libmad.mk
index 6e53cf2..3c92d52 100644
--- buildroot.orig/package/libmad/libmad.mk
+++ buildroot/package/libmad/libmad.mk
@@ -30,6 +30,10 @@ LIBMAD_POST_INSTALL_TARGET_HOOKS += LIBMAD_INSTALL_TARGET_PC
LIBMAD_CONF_OPT = \
--disable-debugging \
- --enable-speed
+ $(if $(BR2_PACKAGE_LIBMAD_OPTIMIZATION_SPEED),--enable-speed) \
+ $(if $(BR2_PACKAGE_LIBMAD_OPTIMIZATION_ACCURACY),--enable-accuracy) \
+ --$(if $(BR2_PACKAGE_LIBMAD_SSO),enable,disable)-sso \
+ --$(if $(BR2_PACKAGE_LIBMAD_ASO),enable,disable)-aso \
+ --$(if $(BR2_PACKAGE_LIBMAD_STRICT_ISO),enable,disable)-strict-iso
$(eval $(call AUTOTARGETS))
next prev parent reply other threads:[~2012-07-13 20:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <702722447.1326180.1342189637611.JavaMail.root@advansee.com>
2012-07-13 14:28 ` [Buildroot] [PATCH] libmad: Add optimization config options Benoît Thébaudeau
2012-07-13 17:25 ` [Buildroot] [PATCH v2] " Benoît Thébaudeau
2012-07-13 19:41 ` Thomas Petazzoni
2012-07-13 19:51 ` Benoît Thébaudeau
2012-07-13 20:14 ` Benoît Thébaudeau [this message]
2012-07-13 20:48 ` [Buildroot] [PATCH v3] " Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1591143229.1340033.1342210445309.JavaMail.root@advansee.com \
--to=benoit.thebaudeau@advansee.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox