Loading media/libaudioprocessing/AudioResamplerDyn.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -201,6 +201,8 @@ AudioResamplerDyn<TC, TI, TO>::AudioResamplerDyn( "ro.audio.resampler.psd.stopband", mPropertyStopbandAttenuation); mPropertyCutoffPercent = property_get_int32( "ro.audio.resampler.psd.cutoff_percent", mPropertyCutoffPercent); mPropertyTransitionBandwidthCheat = property_get_int32( "ro.audio.resampler.psd.tbwcheat", mPropertyTransitionBandwidthCheat); } template<typename TC, typename TI, typename TO> Loading Loading @@ -379,9 +381,17 @@ void AudioResamplerDyn<TC, TI, TO>::setSampleRate(int32_t inSampleRate) halfLength = mPropertyHalfFilterLength; stopBandAtten = mPropertyStopbandAttenuation; useS32 = true; // Use either the stopband location for design (tbwCheat) // or use the 3dB cutoff location for design (fcr). // This choice is exclusive and based on whether fcr > 0. if (mPropertyTransitionBandwidthCheat != 0) { tbwCheat = mPropertyTransitionBandwidthCheat / 100.; } else { fcr = mInSampleRate <= mSampleRate ? 0.5 : 0.5 * mSampleRate / mInSampleRate; fcr *= mPropertyCutoffPercent / 100.; } } else { // Voice quality devices have lower sampling rates // (and may be a consequence of downstream AMR-WB / G.722 codecs). Loading media/libaudioprocessing/AudioResamplerDyn.h +7 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,13 @@ private: int32_t mPropertyCutoffPercent = 100; // "ro.audio.resampler.psd.cutoff_percent" // Specify the transition bandwidth extension beyond Nyquist. // If this is nonzero then mPropertyCutoffPercent is ignored. // A value of 100 or greater is typically used, where 100 means the // stopband is at Nyquist (this is a typical design). int32_t mPropertyTransitionBandwidthCheat = 0; // "ro.audio.resampler.psd.tbwcheat" // Filter creation design parameters, see setSampleRate() double mStopbandAttenuationDb = 0.; double mPassbandRippleDb = 0.; Loading Loading
media/libaudioprocessing/AudioResamplerDyn.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -201,6 +201,8 @@ AudioResamplerDyn<TC, TI, TO>::AudioResamplerDyn( "ro.audio.resampler.psd.stopband", mPropertyStopbandAttenuation); mPropertyCutoffPercent = property_get_int32( "ro.audio.resampler.psd.cutoff_percent", mPropertyCutoffPercent); mPropertyTransitionBandwidthCheat = property_get_int32( "ro.audio.resampler.psd.tbwcheat", mPropertyTransitionBandwidthCheat); } template<typename TC, typename TI, typename TO> Loading Loading @@ -379,9 +381,17 @@ void AudioResamplerDyn<TC, TI, TO>::setSampleRate(int32_t inSampleRate) halfLength = mPropertyHalfFilterLength; stopBandAtten = mPropertyStopbandAttenuation; useS32 = true; // Use either the stopband location for design (tbwCheat) // or use the 3dB cutoff location for design (fcr). // This choice is exclusive and based on whether fcr > 0. if (mPropertyTransitionBandwidthCheat != 0) { tbwCheat = mPropertyTransitionBandwidthCheat / 100.; } else { fcr = mInSampleRate <= mSampleRate ? 0.5 : 0.5 * mSampleRate / mInSampleRate; fcr *= mPropertyCutoffPercent / 100.; } } else { // Voice quality devices have lower sampling rates // (and may be a consequence of downstream AMR-WB / G.722 codecs). Loading
media/libaudioprocessing/AudioResamplerDyn.h +7 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,13 @@ private: int32_t mPropertyCutoffPercent = 100; // "ro.audio.resampler.psd.cutoff_percent" // Specify the transition bandwidth extension beyond Nyquist. // If this is nonzero then mPropertyCutoffPercent is ignored. // A value of 100 or greater is typically used, where 100 means the // stopband is at Nyquist (this is a typical design). int32_t mPropertyTransitionBandwidthCheat = 0; // "ro.audio.resampler.psd.tbwcheat" // Filter creation design parameters, see setSampleRate() double mStopbandAttenuationDb = 0.; double mPassbandRippleDb = 0.; Loading