diff mbox series

[FFmpeg-devel,3/4] avfilter/vf_v360: fix visibility test for fisheye

Message ID 20210321124414.1223626-3-daniel.playfair.cal@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/4] avfilter/vf_v360: fix fov_from_hfov for fisheye
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Daniel Playfair Cal March 21, 2021, 12:44 p.m. UTC
Previously the visibility test referred to a circle in the input. This
changes it so that it refers accurately to the entire area in the input.

Signed-off-by: Daniel Playfair Cal <daniel.playfair.cal@gmail.com>
---
 libavfilter/vf_v360.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index be886e9bb1..68bb2f7b0f 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -2887,7 +2887,7 @@  static int xyz_to_fisheye(const V360Context *s,
     float uf = vec[0] / lh * phi / s->iflat_range[0];
     float vf = vec[1] / lh * phi / s->iflat_range[1];
 
-    const int visible = hypotf(uf, vf) <= 0.5f;
+    const int visible = -0.5f < uf && uf < 0.5f && -0.5f < vf && vf < 0.5f;
     int ui, vi;
 
     uf = (uf + 0.5f) * width;