Commit 61a1ca13 authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

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: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent ccf3c694
...@@ -44,20 +44,19 @@ ...@@ -44,20 +44,19 @@
#define C5 0.55557024478912353515625000 /* cos(5 * PI / 16) */ #define C5 0.55557024478912353515625000 /* cos(5 * PI / 16) */
#define C6 0.38268342614173889160156250 /* cos(6 * PI / 16) */ #define C6 0.38268342614173889160156250 /* cos(6 * PI / 16) */
#define C7 0.19509032368659973144531250 /* cos(7 * PI / 16) */ #define C7 0.19509032368659973144531250 /* cos(7 * PI / 16) */
#define SQRT_2 1.41421353816986083984375000 /* sqrt(2) */
#define W0 -(2 * C2) #define W0 -(2 * C2)
#define W1 (2 * C6) #define W1 (2 * C6)
#define W2 (SQRT_2 * C6) #define W2 (M_SQRT2 * C6)
#define W3 (SQRT_2 * C3) #define W3 (M_SQRT2 * C3)
#define W4 (SQRT_2 * (-C1 + C3 + C5 - C7)) #define W4 (M_SQRT2 * (-C1 + C3 + C5 - C7))
#define W5 (SQRT_2 * (C1 + C3 - C5 + C7)) #define W5 (M_SQRT2 * (C1 + C3 - C5 + C7))
#define W6 (SQRT_2 * (C1 + C3 + C5 - C7)) #define W6 (M_SQRT2 * (C1 + C3 + C5 - C7))
#define W7 (SQRT_2 * (C1 + C3 - C5 - C7)) #define W7 (M_SQRT2 * (C1 + C3 - C5 - C7))
#define W8 (SQRT_2 * (C7 - C3)) #define W8 (M_SQRT2 * (C7 - C3))
#define W9 (SQRT_2 * (-C1 - C3)) #define W9 (M_SQRT2 * (-C1 - C3))
#define WA (SQRT_2 * (-C3 - C5)) #define WA (M_SQRT2 * (-C3 - C5))
#define WB (SQRT_2 * (C5 - C3)) #define WB (M_SQRT2 * (C5 - C3))
static const vector float fdctconsts[3] = { static const vector float fdctconsts[3] = {
{ W0, W1, W2, W3 }, { W0, W1, W2, W3 },
......
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