minor clean-ups

master
Rob Sykes 2018-02-23 21:39:08 +00:00
parent 5e1f6946f8
commit ac53e00063
9 changed files with 33 additions and 26 deletions

View File

@ -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)

View File

@ -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 <http://www.gnu.org/licenses/>.
along with this library; if not, see <https://www.gnu.org/licenses/>.
Notes

5
NEWS
View File

@ -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.

4
README
View File

@ -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.

5
dist
View File

@ -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

View File

@ -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 <soxr.h>

View File

@ -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 <assert.h>
#include <errno.h>
#include <limits.h>
#include "math-wrap.h"
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@ -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

View File

@ -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 <math.h>
@ -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";
}

View File

@ -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. */