summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/ac3_parser.c4
-rw-r--r--libavcodec/ac3dec.c26
2 files changed, 18 insertions, 12 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index c8a09b915b..ae5bf30d78 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -37,13 +37,13 @@ static const uint8_t eac3_blocks[4] = {
* Table for center mix levels
* reference: Section 5.4.2.4 cmixlev
*/
-static const uint8_t center_levels[4] = { 2, 3, 4, 3 };
+static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
/**
* Table for surround mix levels
* reference: Section 5.4.2.5 surmixlev
*/
-static const uint8_t surround_levels[4] = { 2, 4, 0, 4 };
+static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index e7fcd87728..74f34f8e14 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -72,6 +72,9 @@ static const uint8_t quantization_tab[16] = {
static float dynamic_range_tab[256];
/** Adjustments in dB gain */
+#define LEVEL_PLUS_3DB 1.4142135623730950
+#define LEVEL_PLUS_1POINT5DB 1.1892071150027209
+#define LEVEL_MINUS_1POINT5DB 0.8408964152537145
#define LEVEL_MINUS_3DB 0.7071067811865476
#define LEVEL_MINUS_4POINT5DB 0.5946035575013605
#define LEVEL_MINUS_6DB 0.5000000000000000
@@ -79,12 +82,15 @@ static float dynamic_range_tab[256];
#define LEVEL_ZERO 0.0000000000000000
#define LEVEL_ONE 1.0000000000000000
-static const float gain_levels[6] = {
- LEVEL_ZERO,
+static const float gain_levels[9] = {
+ LEVEL_PLUS_3DB,
+ LEVEL_PLUS_1POINT5DB,
LEVEL_ONE,
+ LEVEL_MINUS_1POINT5DB,
LEVEL_MINUS_3DB,
LEVEL_MINUS_4POINT5DB,
LEVEL_MINUS_6DB,
+ LEVEL_ZERO,
LEVEL_MINUS_9DB
};
@@ -93,14 +99,14 @@ static const float gain_levels[6] = {
* reference: Section 7.8.2 Downmixing Into Two Channels
*/
static const uint8_t ac3_default_coeffs[8][5][2] = {
- { { 1, 0 }, { 0, 1 }, },
- { { 2, 2 }, },
- { { 1, 0 }, { 0, 1 }, },
- { { 1, 0 }, { 3, 3 }, { 0, 1 }, },
- { { 1, 0 }, { 0, 1 }, { 4, 4 }, },
- { { 1, 0 }, { 3, 3 }, { 0, 1 }, { 5, 5 }, },
- { { 1, 0 }, { 0, 1 }, { 4, 0 }, { 0, 4 }, },
- { { 1, 0 }, { 3, 3 }, { 0, 1 }, { 4, 0 }, { 0, 4 }, },
+ { { 2, 7 }, { 7, 2 }, },
+ { { 4, 4 }, },
+ { { 2, 7 }, { 7, 2 }, },
+ { { 2, 7 }, { 5, 5 }, { 7, 2 }, },
+ { { 2, 7 }, { 7, 2 }, { 6, 6 }, },
+ { { 2, 7 }, { 5, 5 }, { 7, 2 }, { 8, 8 }, },
+ { { 2, 7 }, { 7, 2 }, { 6, 7 }, { 7, 6 }, },
+ { { 2, 7 }, { 5, 5 }, { 7, 2 }, { 6, 7 }, { 7, 6 }, },
};
/* override ac3.h to include coupling channel */