diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-04-11 11:09:48 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-04-11 11:12:11 +0300 |
commit | e917cd9828f63aba27a5647c012d62a85bf0c977 (patch) | |
tree | 807ab8227771c55757a5ab467f89a6655c96464b /libavfilter | |
parent | 5d52c4cbba8daee4c6f752087c1a01ddc9c43eac (diff) |
avfilter/vf_v360: unbreak fov_from_dfov() for (d)fisheye when width != height
Based on patch by Daniel Playfair Cal.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_v360.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c index 87105dbe92..053ea8868e 100644 --- a/libavfilter/vf_v360.c +++ b/libavfilter/vf_v360.c @@ -4078,18 +4078,18 @@ static void fov_from_dfov(int format, float d_fov, float w, float h, float *h_fo break; case DUAL_FISHEYE: { - const float d = 0.5f * hypotf(w * 0.5f, h); + const float d = hypotf(w * 0.5f, h); - *h_fov = d / w * 2.f * d_fov; - *v_fov = d / h * d_fov; + *h_fov = 0.5f * w / d * d_fov; + *v_fov = h / d * d_fov; } break; case FISHEYE: { - const float d = 0.5f * hypotf(w, h); + const float d = hypotf(w, h); - *h_fov = d / w * d_fov; - *v_fov = d / h * d_fov; + *h_fov = w / d * d_fov; + *v_fov = h / d * d_fov; } break; case FLAT: |