[FFmpeg-cvslog] lavfi/signalstats: Cast the return value of AV_RN16() to int.

Carl Eugen Hoyos git at videolan.org
Thu Dec 13 00:54:50 EET 2018


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Tue Dec 11 03:12:49 2018 +0100| [32601fb82117533ed93c67993c1dc0cd872d0360] | committer: Carl Eugen Hoyos

lavfi/signalstats: Cast the return value of AV_RN16() to int.

It is unsigned at least on arm, fixes the following warnings:
libavfilter/vf_signalstats.c:833:21: warning: taking the absolute value of unsigned type 'unsigned int' has no effect
            dify += abs(yuv - AV_RN16(prev->data[0] + pw + i * 2));

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

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

diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index 298881bc72..2b8c0de4c4 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -830,7 +830,7 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in)
 
             masky |= yuv;
             histy[yuv]++;
-            dify += abs(yuv - AV_RN16(prev->data[0] + pw + i * 2));
+            dify += abs(yuv - (int)AV_RN16(prev->data[0] + pw + i * 2));
         }
         w  += in->linesize[0];
         pw += prev->linesize[0];
@@ -848,9 +848,9 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in)
             masku |= yuvu;
             maskv |= yuvv;
             histu[yuvu]++;
-            difu += abs(yuvu - AV_RN16(prev->data[1] + cpw + i * 2));
+            difu += abs(yuvu - (int)AV_RN16(prev->data[1] + cpw + i * 2));
             histv[yuvv]++;
-            difv += abs(yuvv - AV_RN16(prev->data[2] + cpw + i * 2));
+            difv += abs(yuvv - (int)AV_RN16(prev->data[2] + cpw + i * 2));
 
             histsat[p_sat[i]]++;
             histhue[((int16_t*)p_hue)[i]]++;



More information about the ffmpeg-cvslog mailing list