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 2545D44DCA for ; Tue, 22 Nov 2022 22:43:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 587EA68BB47; Wed, 23 Nov 2022 00:43:29 +0200 (EET) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E3F9668BA5C for ; Wed, 23 Nov 2022 00:43:22 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 1DF6B1C0006 for ; Tue, 22 Nov 2022 22:43:21 +0000 (UTC) Date: Tue, 22 Nov 2022 23:43:21 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20221122224321.GH710311@pb2> References: <20221121221146.426-1-mindmark@gmail.com> <20221121221146.426-2-mindmark@gmail.com> <20221122194247.GG710311@pb2> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v4 1/4] swscale/input: add rgbaf32 input support 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="===============0270798396425701340==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============0270798396425701340== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9jHkwA2TBA/ec6v+" Content-Disposition: inline --9jHkwA2TBA/ec6v+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 22, 2022 at 01:17:09PM -0800, Mark Reid wrote: > On Tue, Nov 22, 2022 at 11:43 AM Michael Niedermayer > wrote: >=20 > > On Mon, Nov 21, 2022 at 02:11:43PM -0800, mindmark@gmail.com wrote: > > > From: Mark Reid > > > > > > --- > > > libswscale/input.c | 120 +++++++++++++++++++++++++++++++++++++++++++= ++ > > > libswscale/utils.c | 6 +++ > > > 2 files changed, 126 insertions(+) > > > > > > diff --git a/libswscale/input.c b/libswscale/input.c > > > index d5676062a2..a305be5ac2 100644 > > > --- a/libswscale/input.c > > > +++ b/libswscale/input.c > > > @@ -1284,6 +1284,96 @@ static void rgbaf16##endian_name##ToA_c(uint8_t > > *_dst, const uint8_t *_src, cons > > > rgbaf16_funcs_endian(le, 0) > > > rgbaf16_funcs_endian(be, 1) > > > > > > +#define rdpx(src) (is_be ? av_int2float(AV_RB32(&src)): > > av_int2float(AV_RL32(&src))) > > > + > > > +static av_always_inline void rgbaf32ToUV_endian(uint16_t *dstU, > > uint16_t *dstV, int is_be, > > > + const float *src, int > > width, > > > + int32_t *rgb2yuv, int > > comp) > > > +{ > > > + int32_t ru =3D rgb2yuv[RU_IDX], gu =3D rgb2yuv[GU_IDX], bu =3D > > rgb2yuv[BU_IDX]; > > > + int32_t rv =3D rgb2yuv[RV_IDX], gv =3D rgb2yuv[GV_IDX], bv =3D > > rgb2yuv[BV_IDX]; > > > + int i; > > > + for (i =3D 0; i < width; i++) { > > > + int r =3D lrintf(av_clipf(65535.0f * rdpx(src[i*comp+0]), 0.= 0f, > > 65535.0f)); > > > + int g =3D lrintf(av_clipf(65535.0f * rdpx(src[i*comp+1]), 0.= 0f, > > 65535.0f)); > > > + int b =3D lrintf(av_clipf(65535.0f * rdpx(src[i*comp+2]), 0.= 0f, > > 65535.0f)); > > > + > > > + dstU[i] =3D (ru*r + gu*g + bu*b + (0x10001<<(RGB2YUV_SHIFT-1= ))) > > >> RGB2YUV_SHIFT; > > > + dstV[i] =3D (rv*r + gv*g + bv*b + (0x10001<<(RGB2YUV_SHIFT-1= ))) > > >> RGB2YUV_SHIFT; > > > + } > > > +} > > > > > > > > > > > > > + > > > +static av_always_inline void rgbaf32ToY_endian(uint16_t *dst, const > > float *src, int is_be, > > > + int width, int32_t > > *rgb2yuv, int comp) > > > +{ > > > + int32_t ry =3D rgb2yuv[RY_IDX], gy =3D rgb2yuv[GY_IDX], by =3D > > rgb2yuv[BY_IDX]; > > > + int i; > > > + for (i =3D 0; i < width; i++) { > > > + int r =3D lrintf(av_clipf(65535.0f * rdpx(src[i*comp+0]), 0.= 0f, > > 65535.0f)); > > > + int g =3D lrintf(av_clipf(65535.0f * rdpx(src[i*comp+1]), 0.= 0f, > > 65535.0f)); > > > + int b =3D lrintf(av_clipf(65535.0f * rdpx(src[i*comp+2]), 0.= 0f, > > 65535.0f)); > > > + > > > + dst[i] =3D (ry*r + gy*g + by*b + (0x2001<<(RGB2YUV_SHIFT-1))= ) >> > > RGB2YUV_SHIFT; > > > + } > > > +} > > > > I thought you would post a patchset that in the end has 1 lrintf/av_cli= pf > > for a function like this not 3 > > Just asking as you arent saying this is temporary in this set nor why i= ts > > left liek this nor does it include the factorization of these operations > > > > > Sorry I must have misunderstood. I was hoping I could leave it like this > temporarily as it matches the planar f32 version and address the > factorization separate patchset. you can, i just want to make sure its not forgotten. Maybe you can add some note to the commit message that this will be addressed in a future pachset thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If the United States is serious about tackling the national security threat= s=20 related to an insecure 5G network, it needs to rethink the extent to which = it values corporate profits and government espionage over security.-Bruce Schn= eier --9jHkwA2TBA/ec6v+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCY31QgQAKCRBhHseHBAsP q9/eAKCSkRsDmhvNSIDwbn05dqFZprvcmgCffxgN1easgL7X9EIcdgb871PTLdE= =EWXj -----END PGP SIGNATURE----- --9jHkwA2TBA/ec6v+-- --===============0270798396425701340== 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". --===============0270798396425701340==--