Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/audio/mux/mux_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ void mux_prepare_look_up_table(struct comp_dev *dev)
for (k = 0; k < PLATFORM_MAX_CHANNELS; k++) {
if (cd->config.streams[i].mask[j] & BIT(k)) {
/* MUX component has only one sink */
cd->lookup[0].copy_elem[idx].in_ch = k;
cd->lookup[0].copy_elem[idx].out_ch = j;
cd->lookup[0].copy_elem[idx].in_ch = j;
cd->lookup[0].copy_elem[idx].out_ch = k;
cd->lookup[0].copy_elem[idx].stream_id =
i;
cd->lookup[0].num_elems = ++idx;
Expand All @@ -525,8 +525,8 @@ void demux_prepare_look_up_table(struct comp_dev *dev)
for (k = 0; k < PLATFORM_MAX_CHANNELS; k++) {
if (cd->config.streams[i].mask[j] & BIT(k)) {
/* MUX component has only one sink */
cd->lookup[i].copy_elem[idx].in_ch = k;
cd->lookup[i].copy_elem[idx].out_ch = j;
cd->lookup[i].copy_elem[idx].in_ch = j;
cd->lookup[i].copy_elem[idx].out_ch = k;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make more sense to rename j and m as row and column ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping. if you can fix and re-push this will let CI do a full run too.

cd->lookup[i].copy_elem[idx].stream_id =
i;
cd->lookup[i].num_elems = ++idx;
Expand Down
6 changes: 3 additions & 3 deletions test/cmocka/src/audio/mux/demux_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static void test_demux_copy_proc_16(void **state)
int64_t sample = 0;

for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
if (td->mask[i][j] & BIT(k))
if (td->mask[i][k] & BIT(j))
sample = input_16b[k];

expected_results[i][j] = sample;
Expand All @@ -222,7 +222,7 @@ static void test_demux_copy_proc_24(void **state)
int32_t sample = 0;

for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
if (td->mask[i][j] & BIT(k))
if (td->mask[i][k] & BIT(j))
sample = input_24b[k];

expected_results[i][j] = sample;
Expand All @@ -247,7 +247,7 @@ static void test_demux_copy_proc_32(void **state)
int32_t sample = 0;

for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
if (td->mask[i][j] & BIT(k))
if (td->mask[i][k] & BIT(j))
sample = input_32b[k];

expected_results[i][j] = sample;
Expand Down
6 changes: 3 additions & 3 deletions test/cmocka/src/audio/mux/mux_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void test_mux_copy_proc_16(void **state)

for (j = 0; j < MUX_MAX_STREAMS; ++j) {
for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k) {
if (td->mask[j][i] & BIT(k))
if (td->mask[j][k] & BIT(i))
sample = input_16b[j][k];
}
}
Expand All @@ -243,7 +243,7 @@ static void test_mux_copy_proc_24(void **state)

for (j = 0; j < MUX_MAX_STREAMS; ++j) {
for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k) {
if (td->mask[j][i] & BIT(k))
if (td->mask[j][k] & BIT(i))
sample = input_24b[j][k];
}
}
Expand All @@ -267,7 +267,7 @@ static void test_mux_copy_proc_32(void **state)

for (j = 0; j < MUX_MAX_STREAMS; ++j) {
for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k) {
if (td->mask[j][i] & BIT(k))
if (td->mask[j][k] & BIT(i))
sample = input_32b[j][k];
}
}
Expand Down