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 01EE7475AE for ; Fri, 13 Oct 2023 17:09:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C4E5F68C856; Fri, 13 Oct 2023 20:09:26 +0300 (EEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2086.outbound.protection.outlook.com [40.92.74.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E1D768C09A for ; Fri, 13 Oct 2023 20:09:20 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZDHjXdgvAIUfR0m2o89KQ7FPoqjo0Ff7FdPiaVT6QN7VpryvMSVDexcCPeYqAG2KpuG56LA2/Hf1dIbeLOzmVTZeYGp4y9MOevYAz1T1ysZa0PYHRPXTPyjnjzYyYOH9MvlPTlkFE2ywJviwL5Y+1YIeGGwfo9N9XRkrKDW3oydlnaxKoANK4Yw+4rhOqSR0I0Aye27+hEqe8RRmVU8/y5XUi/ObduXJBqnhEkAiVyIN9hb6tVmiPoF8vqzz8RZ8R4TK8HmAesyFOf3cNgAvtfCdcUKE+E5xyH9T7o5FUtBHnv9EOMfERgBnhmObk0r3ow6l+qYBsLfgY2XPILCmwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gChISOuYtNBEASI/nguVuG9RhXiW0oWorMPYYNEq92c=; b=FfM3veFa5R1OSeQeYWP60UXQvgyj4bJ6WWL+kf0lxzKCsBqKlxpH+u5n7Y5rtChrfmpIx5Clc+eyReHF/18uztERbqeVPE8uloSJ0sIHegF6lTzeIGEBfQyGIulWsdMwOEzBaW8mtWqsG21Pmb3jhDClA1dOnVRFWLBXtZUe5SG1M57KHubH3F9Nq3b15Q1qt0icqeetm4NxU6QY9SCwXnmEZP7oH2umwHCe1WpvFKDTC+ucFWTbJcULE3IGevHZIvFwe9Cz0Sh3MGOng58fz3zY40k8RokORi9TFnJz9N7JoEWky18t0625BzjkfFL2u0om2hGqKcgSf+o1zDRFsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gChISOuYtNBEASI/nguVuG9RhXiW0oWorMPYYNEq92c=; b=WaZA9FTAJ9/szNG9YtLWrLHxWzliUVloK4/LqYMoElQkTOyjRQWBmieV7+wsOQrmifUaZP/u1uOnPxpSkNjUvO5oNuFVUQVgtzfpIWF9uHuKWac81xYI82Gjx+SrE6y+JCJ3YZ0SwJcRNS3IWIoS205GZGmSetWAa606saiKcicevCvTyi994P6BVITMiVgrVnXb6KHF7vzOLcHK087CwgPfvXrPrPj7VhOdfKzWSmjF5VpNsOjXrvqT7VdAL/cf73nGR5rOe2IcNwvbUcyTkMZTUOW+U8+d0fGWz4yRjHULbSkXQAR9C/ORItVWGhzPRWCHHQYvRS5OahKlKUU6yw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0048.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:23b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.46; Fri, 13 Oct 2023 17:09:18 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::3126:4823:194e:6f86]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::3126:4823:194e:6f86%4]) with mapi id 15.20.6863.043; Fri, 13 Oct 2023 17:09:18 +0000 Message-ID: Date: Fri, 13 Oct 2023 19:10:33 +0200 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20231013142706.23971-1-ffmpeg@haasn.xyz> <20231013142706.23971-3-ffmpeg@haasn.xyz> Content-Language: en-US From: Andreas Rheinhardt In-Reply-To: <20231013142706.23971-3-ffmpeg@haasn.xyz> X-TMN: [tuf8xbKVsV5lz1v7mVcDeSiebXLfjxXJaDT6UtVIRtk=] X-ClientProxiedBy: ZR2P278CA0071.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:52::17) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <4bb74b4c-af30-4e9d-82a9-5f1e0fb1213d@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0048:EE_ X-MS-Office365-Filtering-Correlation-Id: 6341fbc6-4d40-48ef-9139-08dbcc0f222f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DM94WbNCzaeZ39Ca3sHEwRVsaDpu6g2W+itS1DMJVViWSS/fHM/zbZxS8sZqeKmCTvB5QWniMuqoTyOc0x/iQq8L7wYcVdOu400ilGXngGDPCXCDxHFa3qNoGlQY1y9302g/2jYX3PAztZHQCc21eq33jRvDl/XlYbo4CTtQuzlN5oWflmjpfQe9Qe+Upf9PwI2NCQxW7HH8VPd95Zkz0pXbZsc/7G30s9GgZ7qIqr8WtqeyCq/SB48aJ0SMC1McP6E0NLFay66jpiN33pfkrc9YsFu7Jfo7ovpvBV7YAApgvO97fShFvpdnSps4z6w583W9I1FBuWLETPjJuPMnCzxZnn66m814QUpLekmWfnmbg1ayPgQwWnzcX7zLy1A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6TkNNUXhyaFFldWJYRG1kUFhKK25kOHlaUkhJeU0xdWsvMThsc0FEdVNk?= =?utf-8?B?TVdmcFdXTE5ac0F6ZjBZZDZLUGZhQllKdmNQenFCRmZTekhEbldHUGRtblFs?= =?utf-8?Q?Jp/3fqaRopFhNdzcZ8Mi?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6341fbc6-4d40-48ef-9139-08dbcc0f222f X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2023 17:09:18.4349 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0048 Subject: Re: [FFmpeg-devel] [PATCH v2 02/13] 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 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: Niklas Haas: > 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; > This design has several drawbacks: 1. It adds stuff that will only be set by a tiny minority of AVCodec's to all of them. 2. It is based around the underlying assumption that the set of permissible states (tupels) is a cartesian product of a set of color spaces, a set of color ranges etc. This is wrong: E.g. VP9 disallows limited-range RGB (it is syntactically impossible to set the color range when using RGB color space). 3. I don't see how the MJPEG encoder behaviour where the valid formats de facto depend upon strictness can be encoded in this way; isn't the aim to get rid of the necessity of the workaround in ffmpeg cli? 1. and 2. suggests using some form of function that returns a list of supported tupels; if said function uses an AVCodecContext* parameter, said list can depend upon the state of the AVCodecContext given to it, thereby solving 3. to the extent that one can get the supported combinations given AVCodecContext options (but I do not see a good way to signal which options modify the supported combinations). - Andreas _______________________________________________ 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".