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 04DBE475DE for ; Sat, 14 Oct 2023 10:29:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0972B68C9F8; Sat, 14 Oct 2023 13:29:22 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5704F68BD6B for ; Sat, 14 Oct 2023 13:29:16 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 0E31C41EC3 for ; Sat, 14 Oct 2023 12:29:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1697279356; bh=e1rgxLTjc9AJkQ9QB8k561f3i/6wxRF19tgMG9rp4Yk=; h=Date:From:To:Subject:In-Reply-To:References:From; b=NbFOr4lW3A13IJXMTFAcepJshwVU4fosfzyIlMGquaOvnZq8mGHdib8hSw57JC+qP 2HL5dnCuiPpD+S0kKWkYdINWtRHMTnCOrDUTgkeCHioeka2LBkp8nfRpm4YsNafweH 5Vnf720zIT3rrep8tIvi/6I6UlHPbdQ5Kxr+hts0= Date: Sat, 14 Oct 2023 12:29:15 +0200 Message-ID: <20231014122915.GB16175@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: References: <20231013142706.23971-1-ffmpeg@haasn.xyz> <20231013142706.23971-3-ffmpeg@haasn.xyz> MIME-Version: 1.0 Content-Disposition: inline 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: On Fri, 13 Oct 2023 19:10:33 +0200 Andreas Rheinhardt wrote: > 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). There are two other designs I can think of: 1. Enumerate all possible combinations as a list. To avoid combinatoric explosion, setting any field to 'UNSPECIFIED' implies no restriction on that field. So the default (no list) would be equivalent to a list with a single entry containing values of UNSPECIFIED for every entry. 2. Provide a single function which merely checks if a given combination is supported or not. #2 would work for the short term but runs into the same risk of exponential explosion if we need to start finding a common format between different filters. So maybe #1 is the correct approach here. It would also simplify extending the filter API, as we would only need one set of list managing/merging/compat testing boilerplate for all of the colorspace metadata. I will try implementing #1 on a separate branch. _______________________________________________ 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".