Commit 94565f37 authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

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: 's avatarClément Bœsch <u@pkh.me>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 18b40164
...@@ -97,13 +97,13 @@ typedef float SHORTFLOAT; ...@@ -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
......
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