History

avfilter/vf_v360: fix some small nits

Paul B Mahol committed 6 years ago

Commit 3972ec21 parent aa42a1e1 file · +8 −9Browse files

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

Unified · Split

libavfilter/vf_v360.c+8−9
@@ -2215,12 +2215,12 @@ static void pannini_to_xyz(const V360Context *s, · 2214 unmodified lines
22152215 const float vf = ((2.f * j) / height - 1.f);
22162216
22172217 const float d = s->h_fov;
2218− float k = uf * uf / ((d + 1.f) * (d + 1.f));
2219− float dscr = k * k * d * d - (k + 1) * (k * d * d - 1.f);
2220− float clon = (-k * d + sqrtf(dscr)) / (k + 1.f);
2221− float S = (d + 1.f) / (d + clon);
2222− float lon = -(M_PI + atan2f(uf, S * clon));
2223− float lat = -atan2f(vf, S);
2218+ const float k = uf * uf / ((d + 1.f) * (d + 1.f));
2219+ const float dscr = k * k * d * d - (k + 1.f) * (k * d * d - 1.f);
2220+ const float clon = (-k * d + sqrtf(dscr)) / (k + 1.f);
2221+ const float S = (d + 1.f) / (d + clon);
2222+ const float lon = -(M_PI + atan2f(uf, S * clon));
2223+ const float lat = -atan2f(vf, S);
22242224
22252225 vec[0] = sinf(lon) * cosf(lat);
22262226 vec[1] = sinf(lat);
@@ -2516,7 +2516,7 @@ static void multiply_matrix(float c[3][3], const float a[3][3], const float b[3] · 289 unmodified lines
25162516 {
25172517 for (int i = 0; i < 3; i++) {
25182518 for (int j = 0; j < 3; j++) {
2519− float sum = 0;
2519+ float sum = 0.f;
25202520
25212521 for (int k = 0; k < 3; k++)
25222522 sum += a[i][k] * b[k][j];
@@ -3046,9 +3046,8 @@ static int config_output(AVFilterLink *outlink) · 523 unmodified lines
30463046 s->map[0] = s->map[1] = s->map[2] = s->map[3] = 0;
30473047 } else {
30483048 s->nb_allocated = 2;
3049− s->map[0] = 0;
3049+ s->map[0] = s->map[3] = 0;
30503050 s->map[1] = s->map[2] = 1;
3051− s->map[3] = 0;
30523051 }
30533052
30543053 for (int i = 0; i < s->nb_allocated; i++)

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