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 41DEC4A1E3 for ; Sun, 24 Mar 2024 13:04:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7FE6968CF9E; Sun, 24 Mar 2024 15:04:47 +0200 (EET) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2066.outbound.protection.outlook.com [40.92.50.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A2EB168CB56 for ; Sun, 24 Mar 2024 15:04:41 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iOA34kI8gZknPKFRV7wqwGIYOtGXQkT+hfLEomaNpAb/b+JknzWRPKLVp2Yirn5i0VVZpDtuJub9MhuFFlKblPnQbLUtoo4FN/2qKmRBq2iLi9+eA88//bnuEIQkdtaT/22hbw5AlRqWrZHf/jvuT99504MAQCP6O8qHOQn9D3rdFEttzhxwKNZQ2p6vYO7O09spflfZLJbuCPhcder/gb997DGBjsBP7bq4kgf2gE74bY2cXid9g4C0ThLqbk6R64wuY1NxBbfh4BcTBH200EeB4ti3uF01hgMAcCtAks351pA5G+4zjZwG4WQi585HYff1SL6mI6oiBygRc7tmRA== 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=6nYFxwn1jLVGBOYy5QJ2tm8I6KbMmtv1IOtUxXiVoXM=; b=U7CpRPL0lG9GI4O5BPyYmOsjaqbXk57CF1ObES9ZpWAqQ0PhAmF+bzJlxhJFQzwO3uh1UexWOwc9U6NA47JcCW6zlC0rIUQlEN7bkQDFXyHovTJTu+pdsNweqphNeIQyVXxMmDKNQtA4Wbp0luiq6XUmoi/GC0VTGpo+nuI2vg5PCR3DCUguA0HdXNwZ3nS2yiDNN1q+nihjFSSkbJXGE3yauYr718p0om1gJKM1Uo5u2JXf3h+LzCdcZUuXz3HL94k/V2zUAE3Wkh4ETUkUjgZPQufr7Bp6yplzm6TvX3lZJNE1AVo0RSbwvu5A1CpFK83lztWWpPKN4RXh6HMvgA== 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=6nYFxwn1jLVGBOYy5QJ2tm8I6KbMmtv1IOtUxXiVoXM=; b=ZsAKaPMqrKP+RdonNGJI5A9IVxJ0N6FysYxq58IbWyZv6MnL5bL1JX9+LgYXNClMT7sUIDb6oqoh7nX0UJ6Y/dgNu9O1p97r17O7yjX+UjmrdyjediSlHGL0Jtp/0sX/dxXpvk0WsikOJD0X8sOHPASLu/GV0K6pRbZY8uMAlL9jhdY+H+OzVX9DxQYrmZNfAaJ0820oyInxb1E+L+SmpqAmux/kIwh6H0XdG2z5w8PGfkPyt1HvaCneIvTetjRTDQFESCmINfxwciRaBPUl/VVhwtJXFLKr/kNw6saGCqELfulBveYihCp5FWw+HAknTlRSKDX/8y0gilpqCo0ewg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PR3P250MB0290.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.28; Sun, 24 Mar 2024 13:04:39 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d%4]) with mapi id 15.20.7409.026; Sun, 24 Mar 2024 13:04:39 +0000 Message-ID: Date: Sun, 24 Mar 2024 14:04:37 +0100 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20240205174413.92730-1-ffmpeg@haasn.xyz> <20240209131138.GB12126@haasn.xyz> From: Andreas Rheinhardt In-Reply-To: <20240209131138.GB12126@haasn.xyz> X-TMN: [nYJlYfGuX0tiF3xcAZUvVRQOZ0Z9CGX+pLvJp0fOBJo=] X-ClientProxiedBy: ZR0P278CA0180.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PR3P250MB0290:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e892c67-3d7a-4080-e63c-08dc4c02f6d4 X-MS-Exchange-SLBlob-MailProps: Cq7lScuPrnqkjmXb1vlddM5aSa/Epk3ADevWbgKDCmbQgG9ycltzfLXKKfHt9rBhHEUGUuOvhi+dO9nqXEMj2TLa81assG4LsHVZt3NfgqjOxYmIFd8nAZjfp0tePxSVAIk2BfPSb4oB57DM3vUSfic01uYD2+6o/9bB0+R17YKQGMYBOa9d9Lhq0MkhOLvnMr7FeoySHqJlzsF8dD0vNgzRl2fIugoHvaAOdfPRDWIzVSvV0EG3BWbm1F0TdiYKacPuQX+pAPp4HVlxpMigMrtb6rwjeFs4au1bQxsoJYLRqiSTt3Fc/MmkKpGbuHjaTwMUb0rgjfVKJXnbD7LBcS+egSc2UOlWq0jNr2xbtBgtKBUZ47vh3xJu118TBTCVTbIWnMoKKpJh6oiAMbDO9z/XPR0WsSIlYVpZP2G/HGRQ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f6d4 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2024 13:04:39.6362 (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: PR3P250MB0290 Subject: Re: [FFmpeg-devel] [PATCH 1/2] 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 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: > On Mon, 05 Feb 2024 19:04:30 +0100 Andreas Rheinhardt wrote: >> This presumes the relevant states to be a cartesian product. Which need >> not be true. A callback would be better; this would also allow to base >> the list on other values already set in an AVCodecContext. And if this >> were extended, it would also allow to remove init_static_data one day. >> It is furthermore quite wasteful to store color_ranges in a list, >> although there are only very few states for it. > > There is also the consideration to be made that using a callback is > inconsistent with the established design. Consider that framerates, > pix_fmts, samplerates, sample fmts and channel layouts are all currently > provided as static arrays in AVCodec. There is a natural symmetry > between these items and the ones I intend to add (yuv matrix, range, > chroma location, primaries and gamma) - all of them are descriptive of > the way data is encoded, and are therefore also (or should be) > negotiable filter link properties. > > If we add a new callback API, should we then extend it to also include > all of the existing items from the above list? Is there a reason that > yuv range supports needs to be more dynamic than the others? > It should support everything; and I'd like to remove the other (public) static lists, too (after the necessary deprecations). > Food for thought: mjpeg is not the only codec that puts restrictions on > the format support based on the strictness level. For example, > yuv4mpegpipe_muxer errors out with a strictness warning if you use > a non-standard pixel format. And arguably, in this case, this is > **preferred** behavior over "silently" inserting a scale filter to > convert to a supported format, as the whole point of y4m2 is to > encapsulate raw data as-is. > > Should we: > > 1. Add a new dynamic callback that can query lists for all of the above > in a way dependent on the strictness level, and use it as > a replacement for the static lists currently in AVCodec? > > 2. Continue with the status quo of having these lists be static, plus > dynamic checks at open() time, and continue using the "convenience > hack" of having ffmpeg_tools automatically restrict limited range mjpeg? > I really want this convenience hack removed. > It is not immediately obvious to me that an automatic conversion to > a supported format is *necessarily* preferred to erroring out unless the > user specifies a lower strictness level. I agree. (In fact, on default strictness, the current code inserts a scale filter even if one explicitly adds "-color_range tv".) > > As for an API, I think that rather than having an AVCodecContext-aware > callback at all, I would just make callbacks that directly ingest the > strictness level in AVCodec. That makes it far less of a black box about > which fields of the AVCodecContext are relevant here. > > i.e. > > struct AVCodec { > const enum AVColorRange (*get_color_ranges)(int strictness); > const enum AVColorSpace (*get_color_spaces)(int strictness); > // ditto for the other parameters? > } Your callbacks would hardcode that the only thing that matters is strictness. And it would be very expensive, because these fields would be in every AVCodec, even though only a minority of AVCodecs (namely video encoders) would use them. (supported_framerates is even only set by two encoders. What a waste.) Adding an API like int avcodec_get_supported_config(const AVCodecContext *avctx, const AVCodec *codec, void **supported_configs, unsigned *num_configs, enum AVCodecConfigs desired_config, unsigned flags, void *logctx); (enum AVCodecConfigs would contain a value for pix fmts, sample fmts etc.) allows to keep the details hidden and therefore use a compact way to store it. - 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".