From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 199C84B85A for ; Mon, 17 Jun 2024 11:18:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 652F868D776; Mon, 17 Jun 2024 14:18:28 +0300 (EEST) Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C26D568D76C for ; Mon, 17 Jun 2024 14:18:20 +0300 (EEST) Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2ebe3bac6c6so47457141fa.1 for ; Mon, 17 Jun 2024 04:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718623099; x=1719227899; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zz10MfUToxQCOIorsRrk43o89JkcM4owO52Y+KUYq5c=; b=LhSO/l6UO77JedcKPVju3YDmQpMM1qN5xr1Wp2QoNdzfobRv0WLMGGS7xKb7HWtAdd 7JFP+14Mjp9mPAEqqNRfCSHAhS4Bpiq1tPo7Vt6gDC1VlBX1vw+xaQSzYUtNT/BYPWYn joanGAc3sXxfF/1BCTGcH8JWMAmVP+TKOQQBNWG+skOxvvGR6lAORZJ6bYI6EnIaxxUj TwvAfTg6S5ttqIfe5vAEsSYrUWXqjXBAswBgIV5yJp/RBQA6vcCBFRmGk6s/c5RTpDux E6lvyyI9QKDM1OUm2x+5Z2Egn/NG7jHsh40+vb2wPlTKNgfqbQsnI0Xs5GnU0ZLyQUHt k06g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718623099; x=1719227899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zz10MfUToxQCOIorsRrk43o89JkcM4owO52Y+KUYq5c=; b=Cjh4GRu2Ni52ArL0i3Dp95nVRcN3kBsY+HEEP/8odERXjfV2IsCX/F8JaY2eGnxLKX kpin2tGNLb7Xi+YPnAajcgUJqYaexRlrZWByI3YIWSzSOAVQzimRjvU7UB3RxrULnsQD g0sLkAhOH1ymJItQ8AEYD92WfVnEQ8jMCWCIGI7PmtcSNerK0pRBEIeaVXZ55QstosCF 1CwIzbIn0HD/hXwrqXR3zvvLpwwXkVBYJnwCruwlFXlwUDQZnHc8F9rQEA/C2HOsVwXc PuL5DP/IBXNn9pIN5PX5lXCkT8bHi6B3Qt2zKkOLXAjFYGU9QMNlJYkYYTgjWwLyvbbq GK5Q== X-Gm-Message-State: AOJu0Yyy3LUlH1/niajaSXVy+pTj/FkGIC6zso0H+hu9DQM9xv17evcV 4D4AbcoIJ6jasxNpdEPr6fSBmPuO7cG6pNCQU/MdCDDFW//ny66dXBYLXw== X-Google-Smtp-Source: AGHT+IFVcSlP6PfW626052cdhJ73N7bLE1sEb9BXTm6woSiVGyKHH18EWgEy7XQO94p3oi0/AasYJg== X-Received: by 2002:a2e:9dda:0:b0:2eb:fda7:e366 with SMTP id 38308e7fff4ca-2ec0e601058mr74398461fa.39.1718623099301; Mon, 17 Jun 2024 04:18:19 -0700 (PDT) Received: from localhost.localdomain ([88.239.140.156]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422f5f33c38sm157888015e9.9.2024.06.17.04.18.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Jun 2024 04:18:18 -0700 (PDT) From: Yigithan Yigit To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jun 2024 14:18:10 +0300 Message-ID: <20240617111812.84575-2-yigithanyigitdevel@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240617111812.84575-1-yigithanyigitdevel@gmail.com> References: <20240617111812.84575-1-yigithanyigitdevel@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] avfilter/af_volumedetect.c: Move logdb function 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: thilo.borgmann@mail.de, yigithanyigitdevel@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavfilter/af_volumedetect.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c index 8b001d1cf2..327801a7f9 100644 --- a/libavfilter/af_volumedetect.c +++ b/libavfilter/af_volumedetect.c @@ -24,6 +24,8 @@ #include "avfilter.h" #include "internal.h" +#define MAX_DB 91 + typedef struct VolDetectContext { /** * Number of samples at each PCM value. @@ -33,6 +35,14 @@ typedef struct VolDetectContext { uint64_t histogram[0x10001]; } VolDetectContext; +static inline double logdb(uint64_t v) +{ + double d = v / (double)(0x8000 * 0x8000); + if (!v) + return MAX_DB; + return -log10(d) * 10; +} + static int filter_frame(AVFilterLink *inlink, AVFrame *samples) { AVFilterContext *ctx = inlink->dst; @@ -56,16 +66,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *samples) return ff_filter_frame(inlink->dst->outputs[0], samples); } -#define MAX_DB 91 - -static inline double logdb(uint64_t v) -{ - double d = v / (double)(0x8000 * 0x8000); - if (!v) - return MAX_DB; - return -log10(d) * 10; -} - static void print_stats(AVFilterContext *ctx) { VolDetectContext *vd = ctx->priv; -- 2.44.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".