Skip to contentSkip to conversation

build: Add configure option --disable-high-precision

RFC In review Luiz Augusto von Dentz 2 participants 3 messages Sep 16, 2013 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

RFC 1/1 build: Add configure option --disable-high-precision

From: Luiz Augusto von Dentz <[email protected]>

This enables high precision using 64 bits accumulators by default which can be disabled with --disable-high-precision.

---
 configure.ac     | 8 ++++++++
 sbc/sbc_tables.h | 2 --
 2 files changed, 8 insertions(+), 2 deletions(-)
configure.ac +8 -0
index c052616..5f994d1 100644
@@ -58,4 +58,12 @@ if (test "${enable_tester}" != "no"); then
 fi
 AM_CONDITIONAL(TESTER, test "${enable_tester}" != "no")
 
+AC_ARG_ENABLE(high-precision, AC_HELP_STRING([--disable-high-precision],
+					[disable high precision support]),
+					[enable_high_precision=${enableval}])
+if (test "${enable_high_precision}" != "no"); then
+	AC_DEFINE(SBC_HIGH_PRECISION, 1,
+		[Define to 1 to enable high precision build of SBC encoder])
+fi
+
 AC_OUTPUT(Makefile sbc/sbc.pc)
sbc/sbc_tables.h +0 -2
index 25e24e6..3fd80e1 100644
@@ -136,8 +136,6 @@ static const int32_t synmatrix8[16][8] = {
 	  SN8(0xfb8e3130), SN8(0xf8275a10), SN8(0xfe70747c), SN8(0x06a6d988) }
 };
 
-/* Uncomment the following line to enable high precision build of SBC encoder */
-
 /* #define SBC_HIGH_PRECISION */
 
 #ifdef SBC_HIGH_PRECISION
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

Hi Luiz,

Quoted 29 lines

This enables high precision using 64 bits accumulators by default which can be disabled with --disable-high-precision.
---
configure.ac | 8 ++++++++
sbc/sbc_tables.h | 2 --

2 files changed, 8 insertions(+), 2 deletions(-)
configure.ac +0 -0
index c052616..5f994d1 100644
@@ -58,4 +58,12 @@ if (test "${enable_tester}" != "no"); then

fi
AM_CONDITIONAL(TESTER, test "${enable_tester}" != "no")

configure.ac +8 -0
+AC_ARG_ENABLE(high-precision, AC_HELP_STRING([--disable-high-precision],
+					[disable high precision support]),
+					[enable_high_precision=${enableval}])
+if (test "${enable_high_precision}" != "no"); then
+	AC_DEFINE(SBC_HIGH_PRECISION, 1,
+		[Define to 1 to enable high precision build of SBC encoder])
+fi
+

AC_OUTPUT(Makefile sbc/sbc.pc)

sbc/sbc_tables.h +0 -0
index 25e24e6..3fd80e1 100644

sbc/sbc_tables.h static const int32_t synmatrix8[16][8] = { · line 139

Quoted 6 lines
sbc/sbc_tables.h +0 -2
@@ -136,8 +136,6 @@ static const int32_t synmatrix8[16][8] = {
 	  SN8(0xfb8e3130), SN8(0xf8275a10), SN8(0xfe70747c), SN8(0x06a6d988) }
 };
 
-/* Uncomment the following line to enable high precision build of SBC encoder */
-
 /* #define SBC_HIGH_PRECISION */

the comment with the define should also be removed.

Is there any impact on using 64-bit integers compared to 32-bit integers. When would you use one or the other. I think this needs to be documented in README as well.

Regards

Marcel

author maintainer
#2 lore raw

Hi Marcel,

Quoted 34 lines · Marcel Holtmann

Hi Luiz,

Quoted 32 lines

This enables high precision using 64 bits accumulators by default which can be disabled with --disable-high-precision.
---
configure.ac | 8 ++++++++
sbc/sbc_tables.h | 2 --

2 files changed, 8 insertions(+), 2 deletions(-)
configure.ac +0 -0
index c052616..5f994d1 100644
@@ -58,4 +58,12 @@ if (test "${enable_tester}" != "no"); then

fi
AM_CONDITIONAL(TESTER, test "${enable_tester}" != "no")

configure.ac +8 -0
+AC_ARG_ENABLE(high-precision, AC_HELP_STRING([--disable-high-precision],
+                                     [disable high precision support]),
+                                     [enable_high_precision=${enableval}])
+if (test "${enable_high_precision}" != "no"); then
+     AC_DEFINE(SBC_HIGH_PRECISION, 1,
+             [Define to 1 to enable high precision build of SBC encoder])
+fi
+

AC_OUTPUT(Makefile sbc/sbc.pc)

sbc/sbc_tables.h +0 -0
index 25e24e6..3fd80e1 100644
@@ -136,8 +136,6 @@ static const int32_t synmatrix8[16][8] = {
        SN8(0xfb8e3130), SN8(0xf8275a10), SN8(0xfe70747c), SN8(0x06a6d988) }
 };
 
Quoted 7 lines

sbc/sbc_tables.h static const int32_t synmatrix8[16][8] = { · line 139

Quoted 3 lines
sbc/sbc_tables.h +0 -2
-/* Uncomment the following line to enable high precision build of SBC encoder */
-
 /* #define SBC_HIGH_PRECISION */

the comment with the define should also be removed.

Is there any impact on using 64-bit integers compared to 32-bit integers. When would you use one or the other. I think this needs to be documented in README as well.

The use of 64-bit apparently makes the encoder 'better' in term of dynamic range, but I will probably check with the tools that Siarhei uses for testing the exact amount of 'better', the drawback is that for 32-bits systems it might have an impact in performance so it is good to keep --disable-high-precision and document it in the README as you suggested.

Maybe this will be useful to kick start some unit tests for sbc as well.

Signature · 1 line
Luiz Augusto von Dentz