From c1ebbac6dacd523e7232bfadc4e46e3796a21e0a Mon Sep 17 00:00:00 2001 From: Rob Sykes Date: Mon, 24 Dec 2012 14:38:07 +0000 Subject: [PATCH] rename API quality parameter 'bits' to 'precision' --- src/rate.h | 2 +- src/soxr.c | 6 +++--- src/soxr.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rate.h b/src/rate.h index 6ce2263..85ed9a3 100644 --- a/src/rate.h +++ b/src/rate.h @@ -698,7 +698,7 @@ static char const * rate_create( return rate_init( channel, shared, io_ratio, - q_spec->bits, + q_spec->precision, q_spec->phase, q_spec->bw_pc, q_spec->anti_aliasing_pc, diff --git a/src/soxr.c b/src/soxr.c index f9e105c..5f84b73 100644 --- a/src/soxr.c +++ b/src/soxr.c @@ -101,8 +101,8 @@ soxr_quality_spec_t soxr_quality_spec(unsigned long recipe, unsigned long flags) quality = 0; p->phase = "\62\31\144"[(recipe & 0x30)>>8]; p->anti_aliasing_pc = 100; - p->bits = !quality? 0: quality < 3? 16 : quality < 8? 4 + quality * 4 : 55 - quality * 4; - rej = p->bits * linear_to_dB(2.); + p->precision = !quality? 0: quality < 3? 16 : quality < 8? 4 + quality * 4 : 55 - quality * 4; + rej = p->precision * linear_to_dB(2.); p->flags = flags; if (quality < 8) { p->bw_pc = quality == 1? LOW_Q_BW0_PC : 100 - 5 / TO_3dB(rej); @@ -244,7 +244,7 @@ soxr_t soxr_create( p->seed = (unsigned long)time(0) ^ (unsigned long)p; #if HAVE_SINGLE_PRECISION - if (!HAVE_DOUBLE_PRECISION || (p->q_spec.bits <= 20 && !(p->q_spec.flags & SOXR_DOUBLE_PRECISION)) + if (!HAVE_DOUBLE_PRECISION || (p->q_spec.precision <= 20 && !(p->q_spec.flags & SOXR_DOUBLE_PRECISION)) #if HAVE_VR || (p->q_spec.flags & SOXR_VR) #endif diff --git a/src/soxr.h b/src/soxr.h index c8374b2..b0eb773 100644 --- a/src/soxr.h +++ b/src/soxr.h @@ -219,9 +219,9 @@ struct soxr_io_spec { /* Typically */ struct soxr_quality_spec { /* Typically */ - double bits; /* Required bit-accuracy (pass + stop). 20 */ + double precision; /* Conversion precision (in bits). 20 */ double phase; /* Linear/minimum etc. phase. [0,100] 50 */ - double bw_pc; /* Pass-band % (0dB pt.) to preserve. 91.3 */ + double bw_pc; /* Band-width % (0dB pt.) to preserve. 91.3 */ double anti_aliasing_pc; /* % bandwidth without aliasing. 100 */ void * e; /* Reserved for internal use. 0 */ unsigned long flags; /* Per the following #defines. 0 */ @@ -233,7 +233,7 @@ struct soxr_quality_spec { /* Typically */ #define SOXR_MAINTAIN_3DB_PT 4u /* Reserved for internal use. */ #define SOXR_HI_PREC_CLOCK 8u /* Increase `irrational' ratio accuracy. */ -#define SOXR_DOUBLE_PRECISION 16u /* Use double prec. even @ bitdepths <= 20.*/ +#define SOXR_DOUBLE_PRECISION 16u /* Use D.P. calcs even if precision <= 20. */ #define SOXR_VR 32u /* Experimental, variable-rate resampling. */