Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -1827,9 +1827,14 @@ static void dfisheye_to_xyz(const V360Context *s, · 1826 unmodified lines | ||
| 1827 | 1827 | const float phi = M_PI + atan2f(vf, uf * m); |
| 1828 | 1828 | const float theta = m * M_PI_2 * (1.f - hypotf(uf, vf)); |
| 1829 | 1829 | |
| 1830 | − vec[0] = cosf(theta) * cosf(phi); | |
| 1831 | − vec[1] = cosf(theta) * sinf(phi); | |
| 1832 | − vec[2] = sinf(theta); | |
| 1830 | + const float sin_phi = sinf(phi); | |
| 1831 | + const float cos_phi = cosf(phi); | |
| 1832 | + const float sin_theta = sinf(theta); | |
| 1833 | + const float cos_theta = cosf(theta); | |
| 1834 | + | |
| 1835 | + vec[0] = cos_theta * cos_phi; | |
| 1836 | + vec[1] = cos_theta * sin_phi; | |
| 1837 | + vec[2] = sin_theta; | |
| 1833 | 1838 | |
| 1834 | 1839 | normalize_vector(vec); |
| 1835 | 1840 | } |