From patchwork Thu Oct 26 12:19:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44361 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp586452pzb; Thu, 26 Oct 2023 05:19:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsbyEZQuPQ0k3PGL0L9t9LIm75h5BiaCwLSHEirosbU6xgJ61mXUdKW4/hE0Qw6uCAb5pc X-Received: by 2002:a05:6402:50ca:b0:53d:a6e3:3fd with SMTP id h10-20020a05640250ca00b0053da6e303fdmr14856915edb.2.1698322788201; Thu, 26 Oct 2023 05:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698322788; cv=none; d=google.com; s=arc-20160816; b=dr4PAsRahg9ge0XEhtqnMZVR82kpM1tZqnxt6lFihnTdDkwt/XL7/vScwA9IK+ZWnV gXTR9wfN5uV3K94TJUVxHDlNK1Alfp8Smh5j3A9jAWnuk63F1Uf2sPGGZfcF8GjtrrYs K4pesrmht0kN9DZMA9ZzHga5zjvv79qFE/F/txrVfX1TinYhzCHG5+J5uPAAzNfvW+aG 0R23a9njNnmTE0yolH3MTVodPg8OJgGtBVq8KQ1eMmcNE/63aitZGodh2Jzxlg80L8Xj k3Ic8IbGRnf6C7BCsVj+TLDSWOzbGVz8owNEbxJEm8T79R28pIW3pqsv1zIBSQmp1KYd +MzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=SxQ2M/TicYeJ76aNogSLAPH8mGUJNA/k/gNUFGYq1Ow=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=NR4dmoqKdjSjHPuiLJVZgVflSh4OipSTB1YIuuzVSuXKUqI6728Hv09W4c6Ol4KJiD tddgyfpHn0sK8D4QxbZJGAgdsjV2UErO6FzZmono7dbEg9A1+PtaTcwdMx2Ys+EPXycx fhYaVJZw/BRVmRSa4U2a2olSHWsd5OnHSfJIvKc85Fj7EGgw3JJRdHeGuaChzBkLhnzw P/BSYA5trWOCunSaO9HIvQd2NPbu5EM0sfJPvuEVMBkheVQL/Nfdo8gxtYLzgN4waaYn xw2F6Iye3Zd9BUNGwP9IZgHkxdLRl+jOqYYV/S3dwqKZKM4n013gwTFU2iF4ZvpD43vE 1CdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=mu8VSG8P; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f16-20020a0564021e9000b005402ba50306si5073321edf.644.2023.10.26.05.19.47; Thu, 26 Oct 2023 05:19:48 -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; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=mu8VSG8P; 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 B930868CAD6; Thu, 26 Oct 2023 15:19:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5380268CA64 for ; Thu, 26 Oct 2023 15:19:08 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 0C9344BB1A; Thu, 26 Oct 2023 14:19:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698322748; bh=KKsk2XrZZAqAgnqRZIYmDg5Hls5nZ0XT9/Wxc4EcMi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mu8VSG8PuduHNA4JLQkZZMMRzR/hfzDHBuY0G1lVBd1fC7kj49SqI0keGCvuOtowO 4Y21IvOt4lp/tyuS3eB7w0Ef1z26mMi87qZ8A3Yws2FUWfpPGQ8RMAIZbbzOk3HiRS GDgK8q4/y4fVB/VPlXf3bvU10WqETlLFOO0wXNCM= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 14:19:00 +0200 Message-ID: <20231026121901.68926-4-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026121901.68926-1-ffmpeg@haasn.xyz> References: <20231026121901.68926-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] avutil/pixdesc: simplify xyz pixfmt check 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 Cc: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: WOa8p9f7v6ha From: Niklas Haas --- libavutil/pixdesc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f2647d3d55..4e4a63e287 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -3055,13 +3055,13 @@ static int get_color_type(const AVPixFmtDescriptor *desc) { if (desc->name) { if (av_strstart(desc->name, "yuvj", NULL)) return FF_COLOR_YUV_JPEG; - - if (av_strstart(desc->name, "xyz", NULL)) - return FF_COLOR_XYZ; } if(desc->flags & AV_PIX_FMT_FLAG_RGB) - return FF_COLOR_RGB; + return FF_COLOR_RGB; + + if(desc->flags & AV_PIX_FMT_FLAG_XYZ) + return FF_COLOR_XYZ; if(desc->nb_components == 0) return FF_COLOR_NA;