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 CA4A3470B5 for ; Sat, 26 Aug 2023 18:03:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EFC3868C601; Sat, 26 Aug 2023 21:03:04 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8654068AFA8 for ; Sat, 26 Aug 2023 21:02:58 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id DF77D240002 for ; Sat, 26 Aug 2023 18:02:57 +0000 (UTC) Date: Sat, 26 Aug 2023 20:02:56 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230826180256.GS7802@pb2> References: <20230826132145.159744-1-stefasab@gmail.com> MIME-Version: 1.0 In-Reply-To: <20230826132145.159744-1-stefasab@gmail.com> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/2] lsws, lavfi: use sws_get_gaussian_vec 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="===============2070755200730754069==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2070755200730754069== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q2KDfiZqTI2kUwWN" Content-Disposition: inline --q2KDfiZqTI2kUwWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Stefano On Sat, Aug 26, 2023 at 03:21:44PM +0200, Stefano Sabatini wrote: > Use in place of deprecated sws_getGaussianVec. > --- > libavfilter/vf_sab.c | 17 +++++++++++++---- > libavfilter/vf_smartblur.c | 8 ++++---- > libswscale/utils.c | 32 ++++++++++++++------------------ > 3 files changed, 31 insertions(+), 26 deletions(-) >=20 [...] > @@ -2365,24 +2365,20 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, = float chromaGBlur, > if (!filter) > return NULL; > =20 > - if (lumaGBlur !=3D 0.0) { > - filter->lumH =3D sws_getGaussianVec(lumaGBlur, 3.0); > - filter->lumV =3D sws_getGaussianVec(lumaGBlur, 3.0); > - } else { > - filter->lumH =3D sws_getIdentityVec(); > - filter->lumV =3D sws_getIdentityVec(); > - } > - > - if (chromaGBlur !=3D 0.0) { > - filter->chrH =3D sws_getGaussianVec(chromaGBlur, 3.0); > - filter->chrV =3D sws_getGaussianVec(chromaGBlur, 3.0); > - } else { > - filter->chrH =3D sws_getIdentityVec(); > - filter->chrV =3D sws_getIdentityVec(); > - } > - > - if (!filter->lumH || !filter->lumV || !filter->chrH || !filter->chrV) > - goto fail; > +#define SET_FILTER_VECTOR(name_, standard_deviation_, quality_) \ > + if (standard_deviation_ !=3D 0.0) { = \ > + sws_get_gaussian_vec(&filter->name_, \ > + standard_deviation_, quality_); \ > + } else { \ > + filter->name_ =3D sws_getIdentityVec(); = \ > + } \ > + if (!filter->name_) \ > + goto fail; \ > + > + SET_FILTER_VECTOR(lumH, lumaGBlur, 3.0); > + SET_FILTER_VECTOR(lumV, lumaGBlur, 3.0); > + SET_FILTER_VECTOR(chrH, chromaGBlur, 3.0); > + SET_FILTER_VECTOR(chrV, chromaGBlur, 3.0); Doesnt the old code look cleaner/simpler ? The macro makes this a bit harder to read thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Take away the freedom of one citizen and you will be jailed, take away the freedom of all citizens and you will be congratulated by your peers in Parliament. --q2KDfiZqTI2kUwWN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZOo+TQAKCRBhHseHBAsP q0BnAJ9Bzh+8tthAK/WXrjFvQbgWNFr2xgCfVzHlkkJW/epLE8Ci1u9fPT38gCE= =TRtc -----END PGP SIGNATURE----- --q2KDfiZqTI2kUwWN-- --===============2070755200730754069== 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". --===============2070755200730754069==--