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-13 12:31:11 +0300
committerPaul B Mahol <onemda@gmail.com>2019-09-13 12:31:11 +0300
commit2b3094d61de80dc029f66d4a78e75c1963076a5a (patch)
treea828928a9111158087487abc980e9ae238734488 /libavfilter/vf_v360.c
parent09933279396ed78e9ebbd44b587878d3ae772b3b (diff)
avfilter/vf_v360: fix flat projection field of view calculation
Diffstat (limited to 'libavfilter/vf_v360.c')
-rw-r--r--libavfilter/vf_v360.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 552cb24581..098bc07ef5 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -1777,14 +1777,9 @@ static int prepare_flat_out(AVFilterContext *ctx)
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;
- const float sin_phi = sinf(h_angle);
- const float cos_phi = cosf(h_angle);
- const float sin_theta = sinf(v_angle);
- const float cos_theta = cosf(v_angle);
-
- s->flat_range[0] = cos_theta * sin_phi;
- s->flat_range[1] = sin_theta;
- s->flat_range[2] = -cos_theta * cos_phi;
+ s->flat_range[0] = tan(h_angle);
+ s->flat_range[1] = tan(v_angle);
+ s->flat_range[2] = -1.f;
return 0;
}