From 8768f8f4b92990e5b9c5df1024438122532998d4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 17 Apr 2015 13:36:14 +0200 Subject: [PATCH] avcodec/mpegaudiodec_template: use double to build csa tables Fixes rounding difference between 32bit x86 and 64bit Fixes fate failure with gapless mp3 Signed-off-by: Michael Niedermayer --- libavcodec/mpegaudiodec_template.c | 2 +- tests/ref/fate/gapless-mp3 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 138a107b85..2326a9025b 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -388,7 +388,7 @@ static av_cold void decode_init_static(void) } for (i = 0; i < 8; i++) { - float ci, cs, ca; + double ci, cs, ca; ci = ci_table[i]; cs = 1.0 / sqrt(1.0 + ci * ci); ca = cs * ci; diff --git a/tests/ref/fate/gapless-mp3 b/tests/ref/fate/gapless-mp3 index 9add70f9ba..2c178c0e36 100644 --- a/tests/ref/fate/gapless-mp3 +++ b/tests/ref/fate/gapless-mp3 @@ -1,4 +1,4 @@ d5c88cf38416329a052a9b0cb140fb4c *tests/data/fate/gapless-mp3.out-1 -3e41cbd4dcd511d3155234684252beab +c96c3ae7bd3300fd2f4debac222de5b7 68f040b12d79c71e3b2e8ba90a9cbd96 *tests/data/fate/gapless-mp3.out-2 -3e41cbd4dcd511d3155234684252beab \ No newline at end of file +c96c3ae7bd3300fd2f4debac222de5b7