Removed the global limitation of the native sample rates on ARM devices and replaced it with an APM-internal limitation
when building the code for ARM. The intention is to follow up this CL with other CLs that further addresses the internal resampling in APM BUG=webrtc:6181 Review-Url: https://codereview.webrtc.org/2265473003 Cr-Commit-Position: refs/heads/master@{#13974}
This commit is contained in:
parent
d50747269e
commit
cc34fafcf9
@ -73,12 +73,8 @@ namespace webrtc {
|
||||
const int AudioProcessing::kNativeSampleRatesHz[] = {
|
||||
AudioProcessing::kSampleRate8kHz,
|
||||
AudioProcessing::kSampleRate16kHz,
|
||||
#ifdef WEBRTC_ARCH_ARM_FAMILY
|
||||
AudioProcessing::kSampleRate32kHz};
|
||||
#else
|
||||
AudioProcessing::kSampleRate32kHz,
|
||||
AudioProcessing::kSampleRate48kHz};
|
||||
#endif // WEBRTC_ARCH_ARM_FAMILY
|
||||
const size_t AudioProcessing::kNumNativeSampleRates =
|
||||
arraysize(AudioProcessing::kNativeSampleRatesHz);
|
||||
const int AudioProcessing::kMaxNativeSampleRateHz = AudioProcessing::
|
||||
@ -86,6 +82,15 @@ const int AudioProcessing::kMaxNativeSampleRateHz = AudioProcessing::
|
||||
|
||||
namespace {
|
||||
|
||||
const int kInternalNativeRates[] = {AudioProcessing::kSampleRate8kHz,
|
||||
AudioProcessing::kSampleRate16kHz,
|
||||
#ifdef WEBRTC_ARCH_ARM_FAMILY
|
||||
AudioProcessing::kSampleRate32kHz};
|
||||
#else
|
||||
AudioProcessing::kSampleRate32kHz,
|
||||
AudioProcessing::kSampleRate48kHz};
|
||||
#endif // WEBRTC_ARCH_ARM_FAMILY
|
||||
|
||||
static bool LayoutHasKeyboard(AudioProcessing::ChannelLayout layout) {
|
||||
switch (layout) {
|
||||
case AudioProcessing::kMono:
|
||||
@ -106,12 +111,12 @@ bool is_multi_band(int sample_rate_hz) {
|
||||
}
|
||||
|
||||
int ClosestHigherNativeRate(int min_proc_rate) {
|
||||
for (int rate : AudioProcessing::kNativeSampleRatesHz) {
|
||||
for (int rate : kInternalNativeRates) {
|
||||
if (rate >= min_proc_rate) {
|
||||
return rate;
|
||||
}
|
||||
}
|
||||
return AudioProcessing::kMaxNativeSampleRateHz;
|
||||
return kInternalNativeRates[arraysize(kInternalNativeRates) - 1];
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user