Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: media/base/vector_math.cc

Issue 156783003: Enhance AudioSplicer to crossfade marked splice frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve comments. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« media/base/audio_splicer.cc ('K') | « media/base/vector_math.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/vector_math.cc
diff --git a/media/base/vector_math.cc b/media/base/vector_math.cc
index 32584f5cf64ad2a1ecf400cbccd8f9341851cfa4..eec3f652da6d358ba8ab01955fc8958052776f0c 100644
--- a/media/base/vector_math.cc
+++ b/media/base/vector_math.cc
@@ -202,5 +202,14 @@ std::pair<float, float> EWMAAndMaxPower_NEON(
}
#endif
+
+// TODO(dalecurtis): Add SIMD versions and performance tests.
+void Crossfade(const float src[], int len, float dest[]) {
+ float cf_ratio = 0;
+ const float cf_increment = 1.0f / len;
+ for (int i = 0; i < len; ++i, cf_ratio += cf_increment)
+ dest[i] = (1.0f - cf_ratio) * src[i] + cf_ratio * dest[i];
+}
+
} // namespace vector_math
} // namespace media
« media/base/audio_splicer.cc ('K') | « media/base/vector_math.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698