[FFmpeg-devel] [PATCH] vf_v360: fix fov_from_hfov for fisheye projection
Daniel Playfair Cal
daniel.playfair.cal at gmail.com
Fri Mar 19 11:54:19 EET 2021
This was previously incorrect, so that passing only id_fov or d_fov
resulted in incorrect transformation.
Signed-off-by: Daniel Playfair Cal <daniel.playfair.cal at gmail.com>
---
libavfilter/vf_v360.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 94473cd5b3..425f04da94 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -4045,10 +4045,10 @@ static void fov_from_dfov(int format, float d_fov, float w, float h, float *h_fo
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:
--
2.31.0
More information about the ffmpeg-devel
mailing list