rename API quality parameter 'bits' to 'precision'

rename-bits
Rob Sykes 2012-12-24 14:38:07 +00:00
parent 4c42caa469
commit c1ebbac6da
3 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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