Commit 77f11d8a authored by Måns Rullgård's avatar Måns Rullgård

improve precision in mdct.c using double for some temporaries

Originally committed as revision 12457 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 6a5b9773
...@@ -54,7 +54,7 @@ void ff_kbd_window_init(float *window, float alpha, int n) ...@@ -54,7 +54,7 @@ void ff_kbd_window_init(float *window, float alpha, int n)
int ff_mdct_init(MDCTContext *s, int nbits, int inverse) int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
{ {
int n, n4, i; int n, n4, i;
float alpha; double alpha;
memset(s, 0, sizeof(*s)); memset(s, 0, sizeof(*s));
n = 1 << nbits; n = 1 << nbits;
...@@ -85,10 +85,10 @@ int ff_mdct_init(MDCTContext *s, int nbits, int inverse) ...@@ -85,10 +85,10 @@ int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
/* complex multiplication: p = a * b */ /* complex multiplication: p = a * b */
#define CMUL(pre, pim, are, aim, bre, bim) \ #define CMUL(pre, pim, are, aim, bre, bim) \
{\ {\
float _are = (are);\ double _are = (are);\
float _aim = (aim);\ double _aim = (aim);\
float _bre = (bre);\ double _bre = (bre);\
float _bim = (bim);\ double _bim = (bim);\
(pre) = _are * _bre - _aim * _bim;\ (pre) = _are * _bre - _aim * _bim;\
(pim) = _are * _bim + _aim * _bre;\ (pim) = _are * _bim + _aim * _bre;\
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment