From patchwork Fri Jan 29 05:22:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25249 Return-Path: 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 7690C44B9D9 for ; Fri, 29 Jan 2021 07:33:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5993C68A77A; Fri, 29 Jan 2021 07:33:47 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67462680A68 for ; Fri, 29 Jan 2021 07:33:41 +0200 (EET) Received: by mail-ej1-f41.google.com with SMTP id kg20so11235891ejc.4 for ; Thu, 28 Jan 2021 21:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CAJ9dv4ewUZKVvjGG10PHhPUE8ruIZx1FVOfdwC/ywU=; b=fhjJ5blxzlEt1RLuPyQFJIfCvDhHnlEI6nQLDMsuyAUINRl9tpnBJH7cm7u22xZYjh JmY0+o7OZzpTvcwuzpfGhdCigLUAkyqWKwrqxlxsdH+I2tUo8vuL/gjgT4HFBlTiJBdI 5Z7xt3hw9n9oou5phF/GVbcyrppXSWlDi0CeVGQuDhR8sT3KG+k09A753p5dVZ/Yg0x1 WYR1gRBNsSKqiKDp0wqT7rrLFoaKWFJ61hTzzCgVL1LQK0cp5mDGrEzEqZJtRHXIumnn D/J4fwlZxjauKRkgUB8rClJH2pF7I9JVfStfaYpqz0A/XjFRlWMaJC2GmxaBTH+1LPbx fjbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CAJ9dv4ewUZKVvjGG10PHhPUE8ruIZx1FVOfdwC/ywU=; b=n8agEPjuTerQXOBvtAh7DyFuJyJOSKyTUZxAok29BvvWkru4P0RuR3QkzLZhlTZ75M k5spcpEPyf2q1ZbxDS6tgf+7XiFdy6zFnzVOEXVg0Jyyczv3IPPe9MZAeWH0uilPKtNp d2+W7xH77GU2LR51w22MrAXPg0F+tMAqPF8tyBgrSv3VVlaNWlA++NiCKStb5Tsomwl/ HZKItPVNDlf4Osd7PJvXoHACvqJS686Qv9P8DKXbmwIXc4qX81GLkzz/1BaEGmTtw+nT ZlJF3cfhrkcPaluFR6ZF2JHHSdWMCLMgX0eLSptLHwnBuzHvChCLZKlhu5SIYoS0am/O CkVw== X-Gm-Message-State: AOAM532Zobgo2xSscpg4+hXLRd263lrBI7ASSgbUdFUZTt+718VGFnqq jTH/fPXzH7WG3yL/UiVKesFXwhUzUao= X-Google-Smtp-Source: ABdhPJwlJHMiGtcjkcXbGxt0zL+HRKfy1JzJKm3mLylRWegfhCJcwPzLbp7vBe6pdKwvPlv5tbdEGw== X-Received: by 2002:a5d:6510:: with SMTP id x16mr2369342wru.175.1611897975908; Thu, 28 Jan 2021 21:26:15 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id d13sm10068611wrx.93.2021.01.28.21.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 21:26:15 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Jan 2021 06:22:51 +0100 Message-Id: <20210129052302.3124447-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> References: <20210129052302.3124447-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/13] avcodec/fft_template: Avoid useless function X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" ff_init_ff_cos_tabs is only used for the floating point FFT and only if hardcoded tables are disabled. Signed-off-by: Andreas Rheinhardt --- libavcodec/fft.h | 16 ++++++++-------- libavcodec/fft_template.c | 10 ++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/libavcodec/fft.h b/libavcodec/fft.h index 5ca2d18432..e03ca01abf 100644 --- a/libavcodec/fft.h +++ b/libavcodec/fft.h @@ -109,8 +109,16 @@ struct FFTContext { #if CONFIG_HARDCODED_TABLES #define COSTABLE_CONST const +#define ff_init_ff_cos_tabs(index) #else #define COSTABLE_CONST +#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs) + +/** + * Initialize the cosine table in ff_cos_tabs[index] + * @param index index in ff_cos_tabs array of the table to initialize + */ +void ff_init_ff_cos_tabs(int index); #endif #define COSTABLE(size) \ @@ -132,14 +140,6 @@ extern COSTABLE(65536); extern COSTABLE(131072); extern COSTABLE_CONST FFTSample* const FFT_NAME(ff_cos_tabs)[18]; -#define ff_init_ff_cos_tabs FFT_NAME(ff_init_ff_cos_tabs) - -/** - * Initialize the cosine table in ff_cos_tabs[index] - * @param index index in ff_cos_tabs array of the table to initialize - */ -void ff_init_ff_cos_tabs(int index); - #define ff_fft_init FFT_NAME(ff_fft_init) #define ff_fft_end FFT_NAME(ff_fft_end) diff --git a/libavcodec/fft_template.c b/libavcodec/fft_template.c index 2d05990ca9..3012372a74 100644 --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c @@ -113,6 +113,10 @@ static CosTabsInitOnce cos_tabs_init_once[] = { { init_ff_cos_tabs_131072, AV_ONCE_INIT }, }; +av_cold void ff_init_ff_cos_tabs(int index) +{ + ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func); +} #endif COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = { NULL, NULL, NULL, NULL, @@ -148,12 +152,6 @@ static int split_radix_permutation(int i, int n, int inverse) else return split_radix_permutation(i, m, inverse)*4 - 1; } -av_cold void ff_init_ff_cos_tabs(int index) -{ -#if (!CONFIG_HARDCODED_TABLES) && (!FFT_FIXED_32) - ff_thread_once(&cos_tabs_init_once[index].control, cos_tabs_init_once[index].func); -#endif -} static const int avx_tab[] = { 0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15