From patchwork Mon Dec 30 13:54:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 17069 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B9C3E449AE8 for ; Mon, 30 Dec 2019 15:54:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A179B68AC9C; Mon, 30 Dec 2019 15:54:51 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpproxy21.qq.com (smtpbg704.qq.com [203.205.195.105]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8020A68ABE7 for ; Mon, 30 Dec 2019 15:54:43 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1577714071; bh=hoJutmw3nTBDh4bUvn7LfW57kcRT178dfnsICaMUVxY=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=PdocjSJo86ntx8nEOP9JbOIv62+R7Aj8m3C1tbd5zaAm3DBJ2sFZoPDhpl+CDNAnW +i5tjEyQHoK3XoRjHCTv92SdwzB684wdLodgZn+Ziu4ZXSyooYR/hWHP+X3e0FEoYG pAzvAkBqCyYX6h3PzkMPpTcnulNRm4zUCN03y0lI= X-QQ-mid: esmtp3t1577714070te6pxrs7x Received: from ZHILIZHAO-MB1.tencent.com (unknown [14.17.22.54]) by esmtp4.qq.com (ESMTP) with id ; Mon, 30 Dec 2019 21:54:30 +0800 (CST) X-QQ-SSF: 01000000000000N0WG4000000000002 X-QQ-FEAT: UcX0e83sQ0jceLuEWEghfr6riLPdqV8hwdSPVhsMhddDvdWRnryKrQsZpxfgB MK89y427c7btyS62jjQfeMoxTkZqklZruYAhGy7uAVhO0mJmlKkaq4yVDP4LXNx2NgVeMXk kFxD2UW9Jf4gjnTxhSP8Gj9JxekrfP0nvHatvP1DpyNH1SKpyoc5iPDJKl2Knoa/6br7kLq DRogVk9GGQY++8/MzuptkvqnmEPmjMd8TLCDKeJkKboHfC+vkeoWpt09pJJPVLwyvrzTrdq bbmawe87Z9Qtf1j0eSOnt1DaVGmMD+oXCt+Q== X-QQ-GoodBg: 0 From: quinkblack@foxmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 30 Dec 2019 21:54:16 +0800 Message-Id: <20191230135419.56529-5-quinkblack@foxmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20191230135419.56529-1-quinkblack@foxmail.com> References: <20191230135419.56529-1-quinkblack@foxmail.com> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:foxmail.com:bgforeign:bgforeign11 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH 5/8] swscale/utils: remove access of AV_PIX_FMT_NB 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Zhao Zhili --- libswscale/utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 57c4fd2b0f..c915cf0fca 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -95,7 +95,7 @@ typedef struct FormatEntry { uint8_t is_supported_endianness :1; } FormatEntry; -static const FormatEntry format_entries[AV_PIX_FMT_NB] = { +static const FormatEntry format_entries[] = { [AV_PIX_FMT_YUV420P] = { 1, 1 }, [AV_PIX_FMT_YUYV422] = { 1, 1 }, [AV_PIX_FMT_RGB24] = { 1, 1 }, @@ -270,19 +270,19 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { int sws_isSupportedInput(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < AV_PIX_FMT_NB ? + return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ? format_entries[pix_fmt].is_supported_in : 0; } int sws_isSupportedOutput(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < AV_PIX_FMT_NB ? + return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ? format_entries[pix_fmt].is_supported_out : 0; } int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < AV_PIX_FMT_NB ? + return (unsigned)pix_fmt < FF_ARRAY_ELEMS(format_entries) ? format_entries[pix_fmt].is_supported_endianness : 0; }