/// Decorrelates mid and side channels into left and right channels.
///
/// In mid-side (MS) stereo, the left and right channels are encoded as average (mid) and
/// difference (side) components.
///
/// As per ISO/IEC 11172-3, to reconstruct the left and right channels, the following calculation
/// is performed:
///
/// ```text
///      l[i] = (m[i] + s[i]) / sqrt(2)
///      r[i] = (m[i] - s[i]) / sqrt(2)
/// ```
/// where:
///      l[i], and r[i] are the left and right channels, respectively.
///      m[i], and s[i] are the mid and side channels, respectively.
///
/// In the bitstream, m[i] is transmitted in channel 0, while s[i] in channel 1. After decoding,
/// the left channel replaces m[i] in channel 0, and the right channel replaces s[i] in channel
/// 1.
Decorrelates mid and side channels into left and right channels.
In mid-side (MS) stereo, the left and right channels are encoded as average (mid) and
difference (side) components.

As per ISO/IEC 11172-3, to reconstruct the left and right channels, the following calculation
is performed.



In the bitstream, m[i] is transmitted in channel 0, while s[i] in channel 1. After decoding,
the left channel replaces m[i] in channel 0, and the right channel replaces s[i] in channel
1.
Decorrelates mid and side channels into left and right channels . In mid - side ( MS ) stereo the left and right channels are encoded as average ( mid ) and difference ( side ) components . As per ISO / IEC 11172 - 3 to reconstruct the left and right channels the following calculation is performed . In the bitstream m [ i ] is transmitted in channel 0 while s [ i ] in channel 1 . After decoding the left channel replaces m [ i ] in channel 0 and the right channel replaces s [ i ] in channel 1 .
fn process_mid_side(mid: &mut [f32], side: &mut [f32]) {
    debug_assert!(mid.len() == side.len());
    for (m, s) in mid.iter_mut().zip(side) {
        let left = (*m + *s) * f32::consts::FRAC_1_SQRT_2;
        let right = (*m - *s) * f32::consts::FRAC_1_SQRT_2;
        *m = left;
        *s = right;
    }
}
fn process_mid_side ( mid : & mut [ f32 ] , side : & mut [ f32 ] ) { debug_assert ! ( mid len ( ) side len ( ) ) ; for ( m , s ) in mid . iter_mut ( ) . zip ( side ) { let left = ( * m + * s ) * f32 :: consts :: FRAC_1_SQRT_2 ; let right = ( * m - * s ) * f32 :: consts :: FRAC_1_SQRT_2 ; * m = left ; * s = right ; } }
Decorrelates mid and side channels into left and right channels.
Decorrelates mid and side channels into left and right channels .
mid
&mut [f32]
side
&mut [f32]