Commit b6d5e6aa authored by Tim Walker's avatar Tim Walker Committed by Anton Khirnov

dca: convert dca_default_coeffs to float.

Easier to read, modify, and avoids relying on an outdated table.
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 25609b63
...@@ -7522,17 +7522,17 @@ static const float dca_downmix_coeffs[65] = { ...@@ -7522,17 +7522,17 @@ static const float dca_downmix_coeffs[65] = {
0.001412537544623, 0.001000000000000, 0.000501187233627, 0.000251188643151, 0.000000000000000, 0.001412537544623, 0.001000000000000, 0.000501187233627, 0.000251188643151, 0.000000000000000,
}; };
static const uint8_t dca_default_coeffs[10][5][2] = { static const float dca_default_coeffs[10][5][2] = {
{ { 13, 13 }, }, { { 0.707946, 0.707946 }, }, // A
{ { 0, 64 }, { 64, 0 }, }, { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, }, // A + B (dual mono)
{ { 0, 64 }, { 64, 0 }, }, { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, }, // L + R (stereo)
{ { 0, 64 }, { 64, 0 }, }, { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, }, // (L+R) + (L-R) (sum-difference)
{ { 0, 64 }, { 64, 0 }, }, { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, }, // LT + RT (left and right total)
{ { 6, 6 }, { 0, 25 }, { 25, 0 }, }, { { 0.865964, 0.865964 }, { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, }, // C + L + R
{ { 0, 25 }, { 25, 0 }, { 13, 13 }, }, { { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 0.707946, 0.707946 }, }, // L + R + S
{ { 6, 6 }, { 0, 25 }, { 25, 0 }, { 13, 13 }, }, { { 0.865964, 0.865964 }, { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 0.707946, 0.707946 }, }, // C + L + R + S
{ { 0, 25 }, { 25, 0 }, { 0, 13 }, { 13, 0 }, }, { { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 1.000000, 0.707946 }, { 0.707946, 1.000000 }, }, // L + R + SL + SR
{ { 6, 6 }, { 0, 25 }, { 25, 0 }, { 0, 13 }, { 13, 0 }, }, { { 0.865964, 0.865964 }, { 1.000000, 0.501187 }, { 0.501187, 1.000000 }, { 1.000000, 0.707946 }, { 0.707946, 1.000000 }, }, // C + L + R + SL + SR
}; };
/* downmix coeffs /* downmix coeffs
......
...@@ -819,8 +819,8 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index) ...@@ -819,8 +819,8 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
} }
for (j = base_channel; j < s->prim_channels; j++) { for (j = base_channel; j < s->prim_channels; j++) {
s->downmix_coef[j][0] = dca_downmix_coeffs[dca_default_coeffs[am][j][0]]; s->downmix_coef[j][0] = dca_default_coeffs[am][j][0];
s->downmix_coef[j][1] = dca_downmix_coeffs[dca_default_coeffs[am][j][1]]; s->downmix_coef[j][1] = dca_default_coeffs[am][j][1];
} }
} }
} }
......
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