Message ID | 20210319094512.926746-1-daniel.playfair.cal@gmail.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] vf_v360: fix fov_from_hfov for fisheye projection | expand |
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 |
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:
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@gmail.com> --- libavfilter/vf_v360.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)