Initial experimental import of bq resampler

This commit is contained in:
Chris Cannam
2021-05-10 18:11:35 +01:00
parent cd1856871e
commit f6a66171bc
8 changed files with 1269 additions and 124 deletions

View File

@@ -1,4 +1,4 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
//* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Rubber Band Library
@@ -32,6 +32,9 @@ class Resampler
{
public:
enum Quality { Best, FastestTolerable, Fastest };
enum Dynamism { RatioOftenChanging, RatioMostlyFixed };
enum RatioChange { SmoothRatioChange, SuddenRatioChange };
enum Exception { ImplementationError };
struct Parameters {
@@ -41,6 +44,22 @@ public:
*/
Quality quality;
/**
* Performance hint indicating whether the ratio is expected
* to change regularly or not. If not, more work may happen on
* ratio changes to reduce work when ratio is unchanged.
*/
Dynamism dynamism;
/**
* Hint indicating whether to smooth transitions, via filter
* interpolation or some such method, at ratio change
* boundaries, or whether to make a precise switch to the new
* ratio without regard to audible artifacts. The actual
* effect of this depends on the implementation in use.
*/
RatioChange ratioChange;
/**
* Rate of expected input prior to resampling: may be used to
* determine the filter bandwidth for the quality setting. If
@@ -67,6 +86,8 @@ public:
Parameters() :
quality(FastestTolerable),
dynamism(RatioMostlyFixed),
ratioChange(SmoothRatioChange),
initialSampleRate(44100),
maxBufferSize(0),
debugLevel(0) { }