diff mbox

[FFmpeg-devel] avfilter/vf_geq: Use av_clipd() instead of av_clipf()

Message ID 20191012115521.24619-1-michael@niedermayer.cc
State Accepted
Commit c8813b1a984714f0027cabeea2394035df20cf38
Headers show

Commit Message

Michael Niedermayer Oct. 12, 2019, 11:55 a.m. UTC
With floats we cannot represent all 32bit integer dimensions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_geq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paul B Mahol Oct. 12, 2019, 12:28 p.m. UTC | #1
lgtm

On 10/12/19, Michael Niedermayer <michael@niedermayer.cc> wrote:
> With floats we cannot represent all 32bit integer dimensions
>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_geq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
> index 91eb9685f9..8b1c7726dc 100644
> --- a/libavfilter/vf_geq.c
> +++ b/libavfilter/vf_geq.c
> @@ -88,8 +88,8 @@ static inline double getpix(void *priv, double x, double
> y, int plane)
>      if (!src)
>          return 0;
>
> -    xi = x = av_clipf(x, 0, w - 2);
> -    yi = y = av_clipf(y, 0, h - 2);
> +    xi = x = av_clipd(x, 0, w - 2);
> +    yi = y = av_clipd(y, 0, h - 2);
>
>      x -= xi;
>      y -= yi;
> --
> 2.23.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Michael Niedermayer Oct. 13, 2019, 9:52 p.m. UTC | #2
On Sat, Oct 12, 2019 at 02:28:03PM +0200, Paul B Mahol wrote:
> lgtm

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavfilter/vf_geq.c b/libavfilter/vf_geq.c
index 91eb9685f9..8b1c7726dc 100644
--- a/libavfilter/vf_geq.c
+++ b/libavfilter/vf_geq.c
@@ -88,8 +88,8 @@  static inline double getpix(void *priv, double x, double y, int plane)
     if (!src)
         return 0;
 
-    xi = x = av_clipf(x, 0, w - 2);
-    yi = y = av_clipf(y, 0, h - 2);
+    xi = x = av_clipd(x, 0, w - 2);
+    yi = y = av_clipd(y, 0, h - 2);
 
     x -= xi;
     y -= yi;