From patchwork Tue Sep 8 21:18:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22186 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 DC4C944BD83 for ; Wed, 9 Sep 2020 00:19:35 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C0A8968B747; Wed, 9 Sep 2020 00:19:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D71FC68B703 for ; Wed, 9 Sep 2020 00:19:32 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id e11so452148wme.0 for ; Tue, 08 Sep 2020 14:19:32 -0700 (PDT) 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=tihYtS7wGoMEV6OoAT2BYKLQbOlAK5myash5WlT5XSU=; b=Rmb621JLWT+D/WVq+XJFA7D+wKDFuBZ6m6gTPPVSmtCTiLLd+AqlnSOGBKufQm8/Yl CUZoAs3ZrhRMI3dcMrGaOII6iYQzZbwjfmheS9egjRbrmD7llSYLBOvNxgyotC+wsEft k7JnaXx7gn2T8aD3Q96JyvIvqS8YhrjgEIS0NGYJBjpFsFUFzhsNbIrd6HegLvBK7JSf QGXa0I7YSeFxUJizM5MCSRmNSrjuKY/3/uerMvC4P2GOdxm95oaZooYQsSUWo4Q3YgWj o3uuJ8/U6ljHq+/jF6O7EB5oJLYggMw42BCV7TDKOIQB9Je4xXc8x/YlJ3vEjVBnEzPj OiIw== 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=tihYtS7wGoMEV6OoAT2BYKLQbOlAK5myash5WlT5XSU=; b=D4kHj0ykZiyOkqRm5omxLme+wgmWXXpv3jcvaK0jNIKKefqrDiHR3GummvQwN4cj8V Rz7efw+rSuk2O3FIaIJtOSFD+GKjCsOdNmP5D6MCzH0WOcVY2wudLswoeg7D+kUeoV6x QbdgKT+bxnuwVK1oBjEcRPWYV5Mx0HVSmu2Zv22eTtezERUrynAVR25gI07ZACUPco3J x72nkhb1qHiTHzA/VeQNUTCii4ZV0MDRhPEDDKxrf+gpem9QHHZ8n5dGHJTb+1jTSU7M kv0t4WrrAbA3RhcwZ8OJJMyeqRS22zToKHhU56Mincuf4EmemHloF2eFkEPzXgHpNABJ HPFw== X-Gm-Message-State: AOAM531OAF+5GQW6ml556JuAB67qTc03PY2begO7bXqP+NsHOe4+El7V 2w16QSll6hgp1slzYG6XL6e1C/M6sfE= X-Google-Smtp-Source: ABdhPJxxny5wcCeYUhyuVZUwMzJE2eKptcThe508iqoCSfbmdzpZWYk8oiWurg/O5qkiWTa9mgGMtw== X-Received: by 2002:a1c:5641:: with SMTP id k62mr345529wmb.13.1599599971983; Tue, 08 Sep 2020 14:19:31 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id a15sm1074304wrn.3.2020.09.08.14.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 14:19:31 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Sep 2020 23:18:43 +0200 Message-Id: <20200908211856.16290-12-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200908211856.16290-1-andreas.rheinhardt@gmail.com> References: <20200908211856.16290-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/25] avfilter/af_headphone: Remove unused arrays 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" The delay arrays were never properly initialized, only zero-initialized; furthermore these arrays duplicate fields in the headphone_inputs struct. So remove them. (Btw: The allocations for them have not been checked.) Signed-off-by: Andreas Rheinhardt --- libavfilter/af_headphone.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c index 967f8ed5a6..f9799d8548 100644 --- a/libavfilter/af_headphone.c +++ b/libavfilter/af_headphone.c @@ -67,7 +67,6 @@ typedef struct HeadphoneContext { int size; int hrir_fmt; - int *delay[2]; float *data_ir[2]; float *temp_src[2]; FFTComplex *temp_fft[2]; @@ -135,7 +134,6 @@ static void parse_map(AVFilterContext *ctx) typedef struct ThreadData { AVFrame *in, *out; int *write; - int **delay; float **ir; int *n_clippings; float **ringbuffer; @@ -151,7 +149,6 @@ static int headphone_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n AVFrame *in = td->in, *out = td->out; int offset = jobnr; int *write = &td->write[jobnr]; - const int *const delay = td->delay[jobnr]; const float *const ir = td->ir[jobnr]; int *n_clippings = &td->n_clippings[jobnr]; float *ringbuffer = td->ringbuffer[jobnr]; @@ -190,7 +187,7 @@ static int headphone_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n continue; } - read = (wr - *(delay + l) - (ir_len - 1) + buffer_length) & modulo; + read = (wr - (ir_len - 1) + buffer_length) & modulo; if (read + ir_len < buffer_length) { memcpy(temp_src, bptr + read, ir_len * sizeof(*temp_src)); @@ -348,7 +345,7 @@ static int headphone_frame(HeadphoneContext *s, AVFrame *in, AVFilterLink *outli out->pts = in->pts; td.in = in; td.out = out; td.write = s->write; - td.delay = s->delay; td.ir = s->data_ir; td.n_clippings = n_clippings; + td.ir = s->data_ir; td.n_clippings = n_clippings; td.ringbuffer = s->ringbuffer; td.temp_src = s->temp_src; td.temp_fft = s->temp_fft; td.temp_afft = s->temp_afft; @@ -415,8 +412,6 @@ static int convert_coeffs(AVFilterContext *ctx, AVFilterLink *inlink) s->data_ir[0] = av_calloc(s->air_len, sizeof(float) * s->nb_irs); s->data_ir[1] = av_calloc(s->air_len, sizeof(float) * s->nb_irs); - s->delay[0] = av_calloc(s->nb_irs, sizeof(float)); - s->delay[1] = av_calloc(s->nb_irs, sizeof(float)); if (s->type == TIME_DOMAIN) { s->ringbuffer[0] = av_calloc(s->buffer_length, sizeof(float) * nb_input_channels); @@ -782,8 +777,6 @@ static av_cold void uninit(AVFilterContext *ctx) av_fft_end(s->ifft[1]); av_fft_end(s->fft[0]); av_fft_end(s->fft[1]); - av_freep(&s->delay[0]); - av_freep(&s->delay[1]); av_freep(&s->data_ir[0]); av_freep(&s->data_ir[1]); av_freep(&s->ringbuffer[0]);