build: Add configure option --disable-high-precision
Luiz Augusto von Dentz
maintainerRFC 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
@@ -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
@@ -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
Marcel Holtmann
maintainerHi 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@@ -58,4 +58,12 @@ if (test "${enable_tester}" != "no"); thenfi
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
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
Luiz Augusto von Dentz
maintainerHi 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@@ -58,4 +58,12 @@ if (test "${enable_tester}" != "no"); thenfi
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@@ -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