Browse Source

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.
tags/n4.4
Michael Koch Paul B Mahol 4 years ago
parent
commit
ce8f45aaba
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      libavfilter/vf_v360.c

+ 2
- 3
libavfilter/vf_v360.c View File

@@ -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;
}



Loading…
Cancel
Save