Update the input duration to reduce the number of samples to process

Bug: 305866207
Test: atest VtsHalBassBoostTargetTest
      atest VtsHalVolumeTargetTest
      atest VtsHalVirtualizerTargetTest
      atest VtsHalPresetReverbTargetTest
Change-Id: I6dc4fa6006634e570d075f8099401bd3dc572da1
This commit is contained in:
Sneha Patil 2024-06-06 09:42:39 +00:00
parent 66f0636c0e
commit a9171f9d8d
4 changed files with 6 additions and 6 deletions

View file

@ -114,7 +114,7 @@ class BassBoostEffectHelper : public EffectHelper {
}
static constexpr int kSamplingFrequency = 44100;
static constexpr int kDurationMilliSec = 2000;
static constexpr int kDurationMilliSec = 720;
static constexpr int kInputSize = kSamplingFrequency * kDurationMilliSec / 1000;
long mInputFrameCount, mOutputFrameCount;
std::shared_ptr<IFactory> mFactory;
@ -231,7 +231,7 @@ class BassBoostDataTest : public ::testing::TestWithParam<BassBoostDataTestParam
return gains[0] - gains[1];
}
static constexpr int kNPointFFT = 32768;
static constexpr int kNPointFFT = 16384;
static constexpr float kBinWidth = (float)kSamplingFrequency / kNPointFFT;
std::set<int> mStrengthValues;
int32_t mChannelLayout;

View file

@ -82,7 +82,7 @@ class PresetReverbHelper : public EffectHelper {
}
static constexpr int kSamplingFrequency = 44100;
static constexpr int kDurationMilliSec = 2000;
static constexpr int kDurationMilliSec = 500;
static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000;
int mStereoChannelCount =
getChannelCount(AudioChannelLayout::make<AudioChannelLayout::layoutMask>(

View file

@ -96,7 +96,7 @@ class VirtualizerHelper : public EffectHelper {
static constexpr int kSamplingFrequency = 44100;
static constexpr int kDefaultChannelLayout = AudioChannelLayout::LAYOUT_STEREO;
static constexpr int kDurationMilliSec = 2000;
static constexpr int kDurationMilliSec = 720;
static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000;
int kChannelCount = getChannelCount(
AudioChannelLayout::make<AudioChannelLayout::layoutMask>(kDefaultChannelLayout));

View file

@ -94,7 +94,7 @@ class VolumeControlHelper : public EffectHelper {
}
static constexpr int kSamplingFrequency = 44100;
static constexpr int kDurationMilliSec = 2000;
static constexpr int kDurationMilliSec = 720;
static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000;
static constexpr int kMinLevel = -96;
static constexpr int kDefaultChannelLayout = AudioChannelLayout::LAYOUT_STEREO;
@ -174,7 +174,7 @@ class VolumeDataTest : public ::testing::TestWithParam<VolumeDataTestParam>,
static constexpr int kMaxAudioSample = 1;
static constexpr int kTransitionDuration = 300;
static constexpr int kNPointFFT = 32768;
static constexpr int kNPointFFT = 16384;
static constexpr float kBinWidth = (float)kSamplingFrequency / kNPointFFT;
static constexpr size_t offset = kSamplingFrequency * kTransitionDuration / 1000;
static constexpr float kBaseLevel = 0;