diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-03-01 11:24:31 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-03-01 11:24:31 +0100 |
commit | 1281399135a872c742b97a006eef9076cbebfa6d (patch) | |
tree | 9f78946117ed8be0878f388cff736bc603698676 /libavfilter | |
parent | db8146f4dd6f722659ed906938088e012d98fa3a (diff) | |
download | ffmpeg-1281399135a872c742b97a006eef9076cbebfa6d.tar.gz |
avfilter/vf_v360: fix cylindrical input format
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_v360.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c index e1754624cd..e6984e703a 100644 --- a/libavfilter/vf_v360.c +++ b/libavfilter/vf_v360.c @@ -2641,10 +2641,10 @@ static int xyz_to_cylindrical(const V360Context *s, int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) { const float phi = atan2f(vec[0], -vec[2]) * s->input_mirror_modifier[0] / s->iflat_range[0]; - const float theta = atan2f(-vec[1], hypotf(vec[0], vec[2])) * s->input_mirror_modifier[1] / s->iflat_range[1]; + const float theta = asinf(-vec[1]) * s->input_mirror_modifier[1]; const float uf = (phi + 1.f) * (width - 1) / 2.f; - const float vf = (tanf(theta) + 1.f) * height / 2.f; + const float vf = (tanf(theta) / s->iflat_range[1] + 1.f) * height / 2.f; const int ui = floorf(uf); const int vi = floorf(vf); |