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 C929044DC4 for ; Tue, 22 Nov 2022 21:17:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 13B3A68BB47; Tue, 22 Nov 2022 23:17:30 +0200 (EET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B253C680BE5 for ; Tue, 22 Nov 2022 23:17:23 +0200 (EET) Received: by mail-pl1-f174.google.com with SMTP id g10so14844229plo.11 for ; Tue, 22 Nov 2022 13:17:23 -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=afHG20t7TyX2FYmkWdcnp8LiUsBNhSZFI8++dKh1+s0=; b=SAIQcR002JXvvAoWP8/UR0KYX/BVcaGhBmOmVd7TkFkxuR8u3m6Xv8CP4PUs+ctrij tJc0IQ6yOvOsB9u/keCCrEsI32kMpnHiOz3aW9obAQdXcyaOJ54JQwyna+Z5RALFLUEz KBsTrdGWYcKvpjPsAvqZiEGcWRIzipQVy3AbELcXq9/EwHtrfbnuq3thNQf07bKbsOPI s7/ZXgRhVD0y1hBBW0+SfMwC9qm7bFdOaisCnM8GAGgfJto/n7dfN7JFMk6NBOuO+Rk4 uns8EIPMKBYglBzG0iCWpZbcc8jhHa/csfkwTR4gOJwViaUhxsSj4M/MMHR0EWeBil8k /D8g== 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=afHG20t7TyX2FYmkWdcnp8LiUsBNhSZFI8++dKh1+s0=; b=hzSb3n/14R8E0IfYhw+nwCwT43A9Ai+gNnrBcyGLD4gwV4Z/UlmGGF/tvTMTEbu+ZK 6qEei4a2en8J0Vny3YEx10MmQud2JcSU61VNhpARU0iT3OEWudXYYawygyI3f4NUA5r1 ECkuAwT+HQl0WzQ60cmbzdX9zxU3S4wEQFIIbL6KCNDHY4P4sO2GFUw9z28IUIvCSAy8 hxWj/f7r+S5iIVE2eTlRdkGo8xgD0VxXVyJjkRk1JYoINUWi9jmApF4itDt+ZfffgJjA LPpioe0kd+etGNSs6xPrdYyB3Jb5d3Tcs7bhfgYh9F8d05Y3SizONVStSVbt55nY8772 bxig== X-Gm-Message-State: ANoB5plfUuKiXf/f0J0gIjuu4F9tc3vzMWc5LqLdvUF5gt4QRweRGczt pKcJLHzigpqkAoAYPr17C9BxAOX62R+tCHXDJz1hH5KZS4w= X-Google-Smtp-Source: AA0mqf7EXidn8ujVCKqYod+crnE1ySuztbWnubrC92HgSU5kVG9Lh89FhYq6OWmPTxnzUlJId3cfoucN3Dph5FpDgXU= X-Received: by 2002:a17:902:d502:b0:186:9ef1:647e with SMTP id b2-20020a170902d50200b001869ef1647emr5667943plg.143.1669151841310; Tue, 22 Nov 2022 13:17:21 -0800 (PST) MIME-Version: 1.0 References: <20221121221146.426-1-mindmark@gmail.com> <20221121221146.426-2-mindmark@gmail.com> <20221122194247.GG710311@pb2> In-Reply-To: <20221122194247.GG710311@pb2> From: Mark Reid Date: Tue, 22 Nov 2022 13:17:09 -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 11:43 AM Michael Niedermayer 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. > thx > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > I have never wished to cater to the crowd; for what I know they do not > approve, and what they approve I do not know. -- Epicurus > _______________________________________________ > 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".