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 07AB84309E for ; Fri, 20 May 2022 13:11:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C0F2D68B480; Fri, 20 May 2022 16:11:51 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8DFC868B234 for ; Fri, 20 May 2022 16:11:45 +0300 (EEST) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id BEC1CC000D for ; Fri, 20 May 2022 13:11:44 +0000 (UTC) Date: Fri, 20 May 2022 15:11:43 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220520131143.GU396728@pb2> References: <20220518151817.21270-1-leo.izen@gmail.com> <20220518182338.GR396728@pb2> <20220518182748.GS396728@pb2> <20220520102815.GT396728@pb2> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v4] avutil/csp: create avpriv API for colorspace structs 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: multipart/mixed; boundary="===============2578037742212759881==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2578037742212759881== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Chn8nxio6L/4biUD" Content-Disposition: inline --Chn8nxio6L/4biUD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ronald On Fri, May 20, 2022 at 07:26:56AM -0400, Ronald S. Bultje wrote: > Hi Michael, >=20 > On Fri, May 20, 2022 at 6:28 AM Michael Niedermayer > wrote: >=20 > > 1. exactly representing values > > >=20 > This isn't actually what I meant when I made the argument. If the spec sa= ys > "0.137", I'd expect to be able to git grep the source code for "0.137" and > find where it's defined. This is lost with AVRational, where it becomes { > 137, 1000 }. This may sound silly, but I find this helpful. >=20 > One way to address this is to add the exact value in a comment, like > "(AVRational) { 137, 1000 }, // 0.137". This isn't pretty but retains > grep-discoverability. We use fixed point numbers in multiple places without=20 loosing grep-discoverability for example libavcodec/mpegaudiotab.h: FIX(0.54119610014619701222), libavcodec/mpegaudiotab.h: FIX(1.3065629648763763537), libavcodec/mpegaudiotab.h: FIX(0.50979557910415917998), libavcodec/mpegaudiotab.h: FIX(2.5629154477415054814), libavcodec/mpegaudiotab.h: FIX(0.89997622313641556513), libavcodec/mpegaudiotab.h: FIX(0.60134488693504528634), libavcodec/mpegaudiotab.h: FIX(0.5024192861881556782), libavcodec/jfdctint_template.c:#define FIX_0_765366865 FIX(0.765366865) libavcodec/jfdctint_template.c:#define FIX_0_899976223 FIX(0.899976223) libavcodec/jfdctint_template.c:#define FIX_1_175875602 FIX(1.175875602) libavcodec/jfdctint_template.c:#define FIX_1_501321110 FIX(1.501321110) libavcodec/jfdctint_template.c:#define FIX_1_847759065 FIX(1.847759065) libavcodec/jfdctint_template.c:#define FIX_1_961570560 FIX(1.961570560) libavcodec/dcadata.c: SCALE(0.01112466771), SCALE(0.43016362190), SCALE(= 0.53190881014), SCALE(0.02678431384), libavcodec/dcadata.c: SCALE(0.01170534454), SCALE(0.43572667241), SCALE(= 0.52686679363), SCALE(0.02568206564), libavcodec/dcadata.c: SCALE(0.01230939943), SCALE(0.44127810001), SCALE(= 0.52177828550), SCALE(0.02461459488), libavcodec/dcadata.c: SCALE(0.01293735672), SCALE(0.44681602716), SCALE(= 0.51664537191), SCALE(0.02358125709), libavcodec/dcadata.c: SCALE(0.01358995494), SCALE(0.45233830810), SCALE(= 0.51147013903), SCALE(0.02258131653), libavcodec/dcadata.c: SCALE(0.01426773332), SCALE(0.45784294605), SCALE(= 0.50625455379), SCALE(0.02161412500), tests/utils.c: lum[0] =3D (FIX(0.29900) * r + FIX(0.58700) * g + tests/utils.c: FIX(0.11400) * b + ONE_HALF) >> SCALEB= ITS; tests/utils.c: lum[1] =3D (FIX(0.29900) * r + FIX(0.58700) * g + tests/utils.c: FIX(0.11400) * b + ONE_HALF) >> SCALEB= ITS; tests/utils.c: lum[0] =3D (FIX(0.29900) * r + FIX(0.58700) * g + tests/utils.c: FIX(0.11400) * b + ONE_HALF) >> SCALEB= ITS; tests/utils.c: lum[1] =3D (FIX(0.29900) * r + FIX(0.58700) * g + tests/utils.c: FIX(0.11400) * b + ONE_HALF) >> SCALEB= ITS; such a macro could produce a AVRational too easily (if wanted) the advantage over a comment is that a comment can be forgotten the argument for a macro cannot be forgotten and still succeed build thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin --Chn8nxio6L/4biUD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYoeTjAAKCRBhHseHBAsP q8v2AJ9T3zPO9LydpBYItTRRyou5OJeMFwCeNJk7Ehj+6nmC/cKTptx3u3MOtFE= =M+oL -----END PGP SIGNATURE----- --Chn8nxio6L/4biUD-- --===============2578037742212759881== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============2578037742212759881==--