Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-09-20 19:14:41 +0300
committerPaul B Mahol <onemda@gmail.com>2019-09-20 22:08:57 +0300
commitbc89434a0bec1b813bd21fff27abdd6c83936f1f (patch)
tree8212edbc50ea18bfa66cb486b35f166c64863412 /libavfilter/vf_v360.c
parent048c712aa1f5aa3cc0c5325e73cbf166f346dd46 (diff)
avfilter/vf_v360: fix various artifacts with cubemaps
Diffstat (limited to 'libavfilter/vf_v360.c')
-rw-r--r--libavfilter/vf_v360.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 6509a95916..0ec26e67bf 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -1073,8 +1073,8 @@ static void cube3x2_to_xyz(const V360Context *s,
const int ewi = ceilf(ew * (u_face + 1)) - u_shift;
const int ehi = ceilf(eh * (v_face + 1)) - v_shift;
- const float uf = 2.f * (i - u_shift) / ewi - 1.f;
- const float vf = 2.f * (j - v_shift) / ehi - 1.f;
+ const float uf = 2.f * (i - u_shift + 0.5f) / ewi - 1.f;
+ const float vf = 2.f * (j - v_shift + 0.5f) / ehi - 1.f;
cube_to_xyz(s, uf, vf, face, vec);
}
@@ -1114,8 +1114,8 @@ static void xyz_to_cube3x2(const V360Context *s,
ewi = ceilf(ew * (u_face + 1)) - ceilf(ew * u_face);
ehi = ceilf(eh * (v_face + 1)) - ceilf(eh * v_face);
- uf = 0.5f * ewi * (uf + 1.f);
- vf = 0.5f * ehi * (vf + 1.f);
+ uf = 0.5f * ewi * (uf + 1.f) - 0.5f;
+ vf = 0.5f * ehi * (vf + 1.f) - 0.5f;
ui = floorf(uf);
vi = floorf(vf);
@@ -1188,8 +1188,8 @@ static void cube1x6_to_xyz(const V360Context *s,
const int v_shift = ceilf(eh * face);
const int ehi = ceilf(eh * (face + 1)) - v_shift;
- const float uf = 2.f * i / ew - 1.f;
- const float vf = 2.f * (j - v_shift) / ehi - 1.f;
+ const float uf = 2.f * (i + 0.5f) / ew - 1.f;
+ const float vf = 2.f * (j - v_shift + 0.5f) / ehi - 1.f;
cube_to_xyz(s, uf, vf, face, vec);
}
@@ -1216,8 +1216,8 @@ static void cube6x1_to_xyz(const V360Context *s,
const int u_shift = ceilf(ew * face);
const int ewi = ceilf(ew * (face + 1)) - u_shift;
- const float uf = 2.f * (i - u_shift) / ewi - 1.f;
- const float vf = 2.f * j / eh - 1.f;
+ const float uf = 2.f * (i - u_shift + 0.5f) / ewi - 1.f;
+ const float vf = 2.f * (j + 0.5f) / eh - 1.f;
cube_to_xyz(s, uf, vf, face, vec);
}
@@ -1253,8 +1253,8 @@ static void xyz_to_cube1x6(const V360Context *s,
face = s->in_cubemap_face_order[direction];
ehi = ceilf(eh * (face + 1)) - ceilf(eh * face);
- uf = 0.5f * ewi * (uf + 1.f);
- vf = 0.5f * ehi * (vf + 1.f);
+ uf = 0.5f * ewi * (uf + 1.f) - 0.5f;
+ vf = 0.5f * ehi * (vf + 1.f) - 0.5f;
ui = floorf(uf);
vi = floorf(vf);
@@ -1329,8 +1329,8 @@ static void xyz_to_cube6x1(const V360Context *s,
face = s->in_cubemap_face_order[direction];
ewi = ceilf(ew * (face + 1)) - ceilf(ew * face);
- uf = 0.5f * ewi * (uf + 1.f);
- vf = 0.5f * ehi * (vf + 1.f);
+ uf = 0.5f * ewi * (uf + 1.f) - 0.5f;
+ vf = 0.5f * ehi * (vf + 1.f) - 0.5f;
ui = floorf(uf);
vi = floorf(vf);