libmad: Add optimization config options
authorBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Fri, 13 Jul 2012 20:14:05 +0000 (22:14 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 13 Jul 2012 20:40:14 +0000 (22:40 +0200)
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>
package/libmad/Config.in
package/libmad/libmad.mk

index 4d4f9301a6f2dbddc5ac8299b93397c55972a368..d0edc497c43abd7e7726a606cef5dacdee6a956f 100644 (file)
@@ -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
index 6e53cf2574306d89fb30a0f4da968104e88cbb52..3c92d528d462317e10bd4ea680b4645e00ecc2c4 100644 (file)
@@ -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))