1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-01 00:54:33 +02:00

improve precision in mdct.c using double for some temporaries

Originally committed as revision 12457 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2008-03-16 13:15:42 +00:00
parent 6a5b97732e
commit 77f11d8a4c

View File

@ -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 n, n4, i;
float alpha;
double alpha;
memset(s, 0, sizeof(*s));
n = 1 << nbits;
@ -85,10 +85,10 @@ int ff_mdct_init(MDCTContext *s, int nbits, int inverse)
/* complex multiplication: p = a * b */
#define CMUL(pre, pim, are, aim, bre, bim) \
{\
float _are = (are);\
float _aim = (aim);\
float _bre = (bre);\
float _bim = (bim);\
double _are = (are);\
double _aim = (aim);\
double _bre = (bre);\
double _bim = (bim);\
(pre) = _are * _bre - _aim * _bim;\
(pim) = _are * _bim + _aim * _bre;\
}