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 4FA6244D8D for ; Wed, 23 Nov 2022 02:07:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7D5E68BB9A; Wed, 23 Nov 2022 04:07:42 +0200 (EET) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5407668B389 for ; Wed, 23 Nov 2022 04:07:36 +0200 (EET) Received: by mail-pg1-f177.google.com with SMTP id b62so15633167pgc.0 for ; Tue, 22 Nov 2022 18:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=3beess2999v+TwFQmFFXyR2KiaRBzzS5FdPLlIz7BMY=; b=kWxCwz1zjZYQAcaOUPEoO6GwyJxoWkr2GXvhSK3DtY1TFTI6lZD36OjjI/HaTkdGEi AU+U5kfvkDHbaRkJMYwAPuYd2YSOCYUvQC43T2TnHIhLqz5tJLRTeJFoHw95icFRyq2t 05yLgjHYG8XMHm5Y5/pmnAEKCLw1u0RlOF2nmYdKwzdx8R0tdSI5hcpOeFFnMWWekJGC mKQDSnHXhTqjLvhI1F9xXM6xY+1xUt61BL5L5WK6eSD/i11h9AIzhJneFRLMYDoCWTZq Zg3AjF6EEMEdggUxrA/E2Ln9rvP/1t8GnNr+0DD9swv7wQav48SsHsmHVodnv36isRzD B39A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3beess2999v+TwFQmFFXyR2KiaRBzzS5FdPLlIz7BMY=; b=XTA6QZPiX2f1elSHboIXW48hesuHE3M2lrwGO9Fch0j14gqfFnIXUqXuruBEInxJQf z2WoxyVkW7fqIaDrJdJEaWHCmWBEjDLg7C+JMGk0RWJrxNL/sJ2W0XfYXPf3EOlzwdpa 6pCctQIVlIQCtkwWP6T/HPoMq48kHNXDNSsovvhyfWIDkB6jiXA7SxwYfDPQ4kJnLjYi QFre2vPIIA0Jq5bByFWqy+8JE6fqWKiXaFXFLJ8+1oQIsoDoyPlvzNidCDlBYgOTj3Lk nd1on35NFGM2OrmR3GWgCNCTHKCCM2UXwV68hB+B12tGB5j9Qh29MyjK1JElFrDcynwe 0UFw== X-Gm-Message-State: ANoB5pnJk3Hnv26H+gUwnfLwv71quswI1ULmZ6b0wO0ByOFVoOeEThL3 za5Lw36hnQs99Qzd4iT6sg+aln+VaycNhXE95xUKkZTu X-Google-Smtp-Source: AA0mqf7kM+u+60C3pmT+j9u2zcg4KCJYqMutc4o7tqXDLfGz33DuV3tpOowm5GbcR22JcsKCMKAy+D+4ycisVeSYQzM= X-Received: by 2002:a63:f301:0:b0:45f:88b2:1762 with SMTP id l1-20020a63f301000000b0045f88b21762mr23641035pgh.341.1669169253271; Tue, 22 Nov 2022 18:07:33 -0800 (PST) MIME-Version: 1.0 References: <20221121221146.426-1-mindmark@gmail.com> <20221121221146.426-2-mindmark@gmail.com> <20221122194247.GG710311@pb2> <20221122224321.GH710311@pb2> In-Reply-To: <20221122224321.GH710311@pb2> From: Mark Reid Date: Tue, 22 Nov 2022 18:07:20 -0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: 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 Tue, Nov 22, 2022 at 2:43 PM Michael Niedermayer wrote: > On Tue, Nov 22, 2022 at 01:17:09PM -0800, Mark Reid wrote: > > On Tue, Nov 22, 2022 at 11:43 AM Michael Niedermayer < > michael@niedermayer.cc> > > wrote: > > > > > 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 = rgb2yuv[RU_IDX], gu = rgb2yuv[GU_IDX], bu = > > > rgb2yuv[BU_IDX]; > > > > + int32_t rv = rgb2yuv[RV_IDX], gv = rgb2yuv[GV_IDX], bv = > > > rgb2yuv[BV_IDX]; > > > > + int i; > > > > + for (i = 0; i < width; i++) { > > > > + int r = lrintf(av_clipf(65535.0f * rdpx(src[i*comp+0]), > 0.0f, > > > 65535.0f)); > > > > + int g = lrintf(av_clipf(65535.0f * rdpx(src[i*comp+1]), > 0.0f, > > > 65535.0f)); > > > > + int b = lrintf(av_clipf(65535.0f * rdpx(src[i*comp+2]), > 0.0f, > > > 65535.0f)); > > > > + > > > > + dstU[i] = (ru*r + gu*g + bu*b + > (0x10001<<(RGB2YUV_SHIFT-1))) > > > >> RGB2YUV_SHIFT; > > > > + dstV[i] = (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 = rgb2yuv[RY_IDX], gy = rgb2yuv[GY_IDX], by = > > > rgb2yuv[BY_IDX]; > > > > + int i; > > > > + for (i = 0; i < width; i++) { > > > > + int r = lrintf(av_clipf(65535.0f * rdpx(src[i*comp+0]), > 0.0f, > > > 65535.0f)); > > > > + int g = lrintf(av_clipf(65535.0f * rdpx(src[i*comp+1]), > 0.0f, > > > 65535.0f)); > > > > + int b = lrintf(av_clipf(65535.0f * rdpx(src[i*comp+2]), > 0.0f, > > > 65535.0f)); > > > > + > > > > + dst[i] = (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_clipf > > > for a function like this not 3 > > > Just asking as you arent saying this is temporary in this set nor why > its > > > 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 > > Okay, I'll add a note to the commit message and I'll add a comment to the code too. > thx > > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > If the United States is serious about tackling the national security > threats > related to an insecure 5G network, it needs to rethink the extent to which > it > values corporate profits and government espionage over security.-Bruce > Schneier > _______________________________________________ > 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".