Codebase list squeezelite / 957c6c7
make use of libsoxr OpenMP support allowing parallel execution if multiple cores Adrian Smith 9 years ago
1 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4949 void (* soxr_delete)(soxr_t);
5050 soxr_error_t (* soxr_process)(soxr_t, soxr_in_t, size_t, size_t *, soxr_out_t, size_t olen, size_t *);
5151 size_t *(* soxr_num_clips)(soxr_t);
52 soxr_runtime_spec_t (* soxr_runtime_spec)(unsigned num_threads);
5253 // soxr_strerror is a macro so not included here
5354 #endif
5455 };
174175
175176 soxr_io_spec_t io_spec;
176177 soxr_quality_spec_t q_spec;
178 soxr_runtime_spec_t r_spec;
177179 soxr_error_t error;
178180
179181 LOG_INFO("resampling from %u -> %u", raw_sample_rate, outrate);
195197 q_spec.phase_response = r->q_phase_response;
196198 }
197199
200 r_spec = SOXR(r, runtime_spec, 0); // make use of libsoxr OpenMP support allowing parallel execution if multiple cores
201
198202 LOG_DEBUG("resampling with soxr_quality_spec_t[precision: %03.1f, passband_end: %03.6f, stopband_begin: %03.6f, "
199203 "phase_response: %03.1f, flags: 0x%02x], soxr_io_spec_t[scale: %03.2f]", q_spec.precision,
200204 q_spec.passband_end, q_spec.stopband_begin, q_spec.phase_response, q_spec.flags, io_spec.scale);
201205
202 r->resampler = SOXR(r, create, raw_sample_rate, outrate, 2, &error, &io_spec, &q_spec, NULL);
206 r->resampler = SOXR(r, create, raw_sample_rate, outrate, 2, &error, &io_spec, &q_spec, &r_spec);
203207 if (error) {
204208 LOG_INFO("soxr_create error: %s", soxr_strerror(error));
205209 return false;
234238
235239 r->soxr_io_spec = dlsym(handle, "soxr_io_spec");
236240 r->soxr_quality_spec = dlsym(handle, "soxr_quality_spec");
241 r->soxr_runtime_spec = dlsym(handle, "soxr_runtime_spec");
237242 r->soxr_create = dlsym(handle, "soxr_create");
238243 r->soxr_delete = dlsym(handle, "soxr_delete");
239244 r->soxr_process = dlsym(handle, "soxr_process");