From patchwork Sun Mar 19 14:33:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= X-Patchwork-Id: 3017 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.50.79 with SMTP id y76csp1037926vsy; Sun, 19 Mar 2017 07:34:30 -0700 (PDT) X-Received: by 10.28.133.203 with SMTP id h194mr6327885wmd.122.1489934070062; Sun, 19 Mar 2017 07:34:30 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g78si15460567wme.3.2017.03.19.07.34.29; Sun, 19 Mar 2017 07:34:30 -0700 (PDT) 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 406EF6883BD; Sun, 19 Mar 2017 16:33:46 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from golem.pkh.me (LStLambert-657-1-117-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A0D40688329 for ; Sun, 19 Mar 2017 16:33:38 +0200 (EET) Received: from localhost (golem.pkh.me [local]) by golem.pkh.me (OpenSMTPD) with ESMTPA id 1359a4c1; Sun, 19 Mar 2017 14:33:46 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 Mar 2017 15:33:42 +0100 Message-Id: <20170319143343.7298-5-u@pkh.me> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170319143343.7298-1-u@pkh.me> References: <20170319143343.7298-1-u@pkh.me> Subject: [FFmpeg-devel] [PATCH 4/5] swscale: use a function for isAnyRGB 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 Cc: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libswscale/swscale_internal.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index b3bb1695fb..9a28d180f1 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -767,13 +767,13 @@ static av_always_inline int isBayer(enum AVPixelFormat pix_fmt) return !strncmp(desc->name, "bayer_", 6); } -#define isAnyRGB(x) \ - ( \ - isBayer(x) || \ - isRGBinInt(x) || \ - isBGRinInt(x) || \ - isRGB(x) \ - ) +static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->flags & AV_PIX_FMT_FLAG_RGB) || + pix_fmt == AV_PIX_FMT_MONOBLACK || pix_fmt == AV_PIX_FMT_MONOWHITE; +} static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt) {