Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-09-14 18:40:46 +0300
committerPaul B Mahol <onemda@gmail.com>2019-09-14 18:40:46 +0300
commit451cee662c379489f6f3ddeef6561aa201aa51b0 (patch)
treeb6ffaafa032fa9f56001b5ca51fc5d8454682d86 /libavfilter
parent2a672a93d248afc2e9199cef50930c598ff34ad5 (diff)
avfilter/vf_v360: reduce by one cosf call less
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_v360.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 39a96f1941..3be302d159 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -1827,9 +1827,14 @@ static void dfisheye_to_xyz(const V360Context *s,
const float phi = M_PI + atan2f(vf, uf * m);
const float theta = m * M_PI_2 * (1.f - hypotf(uf, vf));
- vec[0] = cosf(theta) * cosf(phi);
- vec[1] = cosf(theta) * sinf(phi);
- vec[2] = sinf(theta);
+ const float sin_phi = sinf(phi);
+ const float cos_phi = cosf(phi);
+ const float sin_theta = sinf(theta);
+ const float cos_theta = cosf(theta);
+
+ vec[0] = cos_theta * cos_phi;
+ vec[1] = cos_theta * sin_phi;
+ vec[2] = sin_theta;
normalize_vector(vec);
}