Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
resampler_config.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 Roc Streaming authors
3
*
4
* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
*/
8
9
//! @file roc_audio/resampler_config.h
10
//! @brief Resampler config.
11
12
#ifndef ROC_AUDIO_RESAMPLER_CONFIG_H_
13
#define ROC_AUDIO_RESAMPLER_CONFIG_H_
14
15
#include "
roc_audio/latency_tuner.h
"
16
17
namespace
roc
{
18
namespace
audio
{
19
20
//! Resampler backends.
21
enum
ResamplerBackend
{
22
//! Default backend.
23
//! Resolved to one of other backends, depending on what
24
//! is enabled at build time.
25
ResamplerBackend_Default
,
26
27
//! Built-in resampler.
28
//! High precision, high quality, slow.
29
ResamplerBackend_Builtin
,
30
31
//! SpeexDSP resampler.
32
//! Low precision, high quality, fast.
33
//! May be disabled at build time.
34
ResamplerBackend_Speex
,
35
36
//! Combined SpeexDSP + decimating resampler.
37
//! Tolerable precision, tolerable quality, fast.
38
//! May be disabled at build time.
39
ResamplerBackend_SpeexDec
40
};
41
42
//! Resampler parameters presets.
43
enum
ResamplerProfile
{
44
//! Low quality, fast speed.
45
ResamplerProfile_Low
,
46
47
//! Medium quality, medium speed.
48
ResamplerProfile_Medium
,
49
50
//! High quality, low speed.
51
ResamplerProfile_High
52
};
53
54
//! Resampler config.
55
struct
ResamplerConfig {
56
//! Resampler backend.
57
ResamplerBackend
backend
;
58
59
//! Resampler profile.
60
ResamplerProfile
profile
;
61
62
ResamplerConfig()
63
:
backend
(
ResamplerBackend_Default
)
64
,
profile
(
ResamplerProfile_Medium
) {
65
}
66
67
//! Automatically fill missing settings.
68
void
deduce_defaults
(
LatencyTunerBackend
latency_backend,
69
LatencyTunerProfile
latency_tuner);
70
};
71
72
//! Get string name of resampler backend.
73
const
char
*
resampler_backend_to_str
(
ResamplerBackend
backend);
74
75
//! Get string name of resampler profile.
76
const
char
*
resampler_profile_to_str
(
ResamplerProfile
profile);
77
78
}
// namespace audio
79
}
// namespace roc
80
81
#endif
// ROC_AUDIO_RESAMPLER_CONFIG_H_
latency_tuner.h
Latency tuner.
roc::audio
Audio frames and audio processing.
roc::audio::LatencyTunerBackend
LatencyTunerBackend
Latency tuner backend. Defines which latency we monitor and tune to achieve target.
Definition
latency_tuner.h:29
roc::audio::ResamplerBackend
ResamplerBackend
Resampler backends.
Definition
resampler_config.h:21
roc::audio::ResamplerBackend_SpeexDec
@ ResamplerBackend_SpeexDec
Combined SpeexDSP + decimating resampler. Tolerable precision, tolerable quality, fast....
Definition
resampler_config.h:39
roc::audio::ResamplerBackend_Builtin
@ ResamplerBackend_Builtin
Built-in resampler. High precision, high quality, slow.
Definition
resampler_config.h:29
roc::audio::ResamplerBackend_Default
@ ResamplerBackend_Default
Default backend. Resolved to one of other backends, depending on what is enabled at build time.
Definition
resampler_config.h:25
roc::audio::ResamplerBackend_Speex
@ ResamplerBackend_Speex
SpeexDSP resampler. Low precision, high quality, fast. May be disabled at build time.
Definition
resampler_config.h:34
roc::audio::resampler_backend_to_str
const char * resampler_backend_to_str(ResamplerBackend backend)
Get string name of resampler backend.
roc::audio::resampler_profile_to_str
const char * resampler_profile_to_str(ResamplerProfile profile)
Get string name of resampler profile.
roc::audio::ResamplerProfile
ResamplerProfile
Resampler parameters presets.
Definition
resampler_config.h:43
roc::audio::ResamplerProfile_Low
@ ResamplerProfile_Low
Low quality, fast speed.
Definition
resampler_config.h:45
roc::audio::ResamplerProfile_High
@ ResamplerProfile_High
High quality, low speed.
Definition
resampler_config.h:51
roc::audio::ResamplerProfile_Medium
@ ResamplerProfile_Medium
Medium quality, medium speed.
Definition
resampler_config.h:48
roc::audio::LatencyTunerProfile
LatencyTunerProfile
Latency tuner profile. Defines whether and how we tune latency on fly to compensate clock drift and j...
Definition
latency_tuner.h:47
roc
Root namespace.
roc::audio::ResamplerConfig::backend
ResamplerBackend backend
Resampler backend.
Definition
resampler_config.h:57
roc::audio::ResamplerConfig::profile
ResamplerProfile profile
Resampler profile.
Definition
resampler_config.h:60
roc::audio::ResamplerConfig::deduce_defaults
void deduce_defaults(LatencyTunerBackend latency_backend, LatencyTunerProfile latency_tuner)
Automatically fill missing settings.
roc_audio
resampler_config.h
Generated by
1.17.0