From ac53e00063a84e2c56d0db978a6b7970d7b3b9ac Mon Sep 17 00:00:00 2001 From: Rob Sykes Date: Fri, 23 Feb 2018 21:39:08 +0000 Subject: [PATCH] minor clean-ups --- CMakeLists.txt | 10 +++++----- LICENCE | 4 ++-- NEWS | 5 ++++- README | 4 ++-- dist | 5 +---- examples/4-split-channels.c | 4 ++-- examples/examples-common.h | 10 +++++++--- src/soxr.c | 13 ++++++++----- src/soxr.h | 4 ++-- 9 files changed, 33 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9ee5d0..292cda2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -# SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net +# SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net # Licence for this file: LGPL v2.1 See LICENCE for details. -cmake_minimum_required (VERSION 3.0 FATAL_ERROR) +cmake_minimum_required (VERSION 3.1 FATAL_ERROR) project (soxr C) set (DESCRIPTION_SUMMARY @@ -74,11 +74,11 @@ cmake_dependent_option (BUILD_LSR_TESTS "Build LSR tests." OFF option (WITH_HI_PREC_CLOCK "Enable high-precision time-base." ON) option (WITH_FLOAT_STD_PREC_CLOCK - "Use floating-point for standard-precision time-base." OFF) + "Use floating-point for standard-precision time-base." OFF) option (WITH_DEV_TRACE "Enable developer trace capability." ON) option (WITH_DEV_GPROF "Enable developer grpof output." OFF) mark_as_advanced (WITH_HI_PREC_CLOCK WITH_FLOAT_STD_PREC_CLOCK - WITH_DEV_TRACE WITH_DEV_GPROF) + WITH_DEV_TRACE WITH_DEV_GPROF) @@ -328,7 +328,7 @@ if (UNIX) set (CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") set (CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") set (CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") - set (CPACK_SOURCE_GENERATOR "TGZ") # Use TXZ (cmake 3.1) after 17-12-16 + set (CPACK_SOURCE_GENERATOR "TXZ") set (CPACK_SOURCE_IGNORE_FILES "dist;/lsr-tests/;/Debug.*/;/Release.*/;\\\\.swp$;\\\\.git.*;/\\\\.git/") include (CPack) diff --git a/LICENCE b/LICENCE index 52f84ee..43e5a71 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,4 @@ -SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net +SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -11,7 +11,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License -along with this library; if not, see . +along with this library; if not, see . Notes diff --git a/NEWS b/NEWS index 4252447..d41450f 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,10 @@ Version 0.1.3 (2016-mm-dd) * SIMD enhancements: SSE, AVX, Neon. * Improve support for clang, ARM, and cross-compilation. * Provide env. var. override of runtime parameters. - * N.B. some build configuration name changes; see INSTALL. + * Build fix re cmake variables AVCODEC_INCLUDE_DIRS & AVUTIL_INCLUDE_DIRS. + * N.B. build options WITH_SINGLE_PRECISION, WITH_DOUBLE_PRECISION & WITH_SIMD + have been removed; replacement options are detailed in INSTALL, `Resampling + engines'. Version 0.1.2 (2015-09-05) * Fix conversion failure when I/O types differ but I/O rates don't. diff --git a/README b/README index 0070896..7f9a7af 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net +SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net The SoX Resampler library `libsoxr' performs one-dimensional sample-rate conversion -- it may be used, for example, to resample PCM-encoded audio. @@ -46,7 +46,7 @@ size configuration parameters may be used to reduce this figure). For build and installation instructions, see the file `INSTALL'; for copyright and licensing information, see the file `LICENCE'. -For support and new versions, see http://soxr.sourceforge.net +For support and new versions, see https://soxr.sourceforge.net ________ ¹ For example, multi-channel resampling can utilise multiple CPU-cores. ² Bit-perfect within practical occupied-bandwidth limits. diff --git a/dist b/dist index 759c580..ee68b30 100755 --- a/dist +++ b/dist @@ -1,6 +1,6 @@ #!/bin/sh set -e -# SoX Resampler Library Copyright (c) 2007-13 robs@users.sourceforge.net +# SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net # Licence for this file: LGPL v2.1 See LICENCE for details. # Makes the distribution tarball @@ -10,6 +10,3 @@ rm -rf Release ./go -j4 cd Release make package_source -gunzip *.tar.gz -xz *.tar -echo *.xz diff --git a/examples/4-split-channels.c b/examples/4-split-channels.c index 97916ad..a9022ce 100644 --- a/examples/4-split-channels.c +++ b/examples/4-split-channels.c @@ -1,4 +1,4 @@ -/* SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net +/* SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net * Licence for this file: LGPL v2.1 See LICENCE for details. */ /* Example 4: variant of examples 2 & 3, demonstrating I/O with split channels. @@ -14,7 +14,7 @@ * Note also (not shown in the examples) that split/interleaved channels may * be used for input and output independently. * - * Aguments are as example 3. + * Arguments are as example 3. */ #include diff --git a/examples/examples-common.h b/examples/examples-common.h index 7ebde73..fc8ed82 100644 --- a/examples/examples-common.h +++ b/examples/examples-common.h @@ -1,4 +1,4 @@ -/* SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net +/* SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net * Licence for this file: LGPL v2.1 See LICENCE for details. */ /* Common includes etc. for the examples. */ @@ -6,7 +6,7 @@ #include #include #include -#include "math-wrap.h" +#include #include #include #include @@ -35,9 +35,13 @@ #endif #undef min -#undef max #define min(x,y) ((x)<(y)?(x):(y)) + +#undef max #define max(x,y) ((x)>(y)?(x):(y)) #undef AL #define AL(a) (sizeof(a)/sizeof((a)[0])) /* Array Length */ + +#undef M_PI /* Sometimes missing, so ensure that it is defined: */ +#define M_PI 3.14159265358979323846 diff --git a/src/soxr.c b/src/soxr.c index d9e725a..c2861ac 100644 --- a/src/soxr.c +++ b/src/soxr.c @@ -1,4 +1,4 @@ -/* SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net +/* SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net * Licence for this file: LGPL v2.1 See LICENCE for details. */ #include @@ -131,8 +131,10 @@ soxr_quality_spec_t soxr_quality_spec(unsigned long recipe, unsigned long flags) else { /* TODO: move to soxr-lsr.c */ static float const bw[] = {.931f, .832f, .663f}; p->passband_end = bw[quality - SOXR_LSR0Q]; - if (quality == SOXR_LSR2Q) - p->flags &= ~SOXR_ROLLOFF_NONE, p->flags |= SOXR_ROLLOFF_LSR2Q | SOXR_PROMOTE_TO_LQ; + if (quality == SOXR_LSR2Q) { + p->flags &= ~SOXR_ROLLOFF_NONE; + p->flags |= SOXR_ROLLOFF_LSR2Q | SOXR_PROMOTE_TO_LQ; + } } if (recipe & SOXR_STEEP_FILTER) p->passband_end = 1 - .01 / lsx_to_3dB(rej); @@ -508,7 +510,8 @@ static void soxr_delete0(soxr_t p) double soxr_delay(soxr_t p) { - return (p && !p->error && p->resamplers)? resampler_delay(p->resamplers[0]) : 0; + return + (p && !p->error && p->resamplers)? resampler_delay(p->resamplers[0]) : 0; } @@ -582,7 +585,7 @@ soxr_error_t soxr_set_io_ratio(soxr_t p, double io_ratio, size_t slew_len) return error; } return fabs(p->io_ratio - io_ratio) < 1e-15? 0 : - "Varying O/I ratio is not supported with this quality level"; + "varying O/I ratio is not supported with this quality level"; } diff --git a/src/soxr.h b/src/soxr.h index 1d8039e..18ad039 100644 --- a/src/soxr.h +++ b/src/soxr.h @@ -1,4 +1,4 @@ -/* SoX Resampler Library Copyright (c) 2007-16 robs@users.sourceforge.net +/* SoX Resampler Library Copyright (c) 2007-18 robs@users.sourceforge.net * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by @@ -173,7 +173,7 @@ SOXR size_t /*odone*/ soxr_output(/* Resample and output a block of data.*/ SOXR soxr_error_t soxr_error(soxr_t); /* Query error status. */ SOXR size_t * soxr_num_clips(soxr_t); /* Query int. clip counter (for R/W). */ SOXR double soxr_delay(soxr_t); /* Query current delay in output samples.*/ -SOXR char const * soxr_engine(soxr_t p); /* Query resampling engine name. */ +SOXR char const * soxr_engine(soxr_t); /* Query resampling engine name. */ SOXR soxr_error_t soxr_clear(soxr_t); /* Ready for fresh signal, same config. */ SOXR void soxr_delete(soxr_t); /* Free resources. */