From patchwork Thu Oct 26 14:23:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44363 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp671019pzb; Thu, 26 Oct 2023 07:24:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9uteYkEYu1fJmd6JGshsFpc7N9tXop1gUKIF7kUkbKRoJkvTHvJHQ0zjEnSLyP/P3Xivl X-Received: by 2002:a17:907:86a0:b0:9bd:fc4a:c70b with SMTP id qa32-20020a17090786a000b009bdfc4ac70bmr16144915ejc.70.1698330241238; Thu, 26 Oct 2023 07:24:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698330241; cv=none; d=google.com; s=arc-20160816; b=Tkvqu7p3xbcD6Um3313sapJME3GLWZwz3fCMWcpSOeQC7eeyHDaaEVfCmIyg1Mf1G6 7pxHX6jDjjwYpzwy0/UY5Rb6b1otDplZMgWOjheAxFMFQWd4hk6OlBHQoBshYwg27bhX Q+L25b+Mzx5at0w9RGfs2Im+8f/M5eopsmjhc0s/0GGG9BPsKAdzJJDTCTXbOX0wlPpW IwIr96DzpIXOq+dkQl+1vZr+XyLN8/rZ/bIw2cfoDsCb5N4/g165UGCd4YSMIrLDEuk2 worTk025lhrYAsBIiiilx6FnmTNhpggEWrw2iI8G7f2RT9notg8mqJNbUbUsz/4AE5hV ecfg== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=AAkPZK3pBfIc9EW/eNknKzvMGYaA080LQt+8GQwxN3o=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=k1YaBEgNrmQpPmcHIDtYq/PYElpFScgh4krga/hz+kY1cVnmzpRkxmMhxBmBxVSRua P6pjlN260PWsoDD67izLVohh3Cq8Xaft1SXDgjWuKbbJzoRDC2VOhAysQRT8E5TAe8LK AB0CJFfQzp99knGrpHCG8QkPueqs0yzbtijbkn0PqlyM4Ij2x+krhlhKz2Bl+j75rpBt 92fUM9fp543M3K1FlXrki+cNFsXtTqY6kNEUgYm3LGJVxF6A/6JoQtUFRMulGJ1qTxh2 +Ck/wofBF5NeZ+2ShQxXJit/gPoOeOK1HwCDudBJbQkrpfp6oRC8B1B35qxYXLoeRA7b e4Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=I3fYIOWV; 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 kf10-20020a17090776ca00b0099396547000si6138385ejc.767.2023.10.26.07.23.41; Thu, 26 Oct 2023 07:24:01 -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=I3fYIOWV; 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 F1A8168CB83; Thu, 26 Oct 2023 17:23:38 +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 192BA68C6BF for ; Thu, 26 Oct 2023 17:23:33 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id D141E49516; Thu, 26 Oct 2023 16:23:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698330212; bh=WMMdpCgtpF/0OOHndTMhGAAC8xp3vyCO1rMPJu2pDHE=; h=From:To:Cc:Subject:Date:From; b=I3fYIOWVYQACQxL9skuV9gWykmhE1VAzMxCWkrqjUtVH7qWeJ+kzi7M8tXMHy01Pw Z7jr1ucgLXRsSILvyGuthcpIHMxrfKGaGAdTAoLGKJyfxjMRIB6o9ONfqkvpLKL7fM QCOq52F3FfyCve3Xs7wq4FmhV0TyPIXvYZOtevco= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 16:23:23 +0200 Message-ID: <20231026142327.52694-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/5] avfilter/drawutils: ban XYZ formats 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: L6Ng1zgaeg/9 From: Niklas Haas These are not supported by the drawing functions at all, and were incorrectly advertised as supported in the past. Note: This check is added only to separate the logic change from the API change in the following commit, and will be removed again after it becomes redundant. --- libavfilter/drawutils.c | 3 +++ tests/ref/fate/filter-pixfmts-pad | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 1081938d86..c31ab6bd5a 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -22,6 +22,7 @@ #include #include "libavutil/avassert.h" +#include "libavutil/avstring.h" #include "libavutil/avutil.h" #include "libavutil/csp.h" #include "libavutil/intreadwrite.h" @@ -93,6 +94,8 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp return AVERROR(ENOSYS); if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA)) return AVERROR(ENOSYS); + if (av_strstart(desc->name, "xyz", NULL)) + return AVERROR(ENOSYS); if (csp == AVCOL_SPC_UNSPECIFIED) csp = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? AVCOL_SPC_RGB : AVCOL_SPC_SMPTE170M; if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp))) diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad index dd01059c59..b4d236d408 100644 --- a/tests/ref/fate/filter-pixfmts-pad +++ b/tests/ref/fate/filter-pixfmts-pad @@ -43,7 +43,6 @@ rgb48le ed08db9b1aa50d69b8c3d73db93e390e rgba b157c90191463d34fb3ce77b36c96386 vuya 44368c0a758ee68e24ce976e3b1b8535 vuyx bc7c4f693a22cd1ac95e33d473086474 -xyz12le 23dadbbba70b2925ce75fb8ba8080ba3 ya16le 8dbfcb586abf626da7d1aca887a581b9 ya8 495daaca2dcb4f7aeba7652768b41ced yuv410p cb871dcc1e84a7ef1d21f9237b88cf6e From patchwork Thu Oct 26 14:23:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44365 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp671157pzb; Thu, 26 Oct 2023 07:24:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEE8USX0TDrsAJMwMwTa/gMOcH4fvFoDO9N+5yio8tJ4sAx/exrQ+4p/Yjeb+3/JT66ngS1 X-Received: by 2002:a17:906:dc89:b0:9bf:ad86:ece8 with SMTP id cs9-20020a170906dc8900b009bfad86ece8mr15973638ejc.25.1698330252428; Thu, 26 Oct 2023 07:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698330252; cv=none; d=google.com; s=arc-20160816; b=R8nNoEMV0fNA2Zt02GL2+vPq311JRPNlumxA2Yt/Pb70+xYRujiUhTwoVS+Nrij/xH lcUXxuZNG/A+ymEHnBneTg0ViLqSr3hQbUE50eCD2Q3IHYPajYWid0obygkpEbQ/pe3y ZdpLzFGpxiJ9bcw985gc0oalKb0ItMnjj1ykqPKJjbDvnT9Pn24062HoAwdL1Z8gZg7g 5wqkpGAMGVJPu7fCjJVkK2iI27SK3xuyEL+TcYBKcf3Mqtsfngq0O72+IfyPYwtYxMzN 90Df+h6yatYYS9nhE/lfTj92/YO3UjUcpdsAu9XH6L0/Ox0x7gQ2TnmCpGBxtlNGCRAj tQZA== 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=U/74G+PltOlT7HRhCCaqhLuher520kjJJKYszsqAw1I=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=mBn8LAPcSkYsFNTMsQxlbjy02W3TPCuG03oou/xfD1qlNlTINhJbdUzDYzvZFoovNS KCjMzS/QfAlg/lu2/PPsFW7tOoV4+EF9tpshF+dqWT0Ds5/ayFkNI0F5lIIi8dni0b3d kmCc2E0TgyjNyeZCsGt03xYP0hjv7gTQZZxeMrLdTJdplZLnn3P5smYQuh5p/wdZo6O/ XMbq6xFH6nqAP2YuSo+ri7l3SzMS+SG4hpfrPZ7OJ2ppEt2FgXXRz6X+nkn8kxmQfdv3 XSYViWL+5BaIaloZxP9g2blmgEYTC3iLlgp6Z+aDWP0qOGUy0+P1jEKWjO9BXofq0Aa+ TH6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=BP7e5s2X; 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 gs26-20020a170906f19a00b0099bcf1c07cbsi6640188ejb.883.2023.10.26.07.23.51; Thu, 26 Oct 2023 07:24:12 -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=BP7e5s2X; 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 09F9F68CB30; Thu, 26 Oct 2023 17:23:40 +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 5F63368C6BF for ; Thu, 26 Oct 2023 17:23:33 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 1AD334A521; Thu, 26 Oct 2023 16:23:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698330213; bh=6OK91JKng39eW74dMUrtBisqhXThNYCN03Kt+CsSfRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BP7e5s2XiB9c1RxmFKxgQXlvQwKiElFJXZiDH0ndLmd4u5z2JDE1j7LBm1PWLc2IO aYxzBxdI7DMvdME1zb/uRa7dhwaezDwWAxN/b3l4M5QUTVOC2oZ+lRxM1+s2e0KitY faYFrRJMJHIo6Ka8D/fm7CXBitWAN2wvKtlAhBsA= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 16:23:24 +0200 Message-ID: <20231026142327.52694-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026142327.52694-1-ffmpeg@haasn.xyz> References: <20231026142327.52694-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/5] avutil/pixdesc: add AV_PIX_FMT_FLAG_XYZ 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: V6pYvGRwVRGF From: Niklas Haas There are already several places in the codebase that match desc->name against "xyz", and many downstream clients replicate this behavior. I have no idea why this is not just a flag. Motivated by my desire to add yet another check for XYZ to the codebase, and I'd rather not keep copy/pasting a string comparison hack. --- doc/APIchanges | 3 +++ libavutil/pixdesc.c | 6 +++--- libavutil/pixdesc.h | 5 +++++ libavutil/version.h | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 9b109e6fa7..c0d6ee0b29 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09 API changes, most recent first: +2023-10-26 - xxxxxxxxxx - lavu 58.28.100 - pixdesc.h + Add AV_PIX_FMT_FLAG_XYZ. + 2023-10-06 - xxxxxxxxxx - lavc 60.30.101 - avcodec.h AVCodecContext.coded_side_data may now be used during decoding, to be set by user before calling avcodec_open2() for initialization. diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 6ded9467b0..f2647d3d55 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -1977,8 +1977,8 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { { 0, 6, 0, 4, 12 }, /* X */ { 0, 6, 2, 4, 12 }, /* Y */ { 0, 6, 4, 4, 12 }, /* Z */ - }, - /*.flags = -- not used*/ + }, + .flags = AV_PIX_FMT_FLAG_XYZ, }, [AV_PIX_FMT_XYZ12BE] = { .name = "xyz12be", @@ -1990,7 +1990,7 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { { 0, 6, 2, 4, 12 }, /* Y */ { 0, 6, 4, 4, 12 }, /* Z */ }, - .flags = AV_PIX_FMT_FLAG_BE, + .flags = AV_PIX_FMT_FLAG_XYZ | AV_PIX_FMT_FLAG_BE, }, #define BAYER8_DESC_COMMON \ diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h index 0df73e6efe..ba2f632814 100644 --- a/libavutil/pixdesc.h +++ b/libavutil/pixdesc.h @@ -157,6 +157,11 @@ typedef struct AVPixFmtDescriptor { */ #define AV_PIX_FMT_FLAG_FLOAT (1 << 9) +/** + * The pixel format contains XYZ-like data (as opposed to YUV/RGB/grayscale). + */ +#define AV_PIX_FMT_FLAG_XYZ (1 << 10) + /** * Return the number of bits per pixel used by the pixel format * described by pixdesc. Note that this is not the same as the number diff --git a/libavutil/version.h b/libavutil/version.h index 4c0c545d40..279e54c394 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 58 -#define LIBAVUTIL_VERSION_MINOR 27 +#define LIBAVUTIL_VERSION_MINOR 28 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ From patchwork Thu Oct 26 14:23:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44366 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp671265pzb; Thu, 26 Oct 2023 07:24:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEirduW1y+Lf8GHrEpwr++cRF/HyNjKEQuz6FQ6Mvb8joy3HC51QNdM6pcUXVkKF4FOYlFj X-Received: by 2002:a17:907:7da7:b0:9b2:b149:b81a with SMTP id oz39-20020a1709077da700b009b2b149b81amr13773317ejc.64.1698330262445; Thu, 26 Oct 2023 07:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698330262; cv=none; d=google.com; s=arc-20160816; b=FQNcVEtTGma9gCcrnH3gz43aYD1YeJAOQKeGgMPbzLDUAdvelzpZVkttzyZ9fEo6I3 YxLWNRVnN+SE+Hr+36bFSjQPEkbpF8YJZ6rN8BC9TdpZeCCYhJjUCjxFhb4jzryAWvvQ 5L2vqt2lQ+8fdahF5CdF1t30sNV3t8ciQePsQ8Lpy0y7N940qcHJJLTtxGpcp4Gx4AR9 EtHIflZGOq+ad8Qd6VIMOJ5tU6m2uhwt5lLzTOoqFY3ss3GVqFHhiNUoUga63n+mlmxP Zgi91dI5/GLwZYglHAL/x2T8g5cEm8uD9cF7LBxYKk3/ENBXsznx6vuIhv5bxzDhdlGK GpHg== 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=wAnerD3APz6g9Ovtezw3Agpu4qY73wTDhtUFbAFEqYU=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=CHwrcBAZX2MJ5FoEP5u/TDefvj9nivaDklJcBFTJ50lKzKqfA8bPn3/wjP4l9i8i8b w5q+yBJewJUp9BA+yH/c5dLHucQRO3EnXqJEnUj+jPgpReSGdc1fna+tadbRF7njGQ+g 8BBTz3LuBfpsLs6bG61v5Wme6vVfB1OriSs9UzZG66O4OT+TdXQVLWRtIyHoaMfz+hnd rB6rB7kdl5wwltKsizIzYIndQT4Re0RzddlRT+veAo78pfYAjiTMIkIOcSLUvao3FbTu gdDVcCnkmBcE/CuhI2uDVZlnDKhrUkBr30rGkJVI4K1pVlV0wKB2+dEeVYMN4xYKkI+i 3+VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=YPaiZ1d8; 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 di18-20020a170906731200b0099cd52f95dfsi6435840ejc.332.2023.10.26.07.24.00; Thu, 26 Oct 2023 07:24:22 -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=YPaiZ1d8; 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 1AEE868CBA8; Thu, 26 Oct 2023 17:23:42 +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 8D92968B4D7 for ; Thu, 26 Oct 2023 17:23:33 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 57FD54B800; Thu, 26 Oct 2023 16:23:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698330213; bh=AQhB+/Z5KBmpbCGV4ELZY0MkfAN/cTE55UHaxafuRTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPaiZ1d8qt+lhPATO+rciPmZYOM/dht+76zcvL243Lj2L4dadsIPexMSKPJJJWFCa +/OdobDbAQBPJcNuGeG10t1wsVghS1FX+pcdZ4eecDxyztMLV4SKatklVpMVHltxYE LeckNV2ZQ4jIesXmaAL9nUJD8C74aKMIdrOoqinQ= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 16:23:25 +0200 Message-ID: <20231026142327.52694-3-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026142327.52694-1-ffmpeg@haasn.xyz> References: <20231026142327.52694-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 3/5] avfilter/drawutils: remove redundant xyz format 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: BYHAuZIGoqEx From: Niklas Haas The code above this does a whitelist on desc->flags, which now includes the (disallowed) AV_PIX_FMT_FLAG_XYZ for XYZ formats. So there is no more need for a separate check, here. --- libavfilter/drawutils.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index c31ab6bd5a..1081938d86 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -22,7 +22,6 @@ #include #include "libavutil/avassert.h" -#include "libavutil/avstring.h" #include "libavutil/avutil.h" #include "libavutil/csp.h" #include "libavutil/intreadwrite.h" @@ -94,8 +93,6 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp return AVERROR(ENOSYS); if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA)) return AVERROR(ENOSYS); - if (av_strstart(desc->name, "xyz", NULL)) - return AVERROR(ENOSYS); if (csp == AVCOL_SPC_UNSPECIFIED) csp = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? AVCOL_SPC_RGB : AVCOL_SPC_SMPTE170M; if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp))) From patchwork Thu Oct 26 14:23:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44364 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp671135pzb; Thu, 26 Oct 2023 07:24:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNOe/KzpFjcdYS+V/7M1Aj3hdOujoPzR9yl9qMR1H6c3N2os6rW8o3o0Y5O0gS4XADztDU X-Received: by 2002:a05:6402:4487:b0:529:d147:e9f3 with SMTP id er7-20020a056402448700b00529d147e9f3mr3165665edb.5.1698330250704; Thu, 26 Oct 2023 07:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698330250; cv=none; d=google.com; s=arc-20160816; b=VX4jtUbyHW/v3VR1crtNWBtB5oM/JbQNiT+k6Q+cvHzI5rgSmXQgec2A5BpFXlu5zR 9YIEEHYnmfV4HHRHUgeYJjbJQYuJzCutpUExmVgpCSNMt1+1arrml/J9vVTXBzlzjaC5 z+XG2OTA2VWitnE914nY7RHlvkaz+1s328nuCj0usvAVNA2oj/MDc9LcvLmhpD4hndQk CUMgslq4C31CFz9E3i6e5Ph9PN3E1F438IaFtxsOso8kHzk3s+9dqJqmwNqlCLSjXKSY y7DPSSntID2t/FBo8MkAXt1zDyvCECiljN+e+v7DzTRBbIydnL4MoiDgZJTVkAkJuiac obEQ== 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=yVp8rbpEAIus4lcAJC8uiYcXtTgM0jeM2Iqiq7aE54bROhcxNjUlD0K9+MkHV9HvDS W/vs9gDlDVlD0/G2inYxN5kvwUvzHUvnyAhIJ3/cQr2lpLNIcT69DPh9Y8tqG7P+FMHe EVYsNy9rI0/JgPFV5UsRNA5VRCqgKzrqjU8xCsuBI74hqmlIfB4zxELPM6+/HfzPzE55 Kl7qPhbsFz0ce87E/J68z1RFA8LtfFiKAC7dXf7iiTffRtYpiXbW7usCnqgX8CgW4QIr Ak7+Flt1boH3NKCXMLwhhSSn0kbvswHkaa/1acwXgNzVTIWxEKa9Puzf8EgnKarCQR2D coBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=PZiwKUUX; 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 u7-20020a50c047000000b0054015a7cb23si5072225edd.268.2023.10.26.07.24.10; Thu, 26 Oct 2023 07:24:10 -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=PZiwKUUX; 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 315A868CB3B; Thu, 26 Oct 2023 17:23:43 +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 D946C68B4D7 for ; Thu, 26 Oct 2023 17:23:33 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 96D4E4BB73; Thu, 26 Oct 2023 16:23:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698330213; bh=KKsk2XrZZAqAgnqRZIYmDg5Hls5nZ0XT9/Wxc4EcMi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZiwKUUXjKChKNfhiBym9dKjKeP7zaDnEY4DprNy2GWO8sZddayAkA62KtHHOtWMt 7m/VN3ImogqaqNPUL3pxpHx4v4i/EGGNsi/RxBwds02TQi3bNk1mVKGmku/Nw1sG4i Omnved4/KJZuMBqYR6WEey7YTVKGZlTW28ao/l5c= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 16:23:26 +0200 Message-ID: <20231026142327.52694-4-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026142327.52694-1-ffmpeg@haasn.xyz> References: <20231026142327.52694-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 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: wyRcSHvwAVEL 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; From patchwork Thu Oct 26 14:23:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44367 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp671466pzb; Thu, 26 Oct 2023 07:24:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0Z7EKYzACUovMg0o3OOTPkNXe9XGd3rcrjtAAlyOQlzjlO4M8OiqEUhcmlDBu4DFu4X+v X-Received: by 2002:a17:906:7311:b0:9bd:9507:ed1c with SMTP id di17-20020a170906731100b009bd9507ed1cmr16150200ejc.18.1698330281701; Thu, 26 Oct 2023 07:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698330281; cv=none; d=google.com; s=arc-20160816; b=JMbDCVh9l4LywQvptJ1kPOQ2YG1PPjzEYLKzJwBABKTOWPOUbBxzA+xMjeTxhu+A6v t3DFzA8QXlTVNs7t9hABrqZCUTWjZ3BEt0AU4kNbkzfyEpkk+uhimc6pifZ1Z8YI4ftf o6s7JNaYOOFyySuvM+4thms72iALCmr/J4ZDJrJDWC2D9/aYvVGTxo3Ixt5caZdCgN/H vEFciPpO1e5nVXkqr83A4geTQzGLIwbnc/5n3FIiYUyGEPx9MVzXnPxrQGcias/An78c apTLfJ18If9uxEQs4fAf3e0nYcmoeEy51do5eUZJMJVBjGVeCQpBQWvrRkgdxZpX4CmW vyNQ== 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=eVHBKM5QxJjLnh88eqoihJQ/LbldpqlYo6aaakpLvh4=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=E2K+9rIm86vxvIryG7VrmO8DnBbsGyoLxQgseh5gMPVzLQsLuld/CfFdEZnF6IrX7e sOv10OtudKJBdOalQ4B3yQDMeMEjll/Eo9mdF4BzC1jhr1mpcVNhzWxerNICx1s+gcBk eD0hm7X0PxxWQbI7YifE49FPRo5W1X+1RwuGqDAWsNNwr8e0t+EQ4U0pgaSio7AVPiOZ /NFVrCIwk35RId+C9kx/uZLVZQMEROd9R7Vrt1D8xK0R9obNXvrdXmXsYAP7gQzXzaJM aVRylXTbAAEjcPSWiDWG7kfjtMcWfhi20+M/keNjYkCcWejBo5pWRXbgdT97X3Vr8w1R mnTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b="kQiHYbl/"; 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 f9-20020a17090624c900b009a633e2f3f8si6571585ejb.43.2023.10.26.07.24.20; Thu, 26 Oct 2023 07:24:41 -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="kQiHYbl/"; 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 1570F68CBB5; Thu, 26 Oct 2023 17:23:44 +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 19B8468B4D7 for ; Thu, 26 Oct 2023 17:23:34 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id D20944BBCC; Thu, 26 Oct 2023 16:23:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698330213; bh=TOVXDmTKPdL69mYDoGYcbG+s+pajMbFqjczNcVAEWQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kQiHYbl/0K6A8YWSXz9VQk8k6IwxlOlnQiwE9G0r9FFyzjouF0LvC4dWK16eHVx7S 414K5g8zWFCfdrgz+EpomQit5UP/lpyUzUaahKlMT9IsJt203ltjFcrag91MdZiybO TM5Diitgb2C4Qcxr6QPVrvLxkDjWpZQfqOEesC/Y= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 16:23:27 +0200 Message-ID: <20231026142327.52694-5-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026142327.52694-1-ffmpeg@haasn.xyz> References: <20231026142327.52694-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 5/5] avformat/vf_vapoursynth: simplify xyz format 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: abcF+PIT4AqB From: Niklas Haas --- libavformat/vapoursynth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavformat/vapoursynth.c b/libavformat/vapoursynth.c index 965d36dc2e..b79ecfcf1b 100644 --- a/libavformat/vapoursynth.c +++ b/libavformat/vapoursynth.c @@ -118,7 +118,8 @@ static av_cold enum AVPixelFormat match_pixfmt(const VSFormat *vsf, int c_order[ pixfmt = av_pix_fmt_desc_get_id(pd); if (pd->flags & (AV_PIX_FMT_FLAG_BAYER | AV_PIX_FMT_FLAG_ALPHA | - AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM)) + AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM | + AV_PIX_FMT_FLAG_XYZ)) continue; if (pd->log2_chroma_w != vsf->subSamplingW || @@ -141,9 +142,6 @@ static av_cold enum AVPixelFormat match_pixfmt(const VSFormat *vsf, int c_order[ if (av_pix_fmt_count_planes(pixfmt) != vsf->numPlanes) continue; - if (strncmp(pd->name, "xyz", 3) == 0) - continue; - if (!is_native_endian(pixfmt)) continue;