diff mbox series

[FFmpeg-devel,v3,5/5] Replace division with ldexp

Message ID 20240702013354.14942-6-yigithanyigitdevel@gmail.com
State New
Headers show
Series avfilter/af_volumedetect.c: Add 32bit float audio | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Yigithan Yigit July 2, 2024, 1:33 a.m. UTC
---
 libavfilter/af_volumedetect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;