From patchwork Fri Dec 24 03:08:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rcombs X-Patchwork-Id: 32879 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp7804927iog; Thu, 23 Dec 2021 19:10:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ5MfoJulqoJ5TxGUhXzVutWNmE6ch/P5mJ7d/n8uuo7YVyR2B1hsdSm49Yn/ccxJcgooT X-Received: by 2002:a05:6402:d05:: with SMTP id eb5mr4334439edb.345.1640315417482; Thu, 23 Dec 2021 19:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640315417; cv=none; d=google.com; s=arc-20160816; b=ovSSuhqDEFwaaHFpvtZQZUoeIawAaSA+3pgMCnlWhS7zhneNgDhp2kvwMzsjRl7FQc 3ujG6f10ZEK0IOSLEgIjY4Js1xtH4L9kEaWaOhmUNngPxoOlrnTgHcZ1uRq0ABlNYUQ2 vHivuyc5XSJuk/CgLcLdV+POKN8SdvoibL4ZgSfQhZU9WjwfNe7G4DDrr+tr2PaHaqem 5WRIDD51JJUSaRjUp53mEWd6tUMk+nHBev2mSMCcWVX5hzVIETRyFlJ5xulLKXbd5rIX ySOpTp8KJ2nUi797QP8HzFF9dYLqzN6lj58OOO1r3z0Pdgf/kP+ne5u/MOC2JwBl8Uun ivbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=iaOz7MXEcHYHyqmFUDL6Hh9WIysuE45ExLhm3qllJ5M=; b=RDwD4lK/1ZaPSu1xAOrFuEnKHXezT69cu17bW6y8bgMccBvQBTq9b561KfB0VRHaGE IiJfvnG4at5setXX8N2Uk4g19bNxdzFQj1rk6/Tt8sqLfYf9JcYkOlBoS7SLkhp5AH4V nsiCQys2QEkCiNFWdptZb8Xr519PkGYbZlMCtOvX+/8Gib46ZEOFyDyfXu3eZSnOv19r lPqP1dauu/fw2kOlejcMOKOM9QT27+pNojZdqpX5sInGCjX9lC+2Po2++qoD6wD6raPA O5G3BYgz5KstgrqBQY4q4YTdABg5Fy366e/aleXZOyNQXNGLhJPjahPJKojWLazSxtb/ 9bXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rcombs.me header.s=google header.b=d9oGnCFB; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=rcombs.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l25si3006024eda.5.2021.12.23.19.10.17; Thu, 23 Dec 2021 19:10:17 -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; dkim=neutral (body hash did not verify) header.i=@rcombs.me header.s=google header.b=d9oGnCFB; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=rcombs.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1D8B568B1E5; Fri, 24 Dec 2021 05:09:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E1FA168B1CE for ; Fri, 24 Dec 2021 05:09:18 +0200 (EET) Received: by mail-qt1-f170.google.com with SMTP id l17so6607500qtk.7 for ; Thu, 23 Dec 2021 19:09:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rcombs.me; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=y0NY4yMaFlJj3ZLOYBYpLsfzrYVYg8aX5X1FWktAGHc=; b=d9oGnCFBX3+zasYOT/I0u+K28yQjmSv5OvDRhT9g9WokZWBfMfevGKDiW7mhQI1w3c 2j5DMGCw6MCqdEWgDiOcrMnFSL9PcO+oH9T8jyP/0lMw7MnocICwTR3T/KIfmj7/QsMj bWLZrmHds5ZuxT8U3CpQ4uIwLqKl5YlLMCDG75jg4fmDeo1JdtDiJN46U8UC4pRnTX57 e7kqlyfUhX3rJaB6p4w16sQRYuEzkoPEsTQQCw2YCqM44T5MuL1y1UNGsO5IatN719SE tHZ0nGxhMNTjYlBZ+3BjMOIp+4tXg0uCgOrGF9Z67SVky83URaT3nBNnOnHk2RL4OR+D Bqqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y0NY4yMaFlJj3ZLOYBYpLsfzrYVYg8aX5X1FWktAGHc=; b=k7lKzkfzFNJufBrrmnG5iGwxOIRY8BdYB6wbG12P8fB/Clw8fDnMHBrGp+u1keKQap VGbeB9AMMF1ksnvvtIHBEJjDs2jd9s7+VcUBFNSIc6TWvaNSmybqR7Wd5+Ys6NXL78V5 71p2FVWEXtQG6twwXIucl8D18LN2IPNH+2djjSmPewyTzBRJ7npuAADaLFL+txaROc+f uLvzzR/iMX21BB97vLUTQCIWQ3JBzAfFe3N+dr+Kn8oEPMsat5E571efKRTKVe0Ix/CI Df0gVaQhSjEP1i4LLDcJpiPfC1YFo/W8agurATyOCL5G69N1OfyevnqB14z+MjWoLt7V CJWw== X-Gm-Message-State: AOAM531Y+UuYQPV2apXqIlZrQJxhLj6Qc2jAyfmGMRgIvyNaT9u5x8Fn zpaVDpOKBRGIWirGWhnkycsdXf8B1AnANGU= X-Received: by 2002:ac8:41d3:: with SMTP id o19mr4238956qtm.292.1640315357421; Thu, 23 Dec 2021 19:09:17 -0800 (PST) Received: from rcombs-mbp.localdomain ([2601:243:2000:5ac:cd8d:58a:de7b:88f1]) by smtp.gmail.com with ESMTPSA id e15sm5162479qtq.83.2021.12.23.19.09.16 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 19:09:17 -0800 (PST) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Dec 2021 21:08:52 -0600 Message-Id: <20211224030904.1196-5-rcombs@rcombs.me> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211224030904.1196-1-rcombs@rcombs.me> References: <20211224030904.1196-1-rcombs@rcombs.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/16] swscale/output: use isDataInHighBits for 10-bit case X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rRfy+U+THFbZ This code will need fleshing-out (probably templating) if we ever add e.g. a P012 format. --- libswscale/output.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index e43eb7835e..7cedb145aa 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -2597,9 +2597,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, enum AVPixelFormat dstFormat = c->dstFormat; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat); - if (dstFormat == AV_PIX_FMT_P010LE || dstFormat == AV_PIX_FMT_P010BE || - dstFormat == AV_PIX_FMT_P210LE || dstFormat == AV_PIX_FMT_P210BE || - dstFormat == AV_PIX_FMT_P410LE || dstFormat == AV_PIX_FMT_P410BE) { + if (isSemiPlanarYUV(dstFormat) && isDataInHighBits(dstFormat)) { + av_assert0(desc->comp[0].depth == 10); *yuv2plane1 = isBE(dstFormat) ? yuv2p010l1_BE_c : yuv2p010l1_LE_c; *yuv2planeX = isBE(dstFormat) ? yuv2p010lX_BE_c : yuv2p010lX_LE_c; *yuv2nv12cX = isBE(dstFormat) ? yuv2p010cX_BE_c : yuv2p010cX_LE_c;