[FFmpeg-cvslog] avcodec/vorbisdec: don't use double intermediate in vorbisfloat2float

James Almer git at videolan.org
Fri Jun 14 02:38:25 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Jun 11 22:50:50 2024 -0300| [08383443ff695816297f94775ab793159ff38422] | committer: James Almer

avcodec/vorbisdec: don't use double intermediate in vorbisfloat2float

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08383443ff695816297f94775ab793159ff38422
---

 libavcodec/vorbisdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 700c6c8918..218e855f7a 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -181,11 +181,11 @@ static const char idx_err_str[] = "Index value %d out of range (0 - %d) for %s a
 
 static float vorbisfloat2float(unsigned val)
 {
-    double mant = val & 0x1fffff;
-    long exp    = (val & 0x7fe00000L) >> 21;
+    float mant = val & 0x1fffff;
+    int exp    = (val & 0x7fe00000) >> 21;
     if (val & 0x80000000)
         mant = -mant;
-    return ldexp(mant, exp - 20 - 768);
+    return ldexpf(mant, exp - 20 - 768);
 }
 
 



More information about the ffmpeg-cvslog mailing list