1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/ac3: use M_SQRT1_2, M_SQRT2

This uses M_SQRT1_2, M_SQRT2 instead of the actual literals. This yields
greater precision in some places in avcodec/ac3, while fixed point
values remain unchanged.

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
Ganesh Ajjanagadde 2015-11-10 22:26:25 -05:00
parent 18b4016431
commit 94565f3791

View File

@ -97,13 +97,13 @@ typedef float SHORTFLOAT;
#endif /* USE_FIXED */ #endif /* USE_FIXED */
#define AC3_LEVEL(x) ROUND15((x) * FIXR15(0.7071067811865476)) #define AC3_LEVEL(x) ROUND15((x) * FIXR15(M_SQRT1_2))
/* pre-defined gain values */ /* pre-defined gain values */
#define LEVEL_PLUS_3DB 1.4142135623730950 #define LEVEL_PLUS_3DB M_SQRT2
#define LEVEL_PLUS_1POINT5DB 1.1892071150027209 #define LEVEL_PLUS_1POINT5DB 1.1892071150027209
#define LEVEL_MINUS_1POINT5DB 0.8408964152537145 #define LEVEL_MINUS_1POINT5DB 0.8408964152537145
#define LEVEL_MINUS_3DB 0.7071067811865476 #define LEVEL_MINUS_3DB M_SQRT1_2
#define LEVEL_MINUS_4POINT5DB 0.5946035575013605 #define LEVEL_MINUS_4POINT5DB 0.5946035575013605
#define LEVEL_MINUS_6DB 0.5000000000000000 #define LEVEL_MINUS_6DB 0.5000000000000000
#define LEVEL_MINUS_9DB 0.3535533905932738 #define LEVEL_MINUS_9DB 0.3535533905932738