From patchwork Thu Oct 26 12:18:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44358 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp586140pzb; Thu, 26 Oct 2023 05:19:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrOTbPJ2Yog/ZrdRCr2R0zIbRiMdi+azSVwC5CYQLZ9/Ohf//2qsc7YcSGt4KnnjsEmvnJ X-Received: by 2002:a17:907:d86:b0:9a1:b528:d0f6 with SMTP id go6-20020a1709070d8600b009a1b528d0f6mr2692136ejc.27.1698322758877; Thu, 26 Oct 2023 05:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698322758; cv=none; d=google.com; s=arc-20160816; b=wRduUGAzOMXiXS4si0utwwXX3+G+PaUtvuq7JaTlOB2ULaUCJlD88DYC9bJQafjt6C staGKVu4gt+8yQe8KqCIt0YfiFOiNpX27UgUxVXm91q5Ep6TYMfNO4znDtbQz/KHn8K1 m3HSbY5zDlq+BGOzz2CypsZa5OWZNgBWUtIv/rsIPQq34ExwMRWX6iuul6u+OPb5hKtI ryNve4s1PhsPI7SUru7+D26DOJQavw6CCHBo1H4YaoIREfFkKciYqzIY+URaZK0eV4kc FD4HvWrK/6YvS4idP2t3drFzIfwfeNpb/M3edMsT5RBjIpTZFqEYX41arVuXd11sCYgC 7uCQ== 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=Ht4qd6w3Zh+zmAK9LkZ8GL2gZYFMZ1OxasQK3PtCGDk=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=Im0yTUljC3x37YhFxXZOpOpiFd5TU/migM/wY0PjiEaJgyk7QiFLmYBtYVLFvPJwjG jjpCdgf429tVRDQ3w9wKTGZzZa9TlyBN0/G3FCq/76BY8jNUExjh/Wgv8qRmQwsbRF0G yFkRuDDJbQy1sxpoCCTUPoDZwK8IlUYiVqI1d+nG7ymqnZ4JetN/43u1Ax8Rlvmz3gf7 JN5njMKYF+VjfyxHdE6nZyf1oZagSt4527BCwb7Ooz+m/oKWpX52+ACa7INBk3a0acwo 1kqGE9LVjWxyEnFIM4HvoTUFz+dGYM+73Z6XNS81lExz/gxcBNBd1ikpAAvEXkYfIeam D8Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b="OnBZK/oK"; 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 dn9-20020a17090794c900b009b2b7f68d16si7105161ejc.277.2023.10.26.05.19.18; Thu, 26 Oct 2023 05:19:18 -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="OnBZK/oK"; 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 E75A168CADD; Thu, 26 Oct 2023 15:19:14 +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 039B468C9DD for ; Thu, 26 Oct 2023 15:19:07 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 46BEB49516; Thu, 26 Oct 2023 14:19:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698322747; bh=tdHENaAQPsesHE0arvYeAxy+sjmGihDdV8lH02qIzVQ=; h=From:To:Cc:Subject:Date:From; b=OnBZK/oKFI+Z+OyDJAxR+paWs47bMbPmUv6QV/zOal1cCrDaeFll6uWgfw0mlCpLV cXR+F+Vy/0yPpbQAo5zrw4/vsaUwVsoTKhdzo/7Irq2Jxo2CQ1N4rcJoVHYxU9zKwU g5ujgvb9c6DmVim7ZzcIhlnZNBoXabbc0+DT74GQ= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 14:18:57 +0200 Message-ID: <20231026121901.68926-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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: W93KOxXfnL8j From: Niklas Haas These are not supported by the drawing functions at all, and were incorrectly advertised as supported in the past. --- 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 12:18:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44359 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp586249pzb; Thu, 26 Oct 2023 05:19:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGXXscx2ZveyGRb+CbONOV8JxbGgdtex+slIsVyAQ4irjh/0Pcgx6k0E7ws0bSJJoEIeWi X-Received: by 2002:a05:6402:50ca:b0:534:8bdf:a258 with SMTP id h10-20020a05640250ca00b005348bdfa258mr13758132edb.31.1698322769915; Thu, 26 Oct 2023 05:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698322769; cv=none; d=google.com; s=arc-20160816; b=JQ4fZY82udLOCsgRva8s8FheZcqXwmI3f2/ENquqdqzYl+HvDwT0JI2c1AGU8bJkfR gMj4Mfadgw5AdRo/O0ISUdVXQ5Lyd6kjEYOL+AdZLLzSTTpnB0HN98Ik5uo3yLt66kWJ UA2xhzlu7k0YpDrCTTRLd9kQMzeMB2UxYTEJqzmHTsmhU0QcMQ38plVXCpelTicV7qmK C9il0tx8qHrqXSv8n2hMR9LFr4pSWJ7BHjh/gJKF6l7earw7G4/YifuaiTLfDFwqC5M1 pCOdce7JPlv2EcRteJneTDv9FAS2lQgpFdftpYaiwU+NX+Sv/sj+x9159RNe8MpAASs/ yWww== 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=YVg010rGN5PLF5KpK704GudFB0G1adXwsa/w1RyL+5KR4S3h/Os0EaOahop0EUA3mo 80WISe2UIBytsPshMlXqNNJSZaeu7cbay9P/TScCgI/6QwtdBSzdL/kvi37pObjEZNPx W1WrwO6w5dbl7plQWT63EaCfTPolIRM5bI/2zXL2eG2LyG4VnX8sPqnBAlZPtu95/4i1 8jYbC8R8spnz6tyrhl4OWl+JSAw4gDyK7yUuToIpWJ1w6j+rWg/pvwLQ09EiGlEE/PPb IjK0J0jEUa9Fk0wNiS4zeZBaEpX3W3tY6OWyah8lyUWT4h2T8n28K8L6r3hOEIytcnfP fkVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=FzyVL9Ko; 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 c20-20020a50f614000000b0053dd858c5desi6253747edn.251.2023.10.26.05.19.28; Thu, 26 Oct 2023 05:19:29 -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=FzyVL9Ko; 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 E2E4B68CAE7; Thu, 26 Oct 2023 15:19:15 +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 0670E68CA64 for ; Thu, 26 Oct 2023 15:19:07 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 87C8E4A521; Thu, 26 Oct 2023 14:19:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698322747; bh=6OK91JKng39eW74dMUrtBisqhXThNYCN03Kt+CsSfRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FzyVL9KoiwDgXlEMds6j/8vFD5jnYSsKZwua1qi4caYfsBRV3+ICs/E9vvqFN9yhQ C3SpiHqEobNoXX35mmSocBDv5b/ZZULdrEDjXLxxJw5djX01OPFnEW8GxiqZP4MGSs aNx3YQzFvRYoY1dOYMSQYOqz8Nfd4tl0VT6Nn3/w= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 14:18:58 +0200 Message-ID: <20231026121901.68926-2-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 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: VKeSSRIBk/Bn 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 12:18:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44360 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp586341pzb; Thu, 26 Oct 2023 05:19:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6Scm8VIQ/C6YuLIlb3Tw137l+FK9gzXvLTHj4rclUJAdzBfwYM8BRhc5XJEzdBeBRw0PY X-Received: by 2002:a17:907:3fa2:b0:9ad:8641:e91b with SMTP id hr34-20020a1709073fa200b009ad8641e91bmr2431863ejc.11.1698322778463; Thu, 26 Oct 2023 05:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698322778; cv=none; d=google.com; s=arc-20160816; b=TvUBJYA5Dr5gj/cBNG2VVWTX43DLkMs3ohg5CWh1R5DmoANAehgq9x1E8I2EEqCI5q O6RqrvVNJfgcGaSUN7hdw4xIt6v2SxIfUI3LKzRQwS1HBmBWzX1qIkpML7sKsnSW6+VS 6mXxPOTNJr40QTX1N/o0jO/b30Ybt0xZxa3gDGtBkXCmQOCMCNvFIbAcZqX0TbpNv3ZF y6DQV8W61ScLHZHTFGYnz1FglNXr3zaTe6qON06llgSORxNO3C24xMa8fOEAi+kpjVnE o0frbydL4JRmEz2foz5fe2Lzykbli5k0fHFYVM5XvmCRzDtVs7jW/2qa6Gn/lId5/S18 WXLQ== 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=xPzL1dv6r6gQMgDdEKCfhdG3vz+xV2r56NTUOJ34P8U=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=WbYYgbYE3fcn4SlpEC95OLTJzS5toPmoAya3mdMHK+nUtO4trkmI8kUX24skT/0yp/ mOyTuPRD8BpAC+4bJwHic3MO4zFyHccXHhtPxaeYC37XKe5+C/bTnbhjK5b8bc53E9XJ TLCjcZs77E9pJup8ZdoXSxJRIRMafECFtq5m8qHTx8l5jCk17uTTTdKnHkyFmoX5axmo gXZEjxahThDXVki7ZPUjWggyMrvERFqMHyGMCZmqSgBqMUrgE9JjXZlGtj/1Wx2Ja03r F6V1J4PpfMbaodk3/Yo1vGrEnZR1/ppfaRlqwlm/DJYEuoeglLXbmInrHHqMIZAJcJfU 0wPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=fQwdf4sq; 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 h16-20020a170906591000b009ba1cf0f500si6774563ejq.871.2023.10.26.05.19.38; Thu, 26 Oct 2023 05:19:38 -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=fQwdf4sq; 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 DC40D68CAF2; Thu, 26 Oct 2023 15:19:16 +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 0DD6968CA89 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 C34A74B7B8; Thu, 26 Oct 2023 14:19:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1698322747; bh=hzwF4DTOQmDDmyHH7ydaBC0s6Rse1K8CFg4q3R0SgK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQwdf4sqSqdK4BTYdxoGeaP1VEF662xf1d7kL8o1+rbUnStJ0UUD7ZlLrjAm5rvZk mz1trV6lR2efI8DArzlworbIFl2qB5NuRQnojY1htCl6nPenmiqGpcmw0DjJWo9LYQ M8UnGs3YEQSl6LVvrO15rDgIKPL6+YQxO0/rh9fM= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 14:18:59 +0200 Message-ID: <20231026121901.68926-3-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 3/5] avfilter/drawutils: 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: nmLSeafem/2h From: Niklas Haas --- 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 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; From patchwork Thu Oct 26 12:19:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44362 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bf16:b0:15d:8365:d4b8 with SMTP id gc22csp586529pzb; Thu, 26 Oct 2023 05:19:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6/i0PO4BIvKueLeT6A79bLqQdcDSHBguCjmt0ooUIXUEflgOKakTk8TligEecW5u9ERN1 X-Received: by 2002:a05:6402:348f:b0:52d:212d:78e8 with SMTP id v15-20020a056402348f00b0052d212d78e8mr13832222edc.34.1698322798283; Thu, 26 Oct 2023 05:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698322798; cv=none; d=google.com; s=arc-20160816; b=MoIioP/Rvh8idWjTFMYhq7gbPCIGrkvZi2JC2qq+jgzIPueCToeSZe2gtSK/q8M25B 14nac8AZVOwXS4PhzVcSMREBhlw5QbWecCnFgQ+yHyPVSE/T8mYXTeodI6TIbEsP2tOI Cem+ZGX6etOFV4Qp5p97ZUdenzsUsT8GH6xABfZI98Jzmt2v52noATw7UR8lRp26Cacu mWPQ9qbE9Y4CGD+6TJK8PH32hs5NoOZUPP84Gk6F4hTIZ8FE+0r37wY6+zOmkYt4hLkx eiXLLf/3JtXWCTlnKFFZ86ZPKO2aF71xwZdngKBPLNUb3nh5bwCteM24m8+LP85s0gnj Fy7w== 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=cGz8hFKGek9+8Q8fFetfKyg2PD32EkbmkONBWdxpbIfV/qrDRVo4OFJxUBiwZR92Tw SzprFfv9HuPJmJlfxP3+4gokIF5oY1K94msE+KwENeXsM4rIMIHoDNGZqiclC0+3uFnz /QY8wLKBnuFc+ToVFrIBXmoVRmqYvMs+mmVRSHNGozpYdyzdEj2uQpx/T1mA+T+LCtZC 8+q6QBzCSq1BjbmVdbjREbfzFAON1S0X9Q+Qbf63YSVU7eR2I/3VYtmbpPrGnkdhSmcd qkdEYSzBs+zs4I7hMH8P/sPJIGgJZBYqjnO/nazV770omtjxHmqUuQBoOSz+8wONRxgu IhjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=iNRj9FOa; 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 v5-20020a50d085000000b0053e4a5805fdsi6721343edd.437.2023.10.26.05.19.57; Thu, 26 Oct 2023 05:19:58 -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=iNRj9FOa; 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 C1D0E68CAFD; Thu, 26 Oct 2023 15:19:18 +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 9BDCE68CA64 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 52FD44BBCC; 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=TOVXDmTKPdL69mYDoGYcbG+s+pajMbFqjczNcVAEWQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iNRj9FOaqHamfhs4NzZyC85sTGoRZ0cLUWiMWVKyJoF+4viTbnoUp3tNygtsVgVLv aLfRI5kOC2X4878pW6sxSk24bT8qxtnjKt/bk4vlorHw5NFDjn9c0300bbaVfvxHEn U18TSm+0k8ZvDZFCVIvoPUwmEs5RwMny8/66ZCzw= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Oct 2023 14:19:01 +0200 Message-ID: <20231026121901.68926-5-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 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: 1nxUmeFWxgO3 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;