Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Yigithan Yigit <yigithanyigitdevel@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: thilo.borgmann@mail.de, yigithanyigitdevel@gmail.com
Subject: [FFmpeg-devel] [PATCH v3 5/5] Replace division with ldexp
Date: Tue,  2 Jul 2024 04:33:54 +0300
Message-ID: <20240702013354.14942-6-yigithanyigitdevel@gmail.com> (raw)
In-Reply-To: <20240702013354.14942-1-yigithanyigitdevel@gmail.com>

---
 libavfilter/af_volumedetect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/af_volumedetect.c b/libavfilter/af_volumedetect.c
index a53212015d..856d5a295d 100644
--- a/libavfilter/af_volumedetect.c
+++ b/libavfilter/af_volumedetect.c
@@ -49,7 +49,7 @@ static inline double logdb(double v, enum AVSampleFormat sample_fmt)
             return MAX_DB_FLT;
         return -log10(v) * 10;
     } else {
-        double d = v / (double)(0x8000 * 0x8000);
+        double d = ldexp(v, -30);
         if (!v)
             return MAX_DB;
         return -log10(d) * 10;
-- 
2.45.2

_______________________________________________
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".

      parent reply	other threads:[~2024-07-02  1:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02  1:33 [FFmpeg-devel] [PATCH v3 0/5] avfilter/af_volumedetect.c: Add 32bit float audio Yigithan Yigit
2024-07-02  1:33 ` [FFmpeg-devel] [PATCH v3 1/5] avfilter/af_volumedetect.c: Move logdb function Yigithan Yigit
2024-07-02  1:33 ` [FFmpeg-devel] [PATCH v3 2/5] avfilter/af_volumedetect.c: Add 32bit float audio support Yigithan Yigit
2024-07-02  5:46   ` Rémi Denis-Courmont
2024-07-02  5:49     ` Rémi Denis-Courmont
2024-07-02  5:51   ` Rémi Denis-Courmont
2024-07-02 11:46     ` Yigithan Yigit
2024-07-02  1:33 ` [FFmpeg-devel] [PATCH v3 3/5] avfilter/af_volumedetect.c: Added functions for int/float and planar/packed Yigithan Yigit
2024-07-02  7:50   ` Anton Khirnov
2024-07-02  1:33 ` [FFmpeg-devel] [PATCH v3 4/5] avfilter/af_volumedetect.c: reindent after last commit Yigithan Yigit
2024-07-02  1:33 ` Yigithan Yigit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240702013354.14942-6-yigithanyigitdevel@gmail.com \
    --to=yigithanyigitdevel@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=thilo.borgmann@mail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git