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 ESMTPS id 5B33348C9D for ; Wed, 19 Feb 2025 21:18:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8683368C3D0; Wed, 19 Feb 2025 23:18:34 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F2DA668BD47 for ; Wed, 19 Feb 2025 23:18:27 +0200 (EET) Received: from haasn.dev (unknown [10.30.1.1]) by haasn.dev (Postfix) with ESMTP id 9A59C403BC for ; Wed, 19 Feb 2025 22:18:27 +0100 (CET) Date: Wed, 19 Feb 2025 22:18:27 +0100 Message-ID: <20250219221827.GC2840440@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: <85d10abe-5990-4dd8-8f10-a5a4b06a24e0@gmail.com> References: <20250219204550.2826561-1-ffmpeg@haasn.xyz> <20250219204550.2826561-4-ffmpeg@haasn.xyz> <85d10abe-5990-4dd8-8f10-a5a4b06a24e0@gmail.com> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH 04/12] avcodec/avcodec: add AVCodecContext.alpha_mode 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 Wed, 19 Feb 2025 18:04:18 -0300 James Almer wrote: > On 2/19/2025 5:45 PM, Niklas Haas wrote: > > From: Niklas Haas > > > > Following in the footsteps of the previous commit, this commit adds the > > new fields to AVCodecContext so we can start properly setting it on codecs, > > as well as limiting the list of supported options to detect a format mismatch > > during encode. > > > > This commit also sets up the necessary infrastructure to start using the > > newly added field in all codecs. > > --- > > doc/APIchanges | 4 ++++ > > doc/codecs.texi | 8 ++++++++ > > libavcodec/avcodec.c | 6 ++++++ > > libavcodec/avcodec.h | 8 ++++++++ > > libavcodec/codec_internal.h | 5 +++++ > > libavcodec/codec_par.c | 3 +++ > > libavcodec/codec_par.h | 5 +++++ > > libavcodec/decode.c | 2 ++ > > libavcodec/options_table.h | 5 +++++ > > libavcodec/version.h | 4 ++-- > > 10 files changed, 48 insertions(+), 2 deletions(-) > > > > [...] > > > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h > > index 47da41b0ad..32f853bc54 100644 > > --- a/libavcodec/options_table.h > > +++ b/libavcodec/options_table.h > > @@ -358,6 +358,11 @@ static const AVOption avcodec_options[] = { > > {"bottomleft", "Bottom-left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_BOTTOMLEFT }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, > > {"bottom", "Bottom", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_BOTTOM }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, > > {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, > > +{"alpha_mode", "alpha mode", OFFSET(alpha_mode), AV_OPT_TYPE_INT, {.i64 = AVALPHA_MODE_UNSPECIFIED }, 0, INT_MAX, V|E|D, .unit = "alpha_mode_type"}, > > Should it have the D flag if it's only settable by the user in encoding > scenarios? I'm not sure. I was using the same flags as colorspace, color_trc, chroma_loc, etc. They all seem similar in principle. I suppose that, for codecs which have ambiguous / absent tagging, it makes sense for the user to set this field? As a side note, I'm still unsure which codecs support what alpha modes. From what I understand, PNG is always straight, TIFF and JPEG-XL supports both (with tagging?), but I'm not sure about any of the H.26x codecs, OpenEXR, WebM etc. > > > +{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVALPHA_MODE_UNSPECIFIED }, 0, 0, V|E|D, .unit = "alpha_mode_type"}, > > +{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVALPHA_MODE_UNSPECIFIED }, 0, 0, V|E|D, .unit = "alpha_mode_type"}, > > +{"premultiplied", "Premultiplied", 0, AV_OPT_TYPE_CONST, {.i64 = AVALPHA_MODE_PREMULTIPLIED }, 0, 0, V|E|D, .unit = "alpha_mode_type"}, > > +{"straight", "Straight", 0, AV_OPT_TYPE_CONST, {.i64 = AVALPHA_MODE_STRAIGHT }, 0, 0, V|E|D, .unit = "alpha_mode_type"}, > > {"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX }, > > {"slices", "set the number of slices, used in parallelized encoding", OFFSET(slices), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|E}, > > {"thread_type", "select multithreading type", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, {.i64 = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|A|E|D, .unit = "thread_type"}, > > diff --git a/libavcodec/version.h b/libavcodec/version.h > > index 62e7eba3db..0ef6c991f3 100644 > > --- a/libavcodec/version.h > > +++ b/libavcodec/version.h > > @@ -29,8 +29,8 @@ > > > > #include "version_major.h" > > > > -#define LIBAVCODEC_VERSION_MINOR 33 > > -#define LIBAVCODEC_VERSION_MICRO 102 > > +#define LIBAVCODEC_VERSION_MINOR 34 > > +#define LIBAVCODEC_VERSION_MICRO 100 > > > > #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ > > LIBAVCODEC_VERSION_MINOR, \ > > _______________________________________________ > 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". _______________________________________________ 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".