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

Unified Diff: webrtc/modules/audio_processing/beamformer/array_util.h

Issue 1211703002: Created SphericalPoint in array_util.h (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changed distance to radius Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/beamformer/array_util.h
diff --git a/webrtc/modules/audio_processing/beamformer/array_util.h b/webrtc/modules/audio_processing/beamformer/array_util.h
index 8d1cda783ab435e235d3eab0acb3032aa802309b..f7598c0b5d2f7268c95a771ef65e52ce7d63d7c6 100644
--- a/webrtc/modules/audio_processing/beamformer/array_util.h
+++ b/webrtc/modules/audio_processing/beamformer/array_util.h
@@ -23,19 +23,13 @@ struct CartesianPoint {
c[1] = y;
c[2] = z;
}
- T x() const {
- return c[0];
- }
- T y() const {
- return c[1];
- }
- T z() const {
- return c[2];
- }
+ T x() const { return c[0]; }
+ T y() const { return c[1]; }
+ T z() const { return c[2]; }
T c[3];
};
-typedef CartesianPoint<float> Point;
+using Point = CartesianPoint<float>;
template<typename T>
float Distance(CartesianPoint<T> a, CartesianPoint<T> b) {
@@ -44,6 +38,21 @@ float Distance(CartesianPoint<T> a, CartesianPoint<T> b) {
(a.z() - b.z()) * (a.z() - b.z()));
}
+template <typename T>
+struct SphericalPoint {
+ SphericalPoint(T azimuth, T elevation, T radius) {
+ s[0] = azimuth;
+ s[1] = elevation;
+ s[2] = radius;
+ }
+ T azimuth() const { return s[0]; }
+ T elevation() const { return s[1]; }
+ T distance() const { return s[2]; }
+ T s[3];
+};
+
+using SphericalPointf = SphericalPoint<float>;
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_ARRAY_UTIL_H_
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698