From patchwork Fri May 24 08:37:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 49201 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp1573242vqf; Fri, 24 May 2024 01:38:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVm39yYJ+yihm9JUzXhnWFuBMbe6J6rFy/PpFrYkP/cfGAvr7scHPRN4UAJoSkMKc3hBCuPl+We4wJSNMQ9HbR+C8ng2hfjwmGL2Q== X-Google-Smtp-Source: AGHT+IG6rGlSb8nouuXSdeJNywaIgM2iXitUR9TPCNVf4V9Pf+Aii9Pw/9CVAF5ryaEHbVyz2efU X-Received: by 2002:ac2:4188:0:b0:523:8bce:3db7 with SMTP id 2adb3069b0e04-52966f93329mr762671e87.68.1716539892569; Fri, 24 May 2024 01:38:12 -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 2adb3069b0e04-5296ea742c1si377309e87.177.2024.05.24.01.38.12; Fri, 24 May 2024 01:38:12 -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="FUVp/EnH"; 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 03F8C68D51F; Fri, 24 May 2024 11:38:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn2068.outbound.protection.outlook.com [40.92.74.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CB8BC68CF29 for ; Fri, 24 May 2024 11:38:01 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fs6xzwMI7ZSyd84lyT7YvPMexqgnJ8PN/2ad7S/oLwJjjS5KxTa5Anq+NVxbHp35Xor7oiShH0WyCYlfDsUsz7SICia3IcsPYR1VKYnRve5z9nq0+uQLf+QhPxekZKSJLzCxABqXZQHZBbZKnKPQdbHxWG33wWKO7AwFgjyjMyqANAySE1Bbll0aPZdGJ1hV4mi6rherWGaRXUpcFQFhTdCuSUeLDw1wb59NaJKcIrwGs8M/Recu+fOS66WamKUSELvLuRohqsXXGjTW/dseHqdcatA4/E6ywWzHlRv4hX6ThLqSR2Z82x5TV5t0uOxFJxoMmseQtj8XrBYPKCsJKA== 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=lVoUrgpG3X6I1LPIJeYW42e1ulzL+Oyrp8nASymQTEE=; b=erkgbsKe90WxwTtkToBMOpN8JOrO7rtCFA7R//p2KfBHSJvQAIOx3YGM7i+S+lqoV2Z3uX7jCvhFKYQ6uV/vFodYDDTa9lMlRewyr1DzqNO26dEuhG3jNIh/F5qEN3kau6TkRbU4eiRuXe5gsVWvQVkb4iOB0M4feP6BIUGSN7YC2uExScS11A8t3ZXT+0ZMejdKrzapFdFTNYe39g2H98OWuIxdMO5OO64t04pxVyPoVz0FzCA9gWEFDfIjSZQKYRJ5ErfDgYBoT9a5MIi1WXn89aZaIMg/EI6L63leVOnr/7o0UvGeehAGSgKV7j2LEds483rONtvBXK6uDOylUg== 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=lVoUrgpG3X6I1LPIJeYW42e1ulzL+Oyrp8nASymQTEE=; b=FUVp/EnHduor2rMpXWzOT/oTK/QhMIEttuu8uqCr8+j+vMKx3iW9XDXKHMyhRBr8gZ5pyHkgC5FaHhJciUD4gCxuKpLrVyQo7WBJED0C11p5mT0MgHyalYd/5HzSJIZsZjwf85Y37Wgsf21D03z3RBagN2/wRjOQdyfmaYWgwm9xOnzbwcWegqgrBDXQSV78tJlVIklHvKfkUHZwc0+2ENxo0FiEcJZ1Nr7NBHOn4EclgeMEf/MgcKlb1IHc3YFk/xyi+GsLchd6wLQji9uNTyhtBcioW7d2GUVy32fdhIOQJFzhcMHOQ3vRWpLmSXA9TBVaQSKvuQbRz6h90EHWVg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PRAP250MB0590.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:299::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.22; Fri, 24 May 2024 08:37:56 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::d6a1:e3af:a5f1:b614%3]) with mapi id 15.20.7587.030; Fri, 24 May 2024 08:37:56 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 May 2024 10:37:49 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [60qBCJaFQRnxn2WjaEIbdmEC8Oa0ie8qYjQCsgyxqA4=] X-ClientProxiedBy: ZR2P278CA0066.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:52::20) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240524083749.496992-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PRAP250MB0590:EE_ X-MS-Office365-Filtering-Correlation-Id: b632f714-4041-4dbc-ac92-08dc7bcccf60 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199019|3412199016|440099019|1710799017; X-Microsoft-Antispam-Message-Info: VuLLJ6CTokdp0blBCJdWigZgYkbgVZK+KFxKk+Th3jvRjRYcr1Lxyf8io3q7lIcJooEisDcsOuLZ3nzB3TuanEPMLYUJ3hKBfYFfBCukJmFgdzDlwVatoCIhSfNGPJzMNdyMI/khoYGS+fbOrlQYPavr2fKRVcaPIWU/Rjrv/ZThw0CTa/leqQ6cxK+Jv6Sslff1ImrJgzUduTCcqqqatZOsbNLoKaGIduMpqgbdDTpiAoLZn6eOf4tD7kotwMb8FGE3UsLk8e+MpZDi1o5tQOvfI5eDd3NdyEm4PrOOOcrRhCA0oua4OBr2vxxg44gCGQgF7UHyVYe1Mdx6RVqw2k/R0RkyHzyXcTpniCSJVKX9iRxtR+gkyGmxsRIY0o9NB/J1IzfJ2XCMrKSx/N2yVJkLzuCNm4WICqMrjgO6g46HyuMSm1fAFQdZqS/8/Xd/cDvERLhFuuungUILoEGE95iT8mJBcnFfiK3rVQdqciLyZoGIba+z9L6g5epQMe4Wh/SrgpODldXF//gv9fPqccE6AwCRbMzcQ4WYWwjT1NkWcvCV0XO2hWOInM6coU5J9Snr4FPoqyAT8lO+MkukD2jBvKhpzMRmeLmnhuZN8lF9zLQsD8Yrbox8IsC3O73p X-MS-Exchange-AntiSpam-MessageData-Chun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EoxQvPCLAHBrhZkkJMUzNPiYgWF1z5DBZXeSOBxSrUjkmCit6ESu9gjre6sAXiBGQ5eJJtLV98YIbFShIvvqwWvCcuOBwp7jVqgr5CHQSZo6Y5zL5d9VH+2VVHOqBIP+rtR+THEyK4lMeiZhSnnInrVl/D+U7BeinZjcJl9QoMuGGFHE2B2Oj3mrkXVf9Lm6eyj4LaoTRz0TbIo7uaZwWF+yE+KYE0LWzz71hAGfyoZLIxJkj5Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b632f714-4041-4dbc-ac92-08dc7bcccf60 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2024 08:37:56.4459 (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: PRAP250MB0590 Subject: [FFmpeg-devel] [PATCH] avfilter/af_afir: Merge header into af_afir.c 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: lFRVB8x8U3cU Done in 0df18f29ae218f30b3ecff7c930176b8ebee56aa, accidentally undone in 163e737c1793eeea9c2df15298253ffc04906afe. Signed-off-by: Andreas Rheinhardt --- libavfilter/af_afir.c | 81 ++++++++++++++++++++++++++++++- libavfilter/af_afir.h | 110 ------------------------------------------ 2 files changed, 80 insertions(+), 111 deletions(-) delete mode 100644 libavfilter/af_afir.h diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index 8997fbd7c9..24f8f8cbf1 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -34,15 +34,94 @@ #include "libavutil/frame.h" #include "libavutil/log.h" #include "libavutil/opt.h" +#include "libavutil/rational.h" #include "audio.h" #include "avfilter.h" #include "filters.h" #include "formats.h" #include "internal.h" -#include "af_afir.h" #include "af_afirdsp.h" +#define MAX_IR_STREAMS 32 + +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 *blockout; + AVFrame *tempin; + AVFrame *tempout; + AVFrame *buffer; + AVFrame *coeff; + AVFrame *input; + AVFrame *output; + + AVTXContext **ctx, **tx, **itx; + av_tx_fn ctx_fn, tx_fn, itx_fn; +} AudioFIRSegment; + +typedef struct AudioFIRContext { + const AVClass *class; + + float wet_gain; + float dry_gain; + float length; + int gtype; + float ir_norm; + float ir_link; + float ir_gain; + int ir_format; + int ir_load; + float max_ir_len; + int response; + int w, h; + AVRational frame_rate; + int ir_channel; + int minp; + int maxp; + int nb_irs; + int prev_selir; + int selir; + int precision; + int format; + + int eof_coeffs[MAX_IR_STREAMS]; + int have_coeffs[MAX_IR_STREAMS]; + int nb_taps[MAX_IR_STREAMS]; + int nb_segments[MAX_IR_STREAMS]; + int max_offset[MAX_IR_STREAMS]; + int nb_channels; + int one2many; + int prev_is_disabled; + int *loading; + double *ch_gain; + + AudioFIRSegment seg[MAX_IR_STREAMS][1024]; + + AVFrame *in; + AVFrame *xfade[2]; + AVFrame *fadein[2]; + AVFrame *ir[MAX_IR_STREAMS]; + AVFrame *norm_ir[MAX_IR_STREAMS]; + int min_part_size; + int max_part_size; + int64_t pts; + + AudioFIRDSPContext afirdsp; + AVFloatDSPContext *fdsp; +} AudioFIRContext; + #define DEPTH 32 #include "afir_template.c" diff --git a/libavfilter/af_afir.h b/libavfilter/af_afir.h deleted file mode 100644 index 8e4afd79c9..0000000000 --- a/libavfilter/af_afir.h +++ /dev/null @@ -1,110 +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 "libavutil/float_dsp.h" -#include "libavutil/frame.h" -#include "libavutil/rational.h" -#include "libavutil/tx.h" -#include "avfilter.h" -#include "af_afirdsp.h" - -#define MAX_IR_STREAMS 32 - -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 *blockout; - AVFrame *tempin; - AVFrame *tempout; - AVFrame *buffer; - AVFrame *coeff; - AVFrame *input; - AVFrame *output; - - AVTXContext **ctx, **tx, **itx; - av_tx_fn ctx_fn, tx_fn, itx_fn; -} AudioFIRSegment; - -typedef struct AudioFIRContext { - const AVClass *class; - - float wet_gain; - float dry_gain; - float length; - int gtype; - float ir_norm; - float ir_link; - float ir_gain; - int ir_format; - int ir_load; - float max_ir_len; - int response; - int w, h; - AVRational frame_rate; - int ir_channel; - int minp; - int maxp; - int nb_irs; - int prev_selir; - int selir; - int precision; - int format; - - int eof_coeffs[MAX_IR_STREAMS]; - int have_coeffs[MAX_IR_STREAMS]; - int nb_taps[MAX_IR_STREAMS]; - int nb_segments[MAX_IR_STREAMS]; - int max_offset[MAX_IR_STREAMS]; - int nb_channels; - int one2many; - int prev_is_disabled; - int *loading; - double *ch_gain; - - AudioFIRSegment seg[MAX_IR_STREAMS][1024]; - - AVFrame *in; - AVFrame *xfade[2]; - AVFrame *fadein[2]; - AVFrame *ir[MAX_IR_STREAMS]; - AVFrame *norm_ir[MAX_IR_STREAMS]; - int min_part_size; - int max_part_size; - int64_t pts; - - AudioFIRDSPContext afirdsp; - AVFloatDSPContext *fdsp; -} AudioFIRContext; - -#endif /* AVFILTER_AFIR_H */