From patchwork Wed Oct 11 14:55:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 44220 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4b22:b0:15d:8365:d4b8 with SMTP id fp34csp965030pzb; Wed, 11 Oct 2023 08:09:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBJQaJAsWKoGVN+nv6tTzw5K5rpug/feJsDcXIeJLPYcjrpK1ITqk2G/7fjQQwUFNbj80N X-Received: by 2002:a17:907:7713:b0:9b9:f46f:8925 with SMTP id kw19-20020a170907771300b009b9f46f8925mr14286409ejc.48.1697036957854; Wed, 11 Oct 2023 08:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697036957; cv=none; d=google.com; s=arc-20160816; b=EqTN13Q4G5Zja6D6QN2nofNfK5fhQVYnMHIfotOBAxS9KAFYi2uY4Gi5D43dkVQxAS M3DMTzkJzTN4iazrGKhGk1iXkfqzW2azPqIEyKiV+oc5uwijQYsTjgMcOqvPOkotrAGm FICiaEosn8lYW0PHmqH1gMXekdWfLyemh2VW1pSSYvEWuZrmixLwzOoBmYxOiyy2gZYv SfRTkE6Uk94kguAWBZ26/AnG17BViic5lORRzGbGJhKwP2gr2Xl6vwKoHyVuYkrkBGeE 8QxLOOWVPLG3NCsNXwftEfHnP4vjGjJ6yqKxHU4wp2/hyov3j30UIvLVYp51eGX1cwVs Foqg== 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=waGr3a/98eiVtyfzVlc4czpuMbhWBqiOk7c6BaA7B8I=; fh=xmAeKtysnShNOmkhiJmYkS30uw4Fu2hvBJ7qlIwukxQ=; b=lb7FjfhFO14JmYwEZtOq/K4715Q+f7JlZpCkj+6ROg+/qXPzAGIrOxdHKpY6173JwE ylu4gRdOpLOHyj4wlBFlQ9EIRBBTzHqW1Wcyr3aRapNxTiUI07mpUVRHPDzpX+49dIiY DjZL2XVYBw5pv056fzPGn39vVLQWqk1MvHNeYkIJMgRBA+LLX2ROvgtSfkSXRs0lUh+O UMbH4SJbestzmzjSvZY8kZPZb/tPe+BeXFNPjn1SuetPP/IJ7Quj6umsdkhVRNGr8ckk 9SbBNABFxODJoIwjqajsSalBWiuxb38jFm5n/pIi9RmaP5K1sYYxwJO/0BCTukWeMbFn Yz5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b="HRWmg/jr"; 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 h6-20020a17090634c600b009ad8ddcdd13si6485491ejb.394.2023.10.11.08.09.15; Wed, 11 Oct 2023 08:09:17 -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="HRWmg/jr"; 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 A5A1268CBD0; Wed, 11 Oct 2023 18:09:01 +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 D1C2168CA90 for ; Wed, 11 Oct 2023 18:08:53 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 842114B9E1; Wed, 11 Oct 2023 17:08:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1697036933; bh=fNK5GmC3o4uSDcFoqMutT6y63YhzRgVeIxI2Sf2KS5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HRWmg/jreywcAOOj0G3ZYdp3cRr/SC8+lag1ha8X1zASlK/btrY7q/YVx73QjnCv1 5s8cn3oXB/zpXg83FSL65JRNiLl4PM95fx52bj56zgsMtd41PhHvhW9XI6j6nnWDNc fJtIElbN1+GipO15hd76stpeZzv0JFTQ5f2ljdB0= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Wed, 11 Oct 2023 16:55:35 +0200 Message-ID: <20231011150848.117897-2-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231011150848.117897-1-ffmpeg@haasn.xyz> References: <20231011150848.117897-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/7] avcodec: add extended AVCodec color 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: U9SrBQOVc7+G From: Niklas Haas This is motivated primarily by a desire for YUVJ removal, which will require signalling the supported color ranges as part of the codec capabilities. But since we're here anyway, we might as well add all of the metadata, which I foresee seeing more use in the future (e.g. automatic conversion from HDR to SDR when encoding to formats that don't support AVCOL_TRC_SMPTE2084, ...) --- doc/APIchanges | 4 ++++ libavcodec/codec.h | 7 +++++++ libavcodec/version.h | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 9b109e6fa7..f91e855e70 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09 API changes, most recent first: +2023-10-xx - xxxxxxxxxx - lavc 60.23.100 - avcodec.h + Add AVCodec.csps, AVCodec.color_ranges, AVCodec.chroma_locs, AVCodec.primaries, + AVCodec.trcs. + 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/libavcodec/codec.h b/libavcodec/codec.h index 8034f1a53c..5bc8f21868 100644 --- a/libavcodec/codec.h +++ b/libavcodec/codec.h @@ -235,6 +235,13 @@ typedef struct AVCodec { * Array of supported channel layouts, terminated with a zeroed layout. */ const AVChannelLayout *ch_layouts; + + /* Extended colorspace support metadata */ + const enum AVColorSpace *csps; ///< array of supported color spaces, or NULL if unknown, array is terminated by AVCOL_SPC_UNSPECIFIED + const enum AVColorRange *color_ranges; ///< array of supported color ranges, or NULL if unknown, array is terminated by 0 + const enum AVChromaLocation *chroma_locs; ///< array of supported chroma locations, or NULL if unknown, array is terminated by 0 + const enum AVColorPrimaries *primaries; ///< array of supported color primaries, or NULL if unknown, array is terminated by 0 + const enum AVColorTransferCharacteristic *trcs; ///< array of supported transfer characteristics, or NULL if known, array is terminated by 0 } AVCodec; /** diff --git a/libavcodec/version.h b/libavcodec/version.h index 6b46100aae..497389d3f3 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,8 +29,8 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 30 -#define LIBAVCODEC_VERSION_MICRO 102 +#define LIBAVCODEC_VERSION_MINOR 31 +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \