From patchwork Fri Feb 17 00:59:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 2587 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2752025vsb; Thu, 16 Feb 2017 16:59:24 -0800 (PST) X-Received: by 10.28.92.193 with SMTP id q184mr187489wmb.139.1487293164384; Thu, 16 Feb 2017 16:59:24 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k188si173559wma.76.2017.02.16.16.59.23; Thu, 16 Feb 2017 16:59:24 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C8A5C689230; Fri, 17 Feb 2017 02:59:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-3.mx.upcmail.net (vie01a-dmta-pe02-3.mx.upcmail.net [62.179.121.159]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 91720680A98 for ; Fri, 17 Feb 2017 02:59:08 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1ceWtG-00073s-BU for ffmpeg-devel@ffmpeg.org; Fri, 17 Feb 2017 01:59:14 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id lcz91u00P0S5wYM01czAbp; Fri, 17 Feb 2017 01:59:10 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 17 Feb 2017 01:59:08 +0100 Message-Id: <20170217005908.3727-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] fate/source: Check for cases that could use av_clip_uintp2() and av_clip_intp2() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- tests/fate/source-check.sh | 14 ++++++++++++++ tests/ref/fate/source | 2 ++ 2 files changed, 16 insertions(+) diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh index ac2878d9f7..72e1511f0d 100755 --- a/tests/fate/source-check.sh +++ b/tests/fate/source-check.sh @@ -30,4 +30,18 @@ for f in `git ls-files | grep '\.h$'` ; do grep -L "^#define $macro$" $f done +echo "Use of av_clip() where av_clip_uintp2 could be used:" +git grep -E 'av_clip *\(.*, *0 *, *(3|7|15|31|63|127|255|511|1023|2047|4095|8191|'\ +'16383|32767|65535|131071|262143|524287|1048575|2097151|4194303|8388607|16777215|'\ +'33554431|67108863|134217727|268435455|536870911|1073741823) *\)' | grep -v fate/source + +echo "Use of av_clip() where av_clip_intp2 could be used:" +git grep -E 'av_clip *\(.*, *(-2 *, *1|-4 *, *3|-8 *, *7|-16 *, *15|-32 *, *31|-64'\ +' *, *63|-128 *, *127|-256 *, *255|-512 *, *511|-1024 *, *1023|-2048 *, *2047|-4096'\ +' *, *4095|-8192 *, *8191|-16384 *, *16383|-32768 *, *32767|-65536 *, *65535|-131072'\ +' *, *131071|-262144 *, *262143|-524288 *, *524287|-1048576 *, *1048575|-2097152 *,'\ +' *2097151|-4194304 *, *4194303|-8388608 *, *8388607|-16777216 *, *16777215|-33554432'\ +' *, *33554431|-67108864 *, *67108863|-134217728 *, *134217727|-268435456 *, *'\ +'268435455|-536870912 *, *536870911|-1073741824 *, *1073741823) *\)'| grep -v fate/source + exit 0 diff --git a/tests/ref/fate/source b/tests/ref/fate/source index 67906d1198..6a8f12f815 100644 --- a/tests/ref/fate/source +++ b/tests/ref/fate/source @@ -31,3 +31,5 @@ compat/cuda/dynlink_nvcuvid.h compat/float/float.h compat/float/limits.h compat/nvenc/nvEncodeAPI.h +Use of av_clip() where av_clip_uintp2 could be used: +Use of av_clip() where av_clip_intp2 could be used: