[FFmpeg-cvslog] avfilter/vf_v360: remove intermediate variables

Paul B Mahol git at videolan.org
Sun Sep 22 15:13:25 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Sep 22 11:29:03 2019 +0200| [79d14a3cc8e9105385044dbe2c4f696f0c9c1c07] | committer: Paul B Mahol

avfilter/vf_v360: remove intermediate variables

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

 libavfilter/vf_v360.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 8339998454..fa28f31ae0 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -1414,11 +1414,8 @@ static int prepare_stereographic_out(AVFilterContext *ctx)
 {
     V360Context *s = ctx->priv;
 
-    const float h_angle = tanf(FFMIN(s->h_fov, 359.f) * M_PI / 720.f);
-    const float v_angle = tanf(FFMIN(s->v_fov, 359.f) * M_PI / 720.f);
-
-    s->flat_range[0] = h_angle;
-    s->flat_range[1] = v_angle;
+    s->flat_range[0] = tanf(FFMIN(s->h_fov, 359.f) * M_PI / 720.f);
+    s->flat_range[1] = tanf(FFMIN(s->v_fov, 359.f) * M_PI / 720.f);
 
     return 0;
 }
@@ -1990,11 +1987,8 @@ static int prepare_flat_out(AVFilterContext *ctx)
 {
     V360Context *s = ctx->priv;
 
-    const float h_angle = 0.5f * s->h_fov * M_PI / 180.f;
-    const float v_angle = 0.5f * s->v_fov * M_PI / 180.f;
-
-    s->flat_range[0] = tanf(h_angle);
-    s->flat_range[1] = tanf(v_angle);
+    s->flat_range[0] = tanf(0.5f * s->h_fov * M_PI / 180.f);
+    s->flat_range[1] = tanf(0.5f * s->v_fov * M_PI / 180.f);
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list