From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id E3F8C48088 for ; Thu, 9 Nov 2023 12:27:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1949F68CC83; Thu, 9 Nov 2023 14:25:55 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 45E7468CBE7 for ; Thu, 9 Nov 2023 14:25:42 +0200 (EET) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 27EC94BD25; Thu, 9 Nov 2023 13:25:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1699532740; bh=h5LwYhtDbeR8KDwAZPYQzL1/cWUVcnYK8MtEXItqnzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JxTIL6DrMz6rSkeYFKtGpcM+xwejIeARytKHGxREAkvzz1w/E5ipFb37KrMFclJHm O0/yQlOp7q4GOYbdLnEAKBFaHu7tLKFaGSnobtPVNvhPN7su2YycMNkRVVp3p6WHtl gNECIjo/TGeKhDwHOQQSdNxAf+4frqC3wnlmmsek= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Thu, 9 Nov 2023 13:19:49 +0100 Message-ID: <20231109122534.124157-18-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109122534.124157-1-ffmpeg@haasn.xyz> References: <20231109122534.124157-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 17/25] avcodec: add YUV color space metadata to AVCodec 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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 adding YUV range, we might as well add the YUV color matrix as well - since some codecs (e.g. VP8, JPEG) only support certain values. I decided to preserve the ambiguous and misleading "color_spaces" name, for symmetry with AVFrame.colorspace. (Though this would IMO be better called "color_matrix" or "color_system") I also decided to omit the other AVColor* fields for now, because vf_scale cannot handle auto-conversion between primaries/transfer/etc. There is little value in adding metadata we cannot do anything with, and no harm in extending the API again in the future. In theory, vf_scale can handle conversion between chroma locations, but also the signalling for this is annoying, so I'll defer it to a future commit. --- doc/APIchanges | 3 +++ libavcodec/codec.h | 6 ++++++ libavcodec/version.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/APIchanges b/doc/APIchanges index 97b6de8276..87f4368e03 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-11-xx - xxxxxxxxxx - lavc 60.34.100 - avcodec.h + Add AVCodec.color_ranges and AVCodec.color_spaces. + 2023-11-xx - xxxxxxxxxx - lavf 58.15.100 - buffersink.h Add av_buffersink_get_colorspace and av_buffersink_get_color_range. diff --git a/libavcodec/codec.h b/libavcodec/codec.h index 8034f1a53c..8bd678de7a 100644 --- a/libavcodec/codec.h +++ b/libavcodec/codec.h @@ -235,6 +235,12 @@ typedef struct AVCodec { * Array of supported channel layouts, terminated with a zeroed layout. */ const AVChannelLayout *ch_layouts; + + /** + * Array of supported YUV color formats. Ignored for RGB/Gray formats. + */ + const enum AVColorRange *color_ranges; ///< terminated by AVCOL_RANGE_UNSPECIFIED + const enum AVColorSpace *color_spaces; ///< terminated by AVCOL_SPC_UNSPECIFIED } AVCodec; /** diff --git a/libavcodec/version.h b/libavcodec/version.h index 2a08e42d7e..0ef6c991f3 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 33 +#define LIBAVCODEC_VERSION_MINOR 34 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ -- 2.42.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".