From 0bf612b3ec2fc1d419e3967ce4afd97a28f4786d Mon Sep 17 00:00:00 2001 From: peah Date: Wed, 6 Apr 2016 02:47:46 -0700 Subject: [PATCH] This CL is partially reverting the effects that were added in https://codereview.webrtc.org/1773173002. The reason for the revert is that for some scenarios that CL causes problems in the coherence estimate used in the AEC, which in turn causes echo leakage. The reason for not reverting the actual CL is that it would cause subsequent CLs to be reverted as well. Therefore the choice was made to in this CK instead revert the effects of that CL. With the changes in this CL, the behavior is bitexact to what it was before the CL mentioned above. TBR=aluebs@webrtc.org BUG=webrtc:5725 Review URL: https://codereview.webrtc.org/1867483003 Cr-Commit-Position: refs/heads/master@{#12259} --- data/audio_processing/output_data_fixed.pb | Bin 412 -> 204 bytes data/audio_processing/output_data_float.pb | Bin 2036 -> 2054 bytes data/audio_processing/output_data_mac.pb | Bin 2036 -> 2054 bytes .../audio_processing/audio_processing_impl.cc | 19 ++++++++++-------- .../test/audio_processing_unittest.cc | 8 ++++---- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/data/audio_processing/output_data_fixed.pb b/data/audio_processing/output_data_fixed.pb index ae5b8126b2e262d7d942df5048bebacea91bd604..efc95631ee0cca1c954c938d163dbe9f7a304ba1 100644 GIT binary patch delta 20 ccmbQke1?(f1j9ro(}~$e6E7M~HfJ;h07!BMy#N3J literal 412 zcmbQi$iToQ&cP_aD8Z<3z|NrF;-rWJgU3OZ0EP;LL_;l5;;txA;yy$|0;;3o7b8fE z7*OUtn#^}5pv)tXp3?}!m?W4Wwyc)`N*q9y0NXN85-9NzVHQXS#FiCOK$(|lGGJT& zg7mzG8ODUmFAxc^E%!j~dJZ!SDuM9JCo~x>eqjfS+M+_~KytW~aDjK&3(A z3PK=aK7^nc68slL5WzywQbP~x( zZO-Ckdno-*TGOQ)=vLdiK<5t3gMGJTZYkWdUZbV%k1C=R)ZpLl3pOC|`5HytudqOO z2H+J65j6MJ+xw5gGSmoUHjW?gz(d|pi9XHP_4Hb7A znlGz@xMy(kqbB2iEgNwe;*R`?MIwT@opZm!s={qmBhIl9;+DaCY_OBEYI%?^eOCT6 zD+DP&!pW<;R9do1u^+Qo#D7!@pq?X@#m_v4$B`Rk$AYRa*|n?%una L1^LJ>3@ZE^2d@C+ delta 483 zcmZn@_`=Whfqf#AzW|HCoc~b3D8Z`0GBGiNT}D7gLPkMm;sHfwF$t;38(5Slvoorq z3QGcoWhUFRvg?HF$=g>ja20Ye3NT7ADl~j&GU#Nq_{!_>lF4HiQvgGhGZzO3iji== zOuS8--!m#RPF}&}s+0Oz4rERS&>SWSCa^gjj22r3LFOC;nPUYsM^->qLRLX`@_Hsk zISHU68I(9U7zDT^xD^+GPr1yeARfhvg1ruCI(Fy5KU*9%PrQe1We!7cu ziN+NJtw=$!)y)qUqP+7URf=bv;u=RxGJait^b0QOR#ax%|34|44cd*GsOA zy7b$>aXIxQEyARD* zRYBaBaQ3CG;(n?caRA~@Si%#TK-}IrYw!u_x4IEiJchVc@ByD3q^w&WmJ9E-|H27D z%5yk-+)+vkPAO$6Pi6W?r4Z`bQ0df)R#N9lTY_+*(~H{EvJ2NM{qW%`PkyUC8Kp63 zoVj{@qEDtF+ja20Ye3NT7ADl~j&GU#Nq_{!_>lF4HiQvgGhGZzO3iji== zOuS8--!m#RPF}&}s+0Oz4rERS&>SWSCa^gjj22r3LFOC;nPUYsM^->qLRLX`@_Hsk zISHU68I(9U7zDT^xD^(kSampleRate16kHz)); + if (formats_.api_format.reverse_input_stream().sample_rate_hz() == + kSampleRate32kHz) { + // ...or the input is at 32 kHz, in which case we use the splitting + // filter rather than the resampler. + rev_proc_rate = kSampleRate32kHz; + } } // Always downmix the reverse stream to mono for analysis. This has been @@ -1148,11 +1151,11 @@ bool AudioProcessingImpl::is_rev_processed() const { bool AudioProcessingImpl::rev_synthesis_needed() const { return (is_rev_processed() && - is_multi_band(formats_.rev_proc_format.sample_rate_hz())); + formats_.rev_proc_format.sample_rate_hz() == kSampleRate32kHz); } bool AudioProcessingImpl::rev_analysis_needed() const { - return is_multi_band(formats_.rev_proc_format.sample_rate_hz()) && + return formats_.rev_proc_format.sample_rate_hz() == kSampleRate32kHz && (is_rev_processed() || public_submodules_->echo_cancellation->is_enabled() || public_submodules_->echo_control_mobile->is_enabled() || diff --git a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc index 12f9735337..948c5efd93 100644 --- a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc +++ b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc @@ -2644,8 +2644,8 @@ INSTANTIATE_TEST_CASE_P( CommonFormats, AudioProcessingTest, testing::Values(std::tr1::make_tuple(48000, 48000, 48000, 48000, 0, 0), - std::tr1::make_tuple(48000, 48000, 32000, 48000, 35, 30), - std::tr1::make_tuple(48000, 48000, 16000, 48000, 35, 20), + std::tr1::make_tuple(48000, 48000, 32000, 48000, 40, 30), + std::tr1::make_tuple(48000, 48000, 16000, 48000, 40, 20), std::tr1::make_tuple(48000, 44100, 48000, 44100, 20, 20), std::tr1::make_tuple(48000, 44100, 32000, 44100, 20, 15), std::tr1::make_tuple(48000, 44100, 16000, 44100, 20, 15), @@ -2692,7 +2692,7 @@ INSTANTIATE_TEST_CASE_P( std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), std::tr1::make_tuple(16000, 16000, 48000, 16000, 40, 20), - std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), + std::tr1::make_tuple(16000, 16000, 32000, 16000, 50, 20), std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); #elif defined(WEBRTC_AUDIOPROC_FIXED_PROFILE) @@ -2748,7 +2748,7 @@ INSTANTIATE_TEST_CASE_P( std::tr1::make_tuple(16000, 32000, 32000, 32000, 25, 0), std::tr1::make_tuple(16000, 32000, 16000, 32000, 25, 20), std::tr1::make_tuple(16000, 16000, 48000, 16000, 35, 20), - std::tr1::make_tuple(16000, 16000, 32000, 16000, 35, 20), + std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); #endif