summaryrefslogtreecommitdiff
path: root/libavfilter/vf_v360.c
diff options
context:
space:
mode:
authorMichael Koch <astroelectronic@t-online.de>2020-12-04 19:43:26 +0100
committerPaul B Mahol <onemda@gmail.com>2020-12-04 19:50:10 +0100
commitce8f45aaba82a150f72db943d447c1e068c474b0 (patch)
tree3e6a73987ad182872441a9343ad4b0fadd7117df /libavfilter/vf_v360.c
parentdbf8a1639f0e5fee9108e95a6d06c9d39dc9740a (diff)
avfilter/vf_v360: fix several problems with 'perspective' output
The image center wasn't preserved, the output image was mirror reversed, and rotations were made around wrong axes. I did also remove the vector normalization, because it's sure that the vector is already normalized if it's calculated from sin() and cos() terms.
Diffstat (limited to 'libavfilter/vf_v360.c')
-rw-r--r--libavfilter/vf_v360.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 1dcad0ac69..94473cd5b3 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -3133,8 +3133,8 @@ static int perspective_to_xyz(const V360Context *s,
const float cos_theta = cosf(theta);
vec[0] = cos_theta * sin_phi;
- vec[1] = sin_theta;
- vec[2] = cos_theta * cos_phi;
+ vec[1] = cos_theta * cos_phi;
+ vec[2] = sin_theta;
} else {
vec[0] = 0.f;
vec[1] = 1.f;
@@ -3142,7 +3142,6 @@ static int perspective_to_xyz(const V360Context *s,
return 0;
}
- normalize_vector(vec);
return 1;
}