aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-04-11 10:09:48 +0200
committerPaul B Mahol <onemda@gmail.com>2021-04-11 10:12:11 +0200
commite917cd9828f63aba27a5647c012d62a85bf0c977 (patch)
tree807ab8227771c55757a5ab467f89a6655c96464b
parent5d52c4cbba8daee4c6f752087c1a01ddc9c43eac (diff)
downloadffmpeg-e917cd9828f63aba27a5647c012d62a85bf0c977.tar.gz
avfilter/vf_v360: unbreak fov_from_dfov() for (d)fisheye when width != height
Based on patch by Daniel Playfair Cal.
-rw-r--r--libavfilter/vf_v360.c12
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: