Commit 064ced5d authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

avcodec/faandct: use more accurate constants

This guarantees a "best effort precision".
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 2d8c2f1a
......@@ -31,23 +31,20 @@
#define FLOAT float
//numbers generated by simple c code (not as accurate as they could be)
/*
for(i=0; i<8; i++){
printf("#define B%d %1.20llf\n", i, (long double)1.0/(cosl(i*acosl(-1.0)/(long double)16.0)*sqrtl(2)));
}
/* numbers generated by arbitrary precision arithmetic followed by truncation
to 36 fractional digits (enough for a 128-bit IEEE quad, see /usr/include/math.h
for this approach). This guarantees a "best effort precision".
*/
#define B0 1.00000000000000000000
#define B1 0.72095982200694791383 // (cos(pi*1/16)sqrt(2))^-1
#define B2 0.76536686473017954350 // (cos(pi*2/16)sqrt(2))^-1
#define B3 0.85043009476725644878 // (cos(pi*3/16)sqrt(2))^-1
#define B4 1.00000000000000000000 // (cos(pi*4/16)sqrt(2))^-1
#define B5 1.27275858057283393842 // (cos(pi*5/16)sqrt(2))^-1
#define B6 1.84775906502257351242 // (cos(pi*6/16)sqrt(2))^-1
#define B7 3.62450978541155137218 // (cos(pi*7/16)sqrt(2))^-1
#define A1 0.70710678118654752438 // cos(pi*4/16)
#define B0 1.000000000000000000000000000000000000L
#define B1 0.720959822006947913789091890943021267L // (cos(pi*1/16)sqrt(2))^-1
#define B2 0.765366864730179543456919968060797734L // (cos(pi*2/16)sqrt(2))^-1
#define B3 0.850430094767256448766702844371412325L // (cos(pi*3/16)sqrt(2))^-1
#define B4 1.000000000000000000000000000000000000L // (cos(pi*4/16)sqrt(2))^-1
#define B5 1.272758580572833938461007018281767032L // (cos(pi*5/16)sqrt(2))^-1
#define B6 1.847759065022573512256366378793576574L // (cos(pi*6/16)sqrt(2))^-1
#define B7 3.624509785411551372409941227504289587L // (cos(pi*7/16)sqrt(2))^-1
#define A1 M_SQRT1_2 // cos(pi*4/16)
#define A2 0.54119610014619698435 // cos(pi*6/16)sqrt(2)
#define A5 0.38268343236508977170 // cos(pi*6/16)
#define A4 1.30656296487637652774 // cos(pi*2/16)sqrt(2)
......
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