Message ID | 1587868623-97667-1-git-send-email-negomez@linux.microsoft.com |
---|---|
Headers | show
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 2DE9344949E for <patchwork@ffaux-bg.ffmpeg.org>; Sun, 26 Apr 2020 05:37:16 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F1F3F68C518; Sun, 26 Apr 2020 05:37:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E5B1368C1E0 for <ffmpeg-devel@ffmpeg.org>; Sun, 26 Apr 2020 05:37:09 +0300 (EEST) Received: from linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net (linux.microsoft.com [13.77.154.182]) by linux.microsoft.com (Postfix) with ESMTPSA id 9624420B4737 for <ffmpeg-devel@ffmpeg.org>; Sat, 25 Apr 2020 19:37:08 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9624420B4737 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1587868628; bh=EmDGygqX5RS1ke2MVmkGgf4weXiqXHQD1ZPZWoQ69AI=; h=From:To:Subject:Date:From; b=lX00I5m4GS4As4U7IPy9IyZzLfDlL2vc2kHL7xJM5Bwt/w9SZki6LJzTY/WjuB1Gk VfPohcLFexB+bdu2Sc4UTZqSLkpcGJipWpxBb37/7W+Ldc++JwbmMjyyjEjgzTVkzd wMlkDnvPFStsYCAjia2zG0NvnVcPiGOq5D41XP3c= From: Nelson Gomez <negomez@linux.microsoft.com> To: ffmpeg-devel@ffmpeg.org Date: Sat, 25 Apr 2020 19:37:00 -0700 Message-Id: <1587868623-97667-1-git-send-email-negomez@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH v3 0/3] swscale: add AVX2 version of yuv2nv12cX X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> |
From: Nelson Gomez <nelson.gomez@microsoft.com> v3: - Fixed x86_32 compilation v2: [2] - Addressing comments James left on iter. 1 - Cleaned up how dither gets read to avoid using stack space v1: [1] [1] http://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/261313.html [2] http://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/261346.html This patchset aims to optimize yuv2nv12cX_c for Intel/AMD chips by adding an AVX2 implementation of it. To support this change, the typedef declaration for yuv2interleavedX_fn has been changed to pass two additional parameters for chrDither8 and dstFormat rather than passing a pointer to the entire SwsContext. Output is bit-identical to the software implementation. Patchset validated on an Intel Xeon W-2133, Core i7-8650U, and an AMD Ryzen 1700. Passes fate tests; this patch is exercised by fate-filter-pixdesc-nv{12,21,24,42}. Benchmarks measured on the W-2133. Flags used are: -benchmark -i /dev/shm/benchmark.mp4 -pix_fmt nv42 -f null - Benchmark material is a yuv420p file: http://linux.microsoft.com/~negomez/ffmpeg/yuv420p-benchmark.mp4 Results: * Single-threaded conversion: +95% fps -cpuflags -avx2 -threads 1: frame= 9959 fps=114 q=-0.0 Lsize=N/A time=00:05:32.29 bitrate=N/A speed=3.79x bench: utime=87.648s stime=0.060s rtime=87.709s bench: maxrss=35020kB -cpuflags all -threads 1: frame= 9959 fps=222 q=-0.0 Lsize=N/A time=00:05:32.29 bitrate=N/A speed=7.39x bench: utime=44.900s stime=0.040s rtime=44.941s bench: maxrss=33048kB * Multi-threaded conversion: +197% fps -cpuflags -avx2: frame= 9959 fps=159 q=-0.0 Lsize=N/A time=00:05:32.29 bitrate=N/A speed=5.3x bench: utime=90.381s stime=0.430s rtime=62.663s bench: maxrss=77420kB -cpuflags all: frame= 9959 fps=473 q=-0.0 Lsize=N/A time=00:05:32.29 bitrate=N/A speed=15.8x bench: utime=48.625s stime=0.459s rtime=21.058s bench: maxrss=78500kB Nelson Gomez (3): swscale: make yuv2interleavedX more asm-friendly swscale/x86/output: add AVX2 version of yuv2nv12cX swscale: cosmetic fixes libswscale/output.c | 19 ++--- libswscale/swscale_internal.h | 6 +- libswscale/vscale.c | 2 +- libswscale/x86/output.asm | 126 +++++++++++++++++++++++++++++++++- libswscale/x86/swscale.c | 28 ++++++++ 5 files changed, 168 insertions(+), 13 deletions(-)