Skip to content

Commit

Permalink
implemented 5.1 (ChannelMapper)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozguronsoy committed Dec 7, 2024
1 parent 57506d9 commit 1f20250
Showing 1 changed file with 295 additions and 0 deletions.
295 changes: 295 additions & 0 deletions HephAudio/SourceFiles/AudioEffects/ChannelMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3248,6 +3248,301 @@ namespace HephAudio
},
},

// 5.1
{
HEPHAUDIO_CH_LAYOUT_5_POINT_0,
{
{
HEPHAUDIO_CH_LAYOUT_MONO,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[2] = in[0];
}
},

{
HEPHAUDIO_CH_LAYOUT_STEREO,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = in[0];
out[1] = in[1];
}
},

{
HEPHAUDIO_CH_LAYOUT_2_POINT_1,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = in[0];
out[1] = in[1];
out[3] = in[2];
}
},

{
HEPHAUDIO_CH_LAYOUT_2_1,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.9) + (in[2] * 0.1);
out[1] = (in[1] * 0.9) + (in[2] * 0.1);
out[2] = (in[2] * 0.5);
}
},

{
HEPHAUDIO_CH_LAYOUT_SURROUND,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = in[0];
out[1] = in[1];
out[2] = in[2];
}
},

{
HEPHAUDIO_CH_LAYOUT_3_POINT_1,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = in[0];
out[1] = in[1];
out[2] = in[2];
out[3] = in[3];
}
},

{
HEPHAUDIO_CH_LAYOUT_4_POINT_0,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.875) + (in[3] * 0.125);
out[1] = (in[1] * 0.875) + (in[3] * 0.125);
out[2] = (in[2] * 0.8) + (in[3] * 0.2);
}
},

{
HEPHAUDIO_CH_LAYOUT_2_2,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = in[0];
out[1] = in[1];
out[4] = in[2];
out[5] = in[3];
}
},

{
HEPHAUDIO_CH_LAYOUT_QUAD,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.875) + (in[2] * 0.125);
out[1] = (in[1] * 0.875) + (in[3] * 0.125);
}
},

{
HEPHAUDIO_CH_LAYOUT_4_POINT_1,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.875) + (in[4] * 0.125);
out[1] = (in[1] * 0.875) + (in[4] * 0.125);
out[2] = (in[2] * 0.8) + (in[4] * 0.2);
out[3] = in[3];
}
},

{
HEPHAUDIO_CH_LAYOUT_5_POINT_0,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = in[0];
out[1] = in[1];
out[2] = in[2];
out[4] = in[3];
out[5] = in[4];
}
},

{
HEPHAUDIO_CH_LAYOUT_5_POINT_0_BACK,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.875) + (in[3] * 0.125);
out[1] = (in[1] * 0.875) + (in[4] * 0.125);
out[2] = in[2];
}
},

{
HEPHAUDIO_CH_LAYOUT_5_POINT_1,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = in[0];
out[1] = in[1];
out[2] = in[2];
out[3] = in[3];
out[4] = in[4];
out[5] = in[5];
}
},

{
HEPHAUDIO_CH_LAYOUT_5_POINT_1_BACK,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.875) + (in[4] * 0.125);
out[1] = (in[1] * 0.875) + (in[5] * 0.125);
out[2] = in[2];
out[3] = in[3];
}
},

{
HEPHAUDIO_CH_LAYOUT_6_POINT_0,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.9) + (in[3] * 0.1);
out[1] = (in[1] * 0.9) + (in[3] * 0.1);
out[2] = (in[2] * 0.8) + (in[3] * 0.2);
out[4] = in[4];
out[5] = in[5];
}
},

{
HEPHAUDIO_CH_LAYOUT_6_POINT_0_FRONT,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.7) + (in[2] * 0.3);
out[1] = (in[1] * 0.7) + (in[3] * 0.3);
out[2] = (in[2] * 0.333) + (in[3] * 0.333);
out[4] = in[4];
out[5] = in[5];
}
},

{
HEPHAUDIO_CH_LAYOUT_HEXAGONAL,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.725) + (in[3] * 0.175) + (in[5] * 0.100);
out[1] = (in[1] * 0.725) + (in[4] * 0.175) + (in[5] * 0.100);
out[2] = (in[2] * 0.8) + (in[5] * 0.2);
}
},

{
HEPHAUDIO_CH_LAYOUT_6_POINT_1,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.9) + (in[4] * 0.1);
out[1] = (in[1] * 0.9) + (in[4] * 0.1);
out[2] = (in[2] * 0.8) + (in[4] * 0.2);
out[3] = in[3];
out[4] = in[5];
out[5] = in[6];
}
},

{
HEPHAUDIO_CH_LAYOUT_6_POINT_1_BACK,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.725) + (in[4] * 0.175) + (in[6] * 0.100);
out[1] = (in[1] * 0.725) + (in[5] * 0.175) + (in[6] * 0.100);
out[2] = (in[2] * 0.8) + (in[6] * 0.2);
out[3] = in[3];
}
},

{
HEPHAUDIO_CH_LAYOUT_6_POINT_1_FRONT,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.7) + (in[3] * 0.3);
out[1] = (in[1] * 0.7) + (in[4] * 0.3);
out[2] = (in[3] * 0.333) + (in[4] * 0.333);
out[3] = in[2];
out[4] = in[5];
out[5] = in[6];
}
},

{
HEPHAUDIO_CH_LAYOUT_7_POINT_0,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.875) + (in[3] * 0.125);
out[1] = (in[1] * 0.875) + (in[4] * 0.125);
out[2] = in[2];
out[4] = in[5];
out[5] = in[6];
}
},

{
HEPHAUDIO_CH_LAYOUT_7_POINT_0_FRONT,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.7) + (in[3] * 0.3);
out[1] = (in[1] * 0.7) + (in[4] * 0.3);
out[2] = (in[2] * 0.750) + (in[3] * 0.125) + (in[4] * 0.125);
out[4] = in[5];
out[5] = in[6];
}
},

{
HEPHAUDIO_CH_LAYOUT_7_POINT_1,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.875) + (in[4] * 0.125);
out[1] = (in[1] * 0.875) + (in[5] * 0.125);
out[2] = in[2];
out[3] = in[3];
out[4] = in[6];
out[5] = in[7];
}
},

{
HEPHAUDIO_CH_LAYOUT_7_POINT_1_WIDE,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.7) + (in[4] * 0.3);
out[1] = (in[1] * 0.7) + (in[5] * 0.3);
out[2] = (in[2] * 0.750) + (in[4] * 0.125) + (in[5] * 0.125);
out[3] = in[3];
out[4] = in[6];
out[5] = in[7];
}
},

{
HEPHAUDIO_CH_LAYOUT_7_POINT_1_WIDE_BACK,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.625) + (in[4] * 0.125) + (in[6] * 0.250);
out[1] = (in[1] * 0.625) + (in[5] * 0.125) + (in[7] * 0.250);
out[2] = (in[2] * 0.750) + (in[6] * 0.125) + (in[7] * 0.125);
out[3] = in[3];
}
},

{
HEPHAUDIO_CH_LAYOUT_OCTAGONAL,
[](heph_audio_sample_t* in, heph_audio_sample_t* out) -> void
{
out[0] = (in[0] * 0.75) + (in[3] * 0.15) + (in[5] * 0.10);
out[1] = (in[1] * 0.75) + (in[4] * 0.15) + (in[5] * 0.10);
out[2] = (in[2] * 0.8) + (in[5] * 0.2);
out[4] = in[6];
out[5] = in[7];
}
},
},
},

};
}
}

0 comments on commit 1f20250

Please sign in to comment.