From patchwork Tue May 3 06:18:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 35551 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a885:b0:7f:4be2:bd17 with SMTP id ca5csp251623pzb; Mon, 2 May 2022 23:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNVOtFjGvUYQPHEEXukCGdRFisDNTj64eqXzKl7RXkZBPzUnw9tD7cf7WZbS9v4MhFM4au X-Received: by 2002:a17:907:6d84:b0:6f4:94e2:e708 with SMTP id sb4-20020a1709076d8400b006f494e2e708mr1262231ejc.199.1651558755165; Mon, 02 May 2022 23:19:15 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u12-20020a50c04c000000b00425e3fadd59si13603648edd.96.2022.05.02.23.19.14; Mon, 02 May 2022 23:19:15 -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=@outlook.com header.s=selector1 header.b=kyNLdqP5; arc=fail (body hash mismatch); 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=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CA4A968B35B; Tue, 3 May 2022 09:19:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075024.outbound.protection.outlook.com [40.92.75.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A22868B186 for ; Tue, 3 May 2022 09:19:03 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hZQ2BDlvE7OE5gJ2PMBwQcq4No/vwf2umVW807tat+xyAklyDjo8GyIEw+qgSEch0omh6+gNH8XOpljSXlUaBH1wyK1KdLOEFSbjiIu6Lmb40uunCSSPsA3zic7cmQaFYvIWTqwiAJKon8jbKDtayVDcc81xSnr7wrKheBjFIedOznGG7gUaa48IsLO7OYzH2eq1azziYAJPex2JSWR88KhmcCvZOmjgfV8OkC8jaoiMMMbwRJNwcQA7dgJm2WDrzZaBy1I660cKK3eMchth+v5hILzyT3IyoqrzKcBeEpgpVj0Di4/N5l3e8DU/+KlDwSwY8lSQMbJs8sF25U6pmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pt96KkF5KMIu5uPvfDXAbntCuCIpGfJWQmIVyuMBQUI=; b=aDdsBHtLM3M7eKz6VdLkbDm62RNj3h5m88PjRrZO5BcQEEhpyd4GJIgthdWMvSPoQ5hd5d9kz8QWKtCBMwEnVIj7UAaEInvZZlOxBlFVS29WmvZzksQ1Bpgh7o8EeD3poEbjPgCVUWSthfpxsHwOsKC+Qk79E8mRIEi3JCA2TZj+qjcfJ9kH+yUlhO65ZeEHuDklzY1LOaLV2THGjBCo1XVUL/foYTJTLtY4arXSvgguDVJQCXDBVJuZnihjn/t3hfO6iR8SDkXaSSfr0ws1TPUn4Z5wQCFxpgGzfN8lYrN2y47I+bfDa1KkPuLaEd/SlTITezLStv5OcuEYTbiplQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pt96KkF5KMIu5uPvfDXAbntCuCIpGfJWQmIVyuMBQUI=; b=kyNLdqP5+2jj8XOAZ6slSbonc/NOXjN2Z+JOzqmAU76f4pKrndB0u+LkeOD7vf5Tu6OKOkZMCK283q/FR/cntXONzflL+7+lKxNhGkWVpkhCTGIRWPyhl48MP+a3+mgn1Gv/fg0ZQEsBlfDjp/J8LyiKKxx1uJgKxGCtCK4GPDsjzukeO8ypgbI0xa/aDN/E7wnxnxON3t6JFSzP0OGq3nsWuXJVDuQpaDZH3+cZ0PM2AnOXqbSe640pbnbnm1DFoyDRp95o8+Qka1R9O7f5duzxNGPtMorb/26g75VRV7Iel/2cQNyiwIO6p9dUQ7CLG8yarUz0Dg+wuV/l2yq+xQ== Received: from AS8PR01MB7944.eurprd01.prod.exchangelabs.com (2603:10a6:20b:373::5) by DB9PR01MB7292.eurprd01.prod.exchangelabs.com (2603:10a6:10:211::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Tue, 3 May 2022 06:19:01 +0000 Received: from AS8PR01MB7944.eurprd01.prod.exchangelabs.com ([fe80::1854:2c30:7ba1:c431]) by AS8PR01MB7944.eurprd01.prod.exchangelabs.com ([fe80::1854:2c30:7ba1:c431%6]) with mapi id 15.20.5206.024; Tue, 3 May 2022 06:19:01 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 3 May 2022 08:18:35 +0200 Message-ID: X-Mailer: git-send-email 2.32.0 X-TMN: [39etotG5NFlKTXVAlZv1W8zA4gK9a4Nz] X-ClientProxiedBy: ZR0P278CA0192.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:44::16) To AS8PR01MB7944.eurprd01.prod.exchangelabs.com (2603:10a6:20b:373::5) X-Microsoft-Original-Message-ID: <20220503061844.2184774-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e1ce8c9-4507-4647-a280-08da2ccccee3 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUfFs0p/ynZxoLjq6nuVP/rdu4BRHYC4zF1mKk2/Sng5Byfw9ESEMfkuDYTAqlGdbLjEdx0ttv/oJetGNP2gar0SL3aPR60eSfjo2MMxOykwxfWVg3b8tLrVkvpNMAGvAwINuvpKADd4/WjBcyjGtdQ4Xab78uKqb8Yg9YoZGvXvHXcmdbthEHwH/GfUZcnMPa2r6UAEqxlnEvg2MFklKszXCzsx6ZlEsc/+XGYtSeVe6pcTHn2HjmgjIWNHC9TQUW47WF4R93NO2O7udM4Js/0lI2BYPHLGXDI+yesCC7XA/zDqcTqeg4ZCah6erVNK/jMBLWhk+Hoh1E0vcUIZ7v+ZxnfMNiTdeDv96+7/d0pU2LZZkOwyWrNGSDTid25mgwnn4ajZmi4tOtiojgJJuMZTjmLW0RCXrdQHKgsAPWHDNkiT6hfMsWgNUmnshR3SOM5c7EgyUhwK7wzXTv/TwCkABZzuDgrGEjw6U5fbgyX7DoWALRXPkrAS7gafCG1RD4x2bRGVJvkIOVa3GNkEp9IpMQftVbyMyjp20200dDB2rzokXp85PDxIlcIIijwxBz6C0HuEifiYT5NFbiLNALDqD0R6r1AFQyFxmOHeCOo19W18Vlw+dO4Twt8I3FTRrBLFwiUFUhMm56L6+BY+/KGlg6iVEm9hNsJen985M4BQMeTSzYuYREwpZYftlvOlakKGLRfMBHfMURu3wwVN/6iw2ww5YuAmAc= X-MS-TrafficTypeDiagnostic: DB9PR01MB7292:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: erOOiZRugQ3h91ei05e5DcxAgjaZ1XcJfyoBlY9d76LEE/Tx/C5jYYfLRwJWu8FGUa8JQ9rrzvHy15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CrossTenant-AuthSource: AS8PR01MB7944.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2022 06:19:01.7177 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR01MB7292 Subject: [FFmpeg-devel] [PATCH 01/10] avfilter/af_afir: Only keep DSP stuff in header 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: EGZpmeh3MKwM Only the AudioFIRDSPContext and the functions for its initialization are needed outside of lavfi/af_afir.c. Also rename the header to af_afirdsp.h to reflect the change. Signed-off-by: Andreas Rheinhardt --- libavfilter/af_afir.c | 71 +++++++++++++++++++++- libavfilter/af_afir.h | 108 --------------------------------- libavfilter/af_afirdsp.h | 34 +++++++++++ libavfilter/x86/af_afir_init.c | 2 +- tests/checkasm/af_afir.c | 2 +- 5 files changed, 106 insertions(+), 111 deletions(-) delete mode 100644 libavfilter/af_afir.h create mode 100644 libavfilter/af_afirdsp.h diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index 72e77eda19..d7ae468428 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -30,8 +30,11 @@ #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "libavutil/float_dsp.h" +#include "libavutil/frame.h" #include "libavutil/intreadwrite.h" +#include "libavutil/log.h" #include "libavutil/opt.h" +#include "libavutil/rational.h" #include "libavutil/xga_font_data.h" #include "audio.h" @@ -39,7 +42,73 @@ #include "filters.h" #include "formats.h" #include "internal.h" -#include "af_afir.h" +#include "af_afirdsp.h" + +typedef struct AudioFIRSegment { + int nb_partitions; + int part_size; + int block_size; + int fft_length; + int coeff_size; + int input_size; + int input_offset; + + int *output_offset; + int *part_index; + + AVFrame *sumin; + AVFrame *sumout; + AVFrame *blockin; + AVFrame *blockout; + AVFrame *buffer; + AVFrame *coeff; + AVFrame *input; + AVFrame *output; + + AVTXContext **tx, **itx; + av_tx_fn tx_fn, itx_fn; +} AudioFIRSegment; + +typedef struct AudioFIRContext { + const AVClass *class; + + float wet_gain; + float dry_gain; + float length; + int gtype; + float ir_gain; + int ir_format; + float max_ir_len; + int response; + int w, h; + AVRational frame_rate; + int ir_channel; + int minp; + int maxp; + int nb_irs; + int selir; + + float gain; + + int eof_coeffs[32]; + int have_coeffs; + int nb_taps; + int nb_channels; + int nb_coef_channels; + int one2many; + + AudioFIRSegment seg[1024]; + int nb_segments; + + AVFrame *in; + AVFrame *ir[32]; + AVFrame *video; + int min_part_size; + int64_t pts; + + AudioFIRDSPContext afirdsp; + AVFloatDSPContext *fdsp; +} AudioFIRContext; static void fcmul_add_c(float *sum, const float *t, const float *c, ptrdiff_t len) { diff --git a/libavfilter/af_afir.h b/libavfilter/af_afir.h deleted file mode 100644 index cf00dbfc66..0000000000 --- a/libavfilter/af_afir.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2017 Paul B Mahol - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVFILTER_AFIR_H -#define AVFILTER_AFIR_H - -#include -#include - -#include "libavutil/tx.h" -#include "libavutil/float_dsp.h" -#include "libavutil/frame.h" -#include "libavutil/log.h" -#include "libavutil/rational.h" - -typedef struct AudioFIRSegment { - int nb_partitions; - int part_size; - int block_size; - int fft_length; - int coeff_size; - int input_size; - int input_offset; - - int *output_offset; - int *part_index; - - AVFrame *sumin; - AVFrame *sumout; - AVFrame *blockin; - AVFrame *blockout; - AVFrame *buffer; - AVFrame *coeff; - AVFrame *input; - AVFrame *output; - - AVTXContext **tx, **itx; - av_tx_fn tx_fn, itx_fn; -} AudioFIRSegment; - -typedef struct AudioFIRDSPContext { - void (*fcmul_add)(float *sum, const float *t, const float *c, - ptrdiff_t len); -} AudioFIRDSPContext; - -typedef struct AudioFIRContext { - const AVClass *class; - - float wet_gain; - float dry_gain; - float length; - int gtype; - float ir_gain; - int ir_format; - float max_ir_len; - int response; - int w, h; - AVRational frame_rate; - int ir_channel; - int minp; - int maxp; - int nb_irs; - int selir; - - float gain; - - int eof_coeffs[32]; - int have_coeffs; - int nb_taps; - int nb_channels; - int nb_coef_channels; - int one2many; - - AudioFIRSegment seg[1024]; - int nb_segments; - - AVFrame *in; - AVFrame *ir[32]; - AVFrame *video; - int min_part_size; - int64_t pts; - - AudioFIRDSPContext afirdsp; - AVFloatDSPContext *fdsp; - -} AudioFIRContext; - -void ff_afir_init(AudioFIRDSPContext *s); -void ff_afir_init_x86(AudioFIRDSPContext *s); - -#endif /* AVFILTER_AFIR_H */ diff --git a/libavfilter/af_afirdsp.h b/libavfilter/af_afirdsp.h new file mode 100644 index 0000000000..f72ab7cd02 --- /dev/null +++ b/libavfilter/af_afirdsp.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2017 Paul B Mahol + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_AFIRDSP_H +#define AVFILTER_AFIRDSP_H + +#include + +typedef struct AudioFIRDSPContext { + void (*fcmul_add)(float *sum, const float *t, const float *c, + ptrdiff_t len); +} AudioFIRDSPContext; + +void ff_afir_init(AudioFIRDSPContext *s); +void ff_afir_init_x86(AudioFIRDSPContext *s); + +#endif /* AVFILTER_AFIRDSP_H */ diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c index c37212c381..e53817b9c0 100644 --- a/libavfilter/x86/af_afir_init.c +++ b/libavfilter/x86/af_afir_init.c @@ -20,7 +20,7 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" -#include "libavfilter/af_afir.h" +#include "libavfilter/af_afirdsp.h" void ff_fcmul_add_sse3(float *sum, const float *t, const float *c, ptrdiff_t len); diff --git a/tests/checkasm/af_afir.c b/tests/checkasm/af_afir.c index b8a845db82..08c55dacfc 100644 --- a/tests/checkasm/af_afir.c +++ b/tests/checkasm/af_afir.c @@ -21,7 +21,7 @@ #include #include -#include "libavfilter/af_afir.h" +#include "libavfilter/af_afirdsp.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "checkasm.h"