From patchwork Wed Aug 25 19:24:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 29777 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp839366iov; Wed, 25 Aug 2021 12:25:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk2Li0/oSOnEHin3a3fgtpl+craob3uvsnSeWT0AYcZXeNyp5ffmBHkjNdBaSaJrgTfBj3 X-Received: by 2002:a17:906:1789:: with SMTP id t9mr229125eje.61.1629919499825; Wed, 25 Aug 2021 12:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629919499; cv=none; d=google.com; s=arc-20160816; b=vGSn8cbOOhYEWboXCi70fMLGNt1qCW4j6kwzHvnRaRgUohx+WBPN31dEcAr781FSqQ sdqnFodOFa78pHVSgR5yE20pKQTsOZds2+tdYT836Y8VgUQOj9aF9xQBBYf3/c+vVlrh n/pADh+MfAePIVnUaT3/RPDGsPd/yu4z9R6eRQgug74R90ef2NDWtVfg0C1MjVrCPZZV Ff15jxGlhzpCtKPPjE8zQxginQNhjvJ6MjG/kmn6t7FUBa8JxNK5IIpxlxw0I5NedoHP +qD/I0gy3NRDGG//TNCOn1gYYarzNBzdcbyAEWQDwkdT1sz7CXRfTBjAxerTZAx0mLrS 7wdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:to:from:date:dkim-signature:delivered-to; bh=cDyfYmA1OOhShP3xQzExRyYhJZlVAL6v8oj5pLWGL7I=; b=absdL2V2F1bbsdZNylh6tBaQ/fBdvmrfiOOuB9Ouj6EC28q3ydMPLMliYdeFlpavCX EkgkTPfzln6SdITZ0wnn0v/0CniJCpMeo0KeXHngKctwnrx5kiUqntynB9I6acv8y27D 7iAvxH7jWUYiU5CDjafj6QBHHpZgeM318a9Hhui2o4HbYlyH/e0dNl/dsLFzlm7Tf3ry IDG0rnb+VOXuawPzzMWj+MRq9nka98mPH7BpIFTRYtCHl7eOWj4m+WOSndgDVJQVK4Ey kYSA7CEFaQkjKxBkNyMdBIlwQlozrABSIYwey/cSqMemhyOBDMbGBvvK+yGnRYTWSwUp /RuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b=otoJLjth; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x2si745808ejy.297.2021.08.25.12.24.59; Wed, 25 Aug 2021 12:24:59 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b=otoJLjth; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3D68168A10A; Wed, 25 Aug 2021 22:24:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9ECD0688093 for ; Wed, 25 Aug 2021 22:24:49 +0300 (EEST) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id 369F410601FD for ; Wed, 25 Aug 2021 19:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1629919489; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=dakB49JvKGzf7GCTpT6OvXS9FAY3PVtDL8HFRlq10Qc=; b=otoJLjthqUnBlmYwHSHij8f06CIpg8emy31aJX1zWJ5JVev3XrA3bS6YXMcKC+MR zQ4n/psy9TlZcJ+bk48pDdU7ttzCG/ppPaXgok9sUM+6JTD6R3PzDWQT/BlVV6+eXRJ bevTAMdGWGIo+zF7w1e5WxzfWCyWIPw3advN/JbjhPvSKUPkjO4DYFcSKLSu7suZBqF qvxMdY/k7h4aU6JgIQahD3I78RDF1K4yb5pirehFHjokbsgLrFo4cr/OrO5kdebfLqN JYwL1opN0QSxo1VTLaGPmAvIRMwWIVX1/L5XB6xkhOBjdy3yISyRgs711Met64qbuwg j9cYsJr24g== Date: Wed, 25 Aug 2021 21:24:49 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] h274: remove optimization pragma 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ulZW2Bx/msql This results in warnings on compilers which don't support it, objections were raised during the review process about it but went unnoticed, and the speed benefit is highly compiler and version specific, and also not very critical. We generally hand-write assembly to optimize loops like that, rather than use compiler magic, and for 40% best case scenario, it's simply not worth it. Plus, tree vectorization is still problematic with GCC and disabled by default for a good reason, so enabling it locally is sketchy. Patch attached. Subject: [PATCH] h274: remove optimization pragma This results in warnings on compilers which don't support it, objections were raised during the review process about it but went unnoticed, and the speed benefit is highly compiler and version specific, and also not very critical. We generally hand-write assembly to optimize loops like that, rather than use compiler magic, and for 40% best case scenario, it's simply not worth it. Plus, tree vectorization is still problematic with GCC and disabled by default for a good reason, so enabling it locally is sketchy. --- libavcodec/h274.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libavcodec/h274.c b/libavcodec/h274.c index 0efc00ca1d..5e2cf150ea 100644 --- a/libavcodec/h274.c +++ b/libavcodec/h274.c @@ -30,10 +30,6 @@ #include "h274.h" -// The code in this file has a lot of loops that vectorize very well, this is -// about a 40% speedup for no obvious downside. -#pragma GCC optimize("tree-vectorize") - static const int8_t Gaussian_LUT[2048+256]; static const uint32_t Seed_LUT[256]; static const int8_t R64T[64][64];