[FFmpeg-cvslog] avfilter/vf_v360: speedup fisheye output

Paul B Mahol git at videolan.org
Sun Mar 29 14:28:37 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Mar 29 13:07:35 2020 +0200| [85025162dac9efcb07ed7528cbd248337bad912c] | committer: Paul B Mahol

avfilter/vf_v360: speedup fisheye output

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85025162dac9efcb07ed7528cbd248337bad912c
---

 libavfilter/vf_v360.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 66e3f09f6d..75f512e242 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -2531,9 +2531,14 @@ static int fisheye_to_xyz(const V360Context *s,
     const float phi   = atan2f(vf, uf);
     const float theta = 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);
 



More information about the ffmpeg-cvslog mailing list