History

avfilter/vf_v360: reduce by one cosf call less

Paul B Mahol committed 7 years ago

Commit 451cee61 parent 2a672a91 file · +8 −3Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_v360.c+8−3
@@ -1827,9 +1827,14 @@ static void dfisheye_to_xyz(const V360Context *s, · 1826 unmodified lines
1827 const float phi = M_PI + atan2f(vf, uf * m);1827 const float phi = M_PI + atan2f(vf, uf * m);
1828 const float theta = m * M_PI_2 * (1.f - hypotf(uf, vf));1828 const float theta = m * M_PI_2 * (1.f - hypotf(uf, vf));
1829 1829
1830 vec[0] = cosf(theta) * cosf(phi);1830 const float sin_phi = sinf(phi);
1831 vec[1] = cosf(theta) * sinf(phi);1831 const float cos_phi = cosf(phi);
1832 vec[2] = sinf(theta);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 normalize_vector(vec);1839 normalize_vector(vec);
1835}1840}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t