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 E8CC44342A for ; Wed, 13 Jul 2022 08:05:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B09A68B8C9; Wed, 13 Jul 2022 11:05:22 +0300 (EEST) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EE71868B778 for ; Wed, 13 Jul 2022 11:05:15 +0300 (EEST) Received: by mail-wr1-f52.google.com with SMTP id b26so14352764wrc.2 for ; Wed, 13 Jul 2022 01:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=8NOOdf1+TglT8G8iT4PuWHf1B10lcsoUqOEkHvIBFuk=; b=AUKzSRiL6Xl4hTErPjQU7J522xF2lYfaDXPDGcs3PwtEnmyjk8iyPdVont7wuuTnij do4XA1wLbjfH4mSsO/2SaJzhDMD7tPgzHXdQvEUB4ZmCgBpZe8Ed6Wq6zT+yNtCdO8L9 dzoxTf4CFy7D7H3kxe+cZ+7EgXRAq5Pe9nI5ngZyx+8EukArCxZn+9VOlISaesgZvDQl Lcb5p3BPTFmkQPzScapn4wqpHN20cQSJGrm+w+kzg2DuE8hXPKtFPLDOGXTnnKdPycNb uNReB8V0GobgS2g9nBNReET/cDd71b2IdvX63n+5ELCVITsOPYwduC0n+Wc86FXomkIx uLbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=8NOOdf1+TglT8G8iT4PuWHf1B10lcsoUqOEkHvIBFuk=; b=wU5yl0vCQL9MlFgY+b6YuFPUXUdXARcJ+m8JdO4EmyKKiyzjFl5jYG0AQEs6TBCalb 1Q8GpEEpy7XBF+j6KNbH54D6KNJpPFaA8BtneexOAl6RW8lJA8g018yfroo3nPVN+pgg 2q/GyQVt6rVVzBSeGTbnza3aaIOElzHhfl8IUQwmuA9UOl6rAhRq9CB1Db0Y0aM0k6nf bRAsbPgZEswiH9ubl1Tm7koiFRLMrzAG+eRhyrE2Xdi3JDxRBiLuiodw3gm/fpOpLirR 8brnBOXPY0mBvEPEL3QHZiAqY/cW5qVvFZ/L8jjA6nyOa9a6ANKm1WJdAfZNmDQavr7R EbZw== X-Gm-Message-State: AJIora+4YlN1j9+waJa2Csd6Vpf8hdIAHxx8TYPrDcT+3IXlHow27XFW fYEaQhhNARshkvxKOTziGjKBtjrUTU9UiT81ZRf1ZHvQKHI= X-Google-Smtp-Source: AGRyM1t3bNEXFBzrXOJU1m2PcV2zXCFnXSt8vwuaOtIu849vQwpg3W5r/+eEbG4roAYz2qV0U53LOmEPY/FPYUSBkpM= X-Received: by 2002:a05:6000:1d98:b0:21b:aead:9b6c with SMTP id bk24-20020a0560001d9800b0021baead9b6cmr1896209wrb.531.1657699514711; Wed, 13 Jul 2022 01:05:14 -0700 (PDT) MIME-Version: 1.0 References: <20220217100420.1113388-1-alankelly@google.com> In-Reply-To: From: Alan Kelly Date: Wed, 13 Jul 2022 10:05:03 +0200 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH v2 4/5] libswscale: Enable hscale_avx2 for all input sizes. 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: Pushing this back up to the top. This is required to enable the previous patch in this chain. Thanks On Fri, Apr 22, 2022 at 10:04 AM Alan Kelly wrote: > Ping! > > On Thu, Feb 17, 2022 at 11:04 AM Alan Kelly wrote: > >> ff_shuffle_filter_coefficients shuffles the tail as required. >> --- >> libswscale/utils.c | 19 ++++++++++++++++--- >> libswscale/x86/swscale.c | 6 ++---- >> 2 files changed, 18 insertions(+), 7 deletions(-) >> >> diff --git a/libswscale/utils.c b/libswscale/utils.c >> index 7c8e1bbdde..d818c9ce55 100644 >> --- a/libswscale/utils.c >> +++ b/libswscale/utils.c >> @@ -285,8 +285,7 @@ int ff_shuffle_filter_coefficients(SwsContext *c, int >> *filterPos, >> #if ARCH_X86_64 >> int i, j, k; >> int cpu_flags = av_get_cpu_flags(); >> - // avx2 hscale filter processes 16 pixel blocks. >> - if (!filter || dstW % 16 != 0) >> + if (!filter) >> return 0; >> if (EXTERNAL_AVX2_FAST(cpu_flags) && !(cpu_flags & >> AV_CPU_FLAG_SLOW_GATHER)) { >> if ((c->srcBpc == 8) && (c->dstBpc <= 14)) { >> @@ -298,9 +297,11 @@ int ff_shuffle_filter_coefficients(SwsContext *c, >> int *filterPos, >> } >> // Do not swap filterPos for pixels which won't be processed >> by >> // the main loop. >> - for (i = 0; i + 8 <= dstW; i += 8) { >> + for (i = 0; i + 16 <= dstW; i += 16) { >> FFSWAP(int, filterPos[i + 2], filterPos[i + 4]); >> FFSWAP(int, filterPos[i + 3], filterPos[i + 5]); >> + FFSWAP(int, filterPos[i + 10], filterPos[i + 12]); >> + FFSWAP(int, filterPos[i + 11], filterPos[i + 13]); >> } >> if (filterSize > 4) { >> // 16 pixels are processed at a time. >> @@ -314,6 +315,18 @@ int ff_shuffle_filter_coefficients(SwsContext *c, >> int *filterPos, >> } >> } >> } >> + // 4 pixels are processed at a time in the tail. >> + for (; i < dstW; i += 4) { >> + // 4 filter coeffs are processed at a time. >> + int rem = dstW - i >= 4 ? 4 : dstW - i; >> + for (k = 0; k + 4 <= filterSize; k += 4) { >> + for (j = 0; j < rem; ++j) { >> + int from = (i + j) * filterSize + k; >> + int to = i * filterSize + j * 4 + k * 4; >> + memcpy(&filter[to], &filterCopy[from], 4 * >> sizeof(int16_t)); >> + } >> + } >> + } >> } >> av_free(filterCopy); >> } >> diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c >> index 73869355b8..76f5a70fc5 100644 >> --- a/libswscale/x86/swscale.c >> +++ b/libswscale/x86/swscale.c >> @@ -691,10 +691,8 @@ switch(c->dstBpc){ \ >> >> if (EXTERNAL_AVX2_FAST(cpu_flags) && !(cpu_flags & >> AV_CPU_FLAG_SLOW_GATHER)) { >> if ((c->srcBpc == 8) && (c->dstBpc <= 14)) { >> - if (c->chrDstW % 16 == 0) >> - ASSIGN_AVX2_SCALE_FUNC(c->hcScale, c->hChrFilterSize); >> - if (c->dstW % 16 == 0) >> - ASSIGN_AVX2_SCALE_FUNC(c->hyScale, c->hLumFilterSize); >> + ASSIGN_AVX2_SCALE_FUNC(c->hcScale, c->hChrFilterSize); >> + ASSIGN_AVX2_SCALE_FUNC(c->hyScale, c->hLumFilterSize); >> } >> } >> >> -- >> 2.35.1.265.g69c8d7142f-goog >> >> _______________________________________________ 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".