From patchwork Fri Apr 26 12:28:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 48273 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:1509:b0:1a9:af23:56c1 with SMTP id nq9csp333703pzb; Fri, 26 Apr 2024 05:28:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU4S3MNO5fywMiLP32Az9IZh5kq6nE2UuuduL8HEdNl4wsGEnW1MNFhzENZ5KzR5E19k7imngQbi4omuFsmfdYaV6xRbWgXkEJ43Q== X-Google-Smtp-Source: AGHT+IEYgfnpfS+joavbUQW5PkQ1XsjvD/bC5NuadoSpK44DuQB8w/M1N9AuVJ6YSXLXtlk+reuv X-Received: by 2002:ac2:43b0:0:b0:518:17ad:a6da with SMTP id t16-20020ac243b0000000b0051817ada6damr1494071lfl.44.1714134532635; Fri, 26 Apr 2024 05:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714134532; cv=none; d=google.com; s=arc-20160816; b=TzQYxXVwNR0NcRfv3UdkF532oFCkKY9cN0vR5jsL5T9LEVUMmFmDrvl2Ah/bVhTuMy WNP9YBvWvax8yCAyveXPDsGiS+lw7OnJBWO13qVOuFbBmwXftt63qeLZ3AOaEbM8P/3y mcBy8/kc6DHzLaF8FCH3bTNHvEDySFbzxq171IbgI06rAV6rxCeWxONTp1sj1EG3E7LD ynmSYqjJiIR9lqiiDV9Z+oml0SOMMpi3bVPvRrr/U0m38gDUvRhy5yCWWGITzzPE1h7M OzrH2nWtZdgLdVX6mPhKKsNj64FjTYdg9duSHlAXH3Jk2siZKXsJq4WW/cafHDIyF+jc 4c5A== 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=lRfC/CLo/V9plw/ppczUBiNQA0QBDvscANXlGJwMER8=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=fTRG5TwzT0E9vUZg+QS/g4TBsjLpK0RdHktxOb4y3J9J/jRaMyc6wDWDwL9IN2CFbX mmxOZlHxLqX2Mb8QckylE1UBZNk611O98tC17I0Ggt9pQrqSE3RcJ3KEC6vWK8Zvi6O/ VhR4M4HjGKE/ZI8iz+Lsknje1HTq+8ZJm9YIcYFtjFAd0bBbord9pzhPWU5cH3IXhCnX TKaygDnC5fb9L/C/DBFzcQUyHDypqrZLQrn+gKosXXgY5NFejXy1xQsTJdM8bvKIofLa USiC1XwR0yQ1JiUsgnKhaKey2g+PrcOdCfyoKJUClzeVq9NljYYjSFzcdjrsaMeMsWCn W2Eg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=URW8XPdh; 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 y21-20020a056402135500b0056e44eb06eesi11242203edw.159.2024.04.26.05.28.52; Fri, 26 Apr 2024 05:28:52 -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=URW8XPdh; 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 B687968D44F; Fri, 26 Apr 2024 15:28: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 5CEA968D433 for ; Fri, 26 Apr 2024 15:28:07 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1714134487; bh=LX1LXhlJppcrkhnB/VKTr2R+rObVNso7ZX8/77j0/8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=URW8XPdhZQUhp+PAKj6/eWlHfwp58Nln3YNhnNgFTroSw0n+tXzGaRNq8RuYxvcuG EH5nGqCG17dCP/etex+yl5eRkcJaAlBkbZi+h1WBEWoK+2JD1LgdfmiB7iXV41KNh0 e2CeAbHSB6Uw1XgHyGDengp5GbEYUbXi8JnW/Muo= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 0F22743E5A; Fri, 26 Apr 2024 14:28:07 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 Apr 2024 14:28:02 +0200 Message-ID: <20240426122803.19967-5-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240426122803.19967-1-ffmpeg@haasn.xyz> References: <20240426122803.19967-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/6] avfilter/vf_colorspace: strip color volume metadata 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: TxjYgqVur5iZ From: Niklas Haas --- libavfilter/vf_colorspace.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c index 7bacd7892a..46c442f3fb 100644 --- a/libavfilter/vf_colorspace.c +++ b/libavfilter/vf_colorspace.c @@ -750,6 +750,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) } else { out->color_trc = s->user_trc; } + + if (out->color_primaries != in->color_primaries || out->color_trc != in->color_trc) + av_frame_remove_side_data_changed(out, AV_FRAME_CHANGED_COLOR_VOLUME); + if (rgb_sz != s->rgb_sz) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(out->format); int uvw = in->width >> desc->log2_chroma_w;