]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_v360: fix small artifacts between corners in EAC format
authorPaul B Mahol <onemda@gmail.com>
Sat, 21 Sep 2019 08:31:59 +0000 (10:31 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sat, 21 Sep 2019 08:31:59 +0000 (10:31 +0200)
libavfilter/vf_v360.c

index 11fdd0061f32865f9fd6da29b3ebc224ff93ac11..8af7985435e009f9c988c09477230e4f1ce446b7 100644 (file)
@@ -1768,8 +1768,8 @@ static void eac_to_xyz(const V360Context *s,
 
     float l_x, l_y, l_z;
 
-    float uf = (float)i / width;
-    float vf = (float)j / height;
+    float uf = (i + 0.5f) / width;
+    float vf = (j + 0.5f) / height;
 
     // EAC has 2-pixel padding on faces except between faces on the same row
     // Padding pixels seems not to be stretched with tangent as regular pixels
@@ -1888,6 +1888,9 @@ static void xyz_to_eac(const V360Context *s,
     uf *= width;
     vf *= height;
 
+    uf -= 0.5f;
+    vf -= 0.5f;
+
     ui = floorf(uf);
     vi = floorf(vf);