1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-17 18:01:38 +02:00

avcodec/ppc/fdctdsp: use M_SQRT2 instead of ad-hoc SQRT2

This actually fixes an incorrect float literal. It is believed by
examining the precision that the literals were all pre-computed as
floats, resulting in this needless loss of precision. There is no
benefit to keeping such reduced precision:
1. These constants are used for static array computation, hence
compile-time.
2. They will be treated as doubles anyway, since f specifier was not
present.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
Ganesh Ajjanagadde 2015-11-21 09:04:58 -05:00
parent ccf3c69403
commit 61a1ca13ea

View File

@ -44,20 +44,19 @@
#define C5 0.55557024478912353515625000 /* cos(5 * PI / 16) */
#define C6 0.38268342614173889160156250 /* cos(6 * PI / 16) */
#define C7 0.19509032368659973144531250 /* cos(7 * PI / 16) */
#define SQRT_2 1.41421353816986083984375000 /* sqrt(2) */
#define W0 -(2 * C2)
#define W1 (2 * C6)
#define W2 (SQRT_2 * C6)
#define W3 (SQRT_2 * C3)
#define W4 (SQRT_2 * (-C1 + C3 + C5 - C7))
#define W5 (SQRT_2 * (C1 + C3 - C5 + C7))
#define W6 (SQRT_2 * (C1 + C3 + C5 - C7))
#define W7 (SQRT_2 * (C1 + C3 - C5 - C7))
#define W8 (SQRT_2 * (C7 - C3))
#define W9 (SQRT_2 * (-C1 - C3))
#define WA (SQRT_2 * (-C3 - C5))
#define WB (SQRT_2 * (C5 - C3))
#define W2 (M_SQRT2 * C6)
#define W3 (M_SQRT2 * C3)
#define W4 (M_SQRT2 * (-C1 + C3 + C5 - C7))
#define W5 (M_SQRT2 * (C1 + C3 - C5 + C7))
#define W6 (M_SQRT2 * (C1 + C3 + C5 - C7))
#define W7 (M_SQRT2 * (C1 + C3 - C5 - C7))
#define W8 (M_SQRT2 * (C7 - C3))
#define W9 (M_SQRT2 * (-C1 - C3))
#define WA (M_SQRT2 * (-C3 - C5))
#define WB (M_SQRT2 * (C5 - C3))
static const vector float fdctconsts[3] = {
{ W0, W1, W2, W3 },