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 0982149D0A for ; Fri, 8 Mar 2024 13:44:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C8FA168CEC6; Fri, 8 Mar 2024 15:44:29 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5FE6E68C6BD for ; Fri, 8 Mar 2024 15:44:23 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1709905463; bh=O9LBGAGbDkymmFkjuSDDB7rnAs65EAuUPEi2A0thSgI=; h=Date:From:To:Subject:In-Reply-To:References:From; b=qzcoIZYqQOvgDEHfK+zPpaSiyrOVwnyzWvi8St15PbLrUo7ecCT5eISRvm3CqJ1/g CQOhZoGbNkX+x0pxE26R0nwRkuCPIHkUEihJdr4e16sYJmwNkcwq2eEYmI3YOLIHmf A26QiNEeg9ZWH2ykllzw76tqIUzPrm0c1+jiQzm8= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 177D140015 for ; Fri, 8 Mar 2024 14:44:23 +0100 (CET) Date: Fri, 8 Mar 2024 14:44:17 +0100 Message-ID: <20240308144417.GB30572@haasn.xyz> From: Niklas Haas To: ffmpeg-devel@ffmpeg.org In-Reply-To: <186f152d-122a-4400-b941-526c986d0c56@gmail.com> References: <20240308132108.28337-1-ffmpeg@haasn.xyz> <186f152d-122a-4400-b941-526c986d0c56@gmail.com> MIME-Version: 1.0 Content-Disposition: inline Subject: Re: [FFmpeg-devel] [PATCH v2 1/4] avcodec/aom_film_grain: add AOM film grain synthesis 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, 08 Mar 2024 10:31:28 -0300 James Almer wrote: > On 3/8/2024 10:21 AM, Niklas Haas wrote: > > From: Niklas Haas > > > > Implementation copied wholesale from dav1d, sans SIMD, under permissive > > license. This implementation was extensively verified to be bit-exact, > > so it serves as a much better starting point than trying to re-engineer > > this from scratch for no reason. (I also authored the original > > implementation in dav1d, so any "clean room" implementation would end up > > looking much the same, anyway) > > > > The notable changes I had to make while adapting this from the dav1d > > code-base to the FFmpeg codebase include: > > > > - reordering variable declarations to avoid triggering warnings > > - replacing several inline helpers by avutil equivalents > > - changing code that accesses frame metadata > > - replacing raw plane copying logic by av_image_copy_plane > > > > Apart from this, the implementation is basically unmodified. > > Do we want this to be public? Both as a struct and the decoding functions. > It could be used by libavfilter or even outside our libraries. The hevc > decoder would export the relevant T.35 SEI in the new struct if told to > not apply fg, like we already do in av1. I'm not sure if the AFGS1 struct itself needs to be public, since it is largely just a codec-internal wrapper for multiple param sets (for scalable codecs). If we want to add a public film grain synthesis helper, IMHO it should be a wrapper around both ff_aom_apply_film_grain *and* ff_h274_apply_film_grain, which directly ingests an AVFilmGrainParams and resolves to the correct implementation. So we can merge this series as-is and still add a public helper on top. Incidentally, there is a strong precedent here: dav1d.h exports dav1d_apply_grain() precisely for the reason that VLC needs to initialize the decoder *before* it knows whether to apply synthesis on GPU or CPU, so it has to set the equivalent of `-export_side_data film_grain` at init time and manually apply CPU film grain synthesis if it turns out that GPU fgs is unavailable. _______________________________________________ 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".