From patchwork Tue Sep 8 21:18:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22191 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 86EEB44BD83 for ; Wed, 9 Sep 2020 00:19:49 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 71FE868B7BA; Wed, 9 Sep 2020 00:19:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 196B468B7A7 for ; Wed, 9 Sep 2020 00:19:46 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id j2so679780wrx.7 for ; Tue, 08 Sep 2020 14:19:46 -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=a7fgdKq7h0nRwQb+xIMagC4HIHBddc6nAYFpWXdB2/U=; b=R0YQlZiRd3FG+trrf4w1myVJiTnIl8+2PXzTHz5TB22FzcTIWeN3o7XwqDaZX3RUOI x0LMazWUufXi4jJeZera0FKcIQe+XyitgFNAbu9BB55A2PrUyoTnZTUFO01HX0fdqfFf GAiH1wttNF1+etSAsQMRmZfF/Oc/9/Z6b27EjMjAR91BodweeAJIGtLNXw3GpD07NkbK cKsm7wHxfNhC71crEXmHdAX6z6PKENglQlSDSGJUDo8vbDXX1ubrEnZ9EGlOmoDTcyNl 7GNhQvslg4qnoIVufgPgPgcQ5rIZ+L0+kjQuzY39ogbSsAwAa0OXaVa7VfLWC09xED1n oZvQ== 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=a7fgdKq7h0nRwQb+xIMagC4HIHBddc6nAYFpWXdB2/U=; b=J7+q8hajUyRU5ko/WFQWBcUqWio7hqrv1axNHOPb8GGMozuiwuPwB14llaCsXBeZSq CE01J1cF+2+Ezdij/6WYUY4H5dwiOuxdXb1JbS0bFlnypS8vNvQdSEaFKRD5jP5apxzC mktMf5vfsB+QZofX9vA1DlWTb0GXbPUhqwS+TvylbDgZr4lLAwsNUIUvA0YCNUh8Ae+a sRgqAUDm9WinJBjMp4yKnmA5M7tWk42AYiisc4iyy+vgMKK4vWAnIUs67mGJt42OH4w4 mKshtGXKTk5NqwNRQ58zYIjMqFDBAENDC6zD0ndjtWgJTG1QPz4H2fPBBvyOtwKx9Lbh G84Q== X-Gm-Message-State: AOAM531TWQVaZd9OanqPkgKKNFvxcdzgD+txNsTAv+k6YTdCs1vh5AbH N1EFCv/YBXXzwAjxGiogrQn2277bQiQ= X-Google-Smtp-Source: ABdhPJzKJKw0lgiPEh93fWnX2r4PCta6H6Ckm9YRcrA9rXqOyqRgpv1V5LeTnwxaiGRpTHnY+qKeBQ== X-Received: by 2002:a5d:5261:: with SMTP id l1mr394043wrc.193.1599599985374; Tue, 08 Sep 2020 14:19:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 14:19:44 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Sep 2020 23:18:56 +0200 Message-Id: <20200908211856.16290-25-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 25/25] avfilter/af_headphone: Don't check for clipping in separate loop 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" Signed-off-by: Andreas Rheinhardt --- More patches will be coming later. libavfilter/af_headphone.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c index 03ef88c4a4..edf8e773d7 100644 --- a/libavfilter/af_headphone.c +++ b/libavfilter/af_headphone.c @@ -281,6 +281,8 @@ static int headphone_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr, for (j = 0; j < in->nb_samples; j++) { dst[2 * j] += fft_acc[j].re * fft_scale; + if (fabsf(dst[2 * j]) > 1) + n_clippings[0]++; } for (j = 0; j < ir_len - 1; j++) { @@ -289,14 +291,6 @@ static int headphone_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr, *(ringbuffer + write_pos) += fft_acc[in->nb_samples + j].re * fft_scale; } - for (i = 0; i < out->nb_samples; i++) { - if (fabsf(dst[0]) > 1) { - n_clippings[0]++; - } - - dst += 2; - } - *write = wr; return 0;