[FFmpeg-cvslog] avfilter/vf_v360: use lrintf() in kernel

Paul B Mahol git at videolan.org
Sat Sep 21 12:03:23 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Sep 21 10:45:15 2019 +0200| [76f861bbb7560dde4d135b7f9c55d1f266d237a4] | committer: Paul B Mahol

avfilter/vf_v360: use lrintf() in kernel

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76f861bbb7560dde4d135b7f9c55d1f266d237a4
---

 libavfilter/vf_v360.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c
index 8af7985435..4f7d22f11e 100644
--- a/libavfilter/vf_v360.c
+++ b/libavfilter/vf_v360.c
@@ -353,10 +353,10 @@ static void bilinear_kernel(float du, float dv, const XYRemap *rmap,
         }
     }
 
-    ker[0] = (1.f - du) * (1.f - dv) * 16385;
-    ker[1] =        du  * (1.f - dv) * 16385;
-    ker[2] = (1.f - du) *        dv  * 16385;
-    ker[3] =        du  *        dv  * 16385;
+    ker[0] = lrintf((1.f - du) * (1.f - dv) * 16385.f);
+    ker[1] = lrintf(       du  * (1.f - dv) * 16385.f);
+    ker[2] = lrintf((1.f - du) *        dv  * 16385.f);
+    ker[3] = lrintf(       du  *        dv  * 16385.f);
 }
 
 /**
@@ -399,7 +399,7 @@ static void bicubic_kernel(float du, float dv, const XYRemap *rmap,
         for (int j = 0; j < 4; j++) {
             u[i * 4 + j] = rmap->u[i][j];
             v[i * 4 + j] = rmap->v[i][j];
-            ker[i * 4 + j] = du_coeffs[j] * dv_coeffs[i] * 16385;
+            ker[i * 4 + j] = lrintf(du_coeffs[j] * dv_coeffs[i] * 16385.f);
         }
     }
 }
@@ -452,7 +452,7 @@ static void lanczos_kernel(float du, float dv, const XYRemap *rmap,
         for (int j = 0; j < 4; j++) {
             u[i * 4 + j] = rmap->u[i][j];
             v[i * 4 + j] = rmap->v[i][j];
-            ker[i * 4 + j] = du_coeffs[j] * dv_coeffs[i] * 16385;
+            ker[i * 4 + j] = lrintf(du_coeffs[j] * dv_coeffs[i] * 16385.f);
         }
     }
 }



More information about the ffmpeg-cvslog mailing list