mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 11:36:59 +03:00
tune libsoxr
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -64,3 +64,4 @@ $RECYCLE.BIN/
|
||||
libs/
|
||||
|
||||
/cdump.cmd
|
||||
/_codecs
|
||||
|
||||
Binary file not shown.
@@ -190,6 +190,7 @@ bool resample_newstream(struct processstate *process, unsigned raw_sample_rate,
|
||||
|
||||
#if BYTES_PER_FRAME == 4
|
||||
io_spec = SOXR(r, io_spec, SOXR_INT16_I, SOXR_INT16_I);
|
||||
io_spec.flags = SOXR_NO_DITHER;
|
||||
#else
|
||||
io_spec = SOXR(r, io_spec, SOXR_INT32_I, SOXR_INT32_I);
|
||||
#endif
|
||||
@@ -208,7 +209,7 @@ bool resample_newstream(struct processstate *process, unsigned raw_sample_rate,
|
||||
if (r->q_phase_response > -1) {
|
||||
q_spec.phase_response = r->q_phase_response;
|
||||
}
|
||||
|
||||
|
||||
#if RESAMPLE_MP
|
||||
r_spec = SOXR(r, runtime_spec, 0); // make use of libsoxr OpenMP support allowing parallel execution if multiple cores
|
||||
#endif
|
||||
@@ -307,22 +308,23 @@ bool resample_init(char *opt) {
|
||||
phase_response = next_param(NULL, ':');
|
||||
}
|
||||
|
||||
|
||||
#if BYTES_PER_FRAME == 4
|
||||
// default to LQ (16 bit) if not user specified
|
||||
r->q_recipe = SOXR_LQ;
|
||||
// default to LQ (16 bits) if not user specified
|
||||
r->q_recipe = SOXR_LQ | SOXR_MINIMUM_PHASE;
|
||||
r->q_flags = SOXR_ROLLOFF_NONE;
|
||||
r->q_phase_response = 0;
|
||||
#else
|
||||
// default to HQ (20 bit) if not user specified
|
||||
// default to HQ (20 bits) if not user specified
|
||||
r->q_recipe = SOXR_HQ;
|
||||
#endif
|
||||
r->q_flags = 0;
|
||||
r->q_phase_response = -1;
|
||||
#endif
|
||||
// default to 1db of attenuation if not user specified
|
||||
r->scale = pow(10, -1.0 / 20);
|
||||
// override recipe derived values with user specified values
|
||||
r->q_precision = 0;
|
||||
r->q_passband_end = 0;
|
||||
r->q_stopband_begin = 0;
|
||||
r->q_phase_response = -1;
|
||||
|
||||
if (recipe && recipe[0] != '\0') {
|
||||
if (strchr(recipe, 'v')) r->q_recipe = SOXR_VHQ;
|
||||
|
||||
Reference in New Issue
Block a user