libsamplerate: add option to remove best quality, make much smaller
PATCH 1/1 libsamplerate: add option to remove best quality, make much smaller
Signed-off-by Urja Rannikko <[email protected]>
---
Request For _No_ Comments. I made this before I heard that conditional patching will not do, so posting it as-is in case someone else wants to make the idea happen. I don't even know if the hook works yet
(rebuild in progress lol), so it's just an idea. Consider this contribution in the public domain.
--- package/libsamplerate/Config.in | 11 +++++++ .../hack_out_best_quality.condpatch | 31 +++++++++++++++++++ package/libsamplerate/libsamplerate.mk | 7 +++++ 3 files changed, 49 insertions(+) create mode 100644 package/libsamplerate/hack_out_best_quality.condpatch
package/libsamplerate/Config.in +11 -0
@@ -7,3 +7,14 @@ config BR2_PACKAGE_LIBSAMPLERATE 44.1kHz to the 48kHz sample rate used by DAT players. http://www.mega-nerd.com/SRC/ + +if BR2_PACKAGE_LIBSAMPLERATE + +config BR2_PACKAGE_LIBSAMPLERATE_REMOVE_SINC_BEST_QUALITY + bool "remove best quality sinc conversion (> 1 MB smaller)" + help + If you select this, SRC_SINC_BEST_QUALITY silently + maps to SRC_SINC_MEDIUM_QUALITY, but libsamplerate + is also significantly smaller. + +endif
package/libsamplerate/hack_out_best_quality.condpatch new file +31 -0
@@ -0,0 +1,31 @@ +diff --git a/src/src_sinc.c b/src/src_sinc.c +index 1871684..b592a10 100644 +--- a/src/src_sinc.c ++++ b/src/src_sinc.c +@@ -33,7 +33,6 @@ typedef float coeff_t ; + + #include "fastest_coeffs.h" + #include "mid_qual_coeffs.h" +-#include "high_qual_coeffs.h" + + typedef struct + { int sinc_magic_marker ; +@@ -190,17 +189,12 @@ sinc_set_converter (SRC_PRIVATE *psrc, int src_enum) + break ; + + case SRC_SINC_MEDIUM_QUALITY : ++ case SRC_SINC_BEST_QUALITY : + temp_filter.coeffs = slow_mid_qual_coeffs.coeffs ; + temp_filter.coeff_half_len = ARRAY_LEN (slow_mid_qual_coeffs.coeffs) - 2 ; + temp_filter.index_inc = slow_mid_qual_coeffs.increment ; + break ; + +- case SRC_SINC_BEST_QUALITY : +- temp_filter.coeffs = slow_high_qual_coeffs.coeffs ; +- temp_filter.coeff_half_len = ARRAY_LEN (slow_high_qual_coeffs.coeffs) - 2 ; +- temp_filter.index_inc = slow_high_qual_coeffs.increment ; +- break ; +- + default : + return SRC_ERR_BAD_CONVERTER ; + } ;
package/libsamplerate/libsamplerate.mk +7 -0
@@ -20,4 +20,11 @@ ifeq ($(BR2_PACKAGE_LIBSNDFILE),y) LIBSAMPLERATE_DEPENDENCIES += libsndfile endif +ifeq ($(BR2_PACKAGE_LIBSAMPLERATE_REMOVE_SINC_BEST_QUALITY),y) +define LIBSAMPLERATE_REMOVE_SINC_BEST_QUALITY_HOOK + (cd $(@D); patch -p1 < $(LIBSAMPLERATE_PKGDIR)/hack_out_best_quality.condpatch) +endef +LIBSAMPLERATE_POST_PATCH_HOOKS += LIBSAMPLERATE_REMOVE_SINC_BEST_QUALITY_HOOK +endif + $(eval $(autotools-package))
Signature · 1 line
2.31.1
PATCH 1/1 libsamplerate: add option to remove best quality, make much smaller
Quoted 1 line
I don't even know if the hook works yet
It doesnt, it gets the path to the patch wrong somehow. *shrug*