/// Inverts odd samples in odd sub-bands.
Inverts odd samples in odd sub-bands.
Inverts odd samples in odd sub - bands .
pub fn frequency_inversion(samples: &mut [f32; 576]) {
    // There are 32 sub-bands spanning 576 samples:
    //
    //        0    18    36    54    72    90   108       558    576
    //        +-----+-----+-----+-----+-----+-----+ . . . . +------+
    // s[i] = | sb0 | sb1 | sb2 | sb3 | sb4 | sb5 | . . . . | sb31 |
    //        +-----+-----+-----+-----+-----+-----+ . . . . +------+
    //
    // The odd sub-bands are thusly:
    //
    //      sb1  -> s[ 18.. 36]
    //      sb3  -> s[ 54.. 72]
    //      sb5  -> s[ 90..108]
    //      ...
    //      sb31 -> s[558..576]
    //
    // Each odd sample in the aforementioned sub-bands must be negated.
    for i in (18..576).step_by(36) {
        // Sample negation is unrolled into a 2x4 + 1 (9) operation to improve vectorization.
        for j in (i..i+16).step_by(8) {
            samples[j+1] = -samples[j+1];
            samples[j+3] = -samples[j+3];
            samples[j+5] = -samples[j+5];
            samples[j+7] = -samples[j+7];
        }
        samples[i+18-1] = -samples[i+18-1];
    }
}
pub fn frequency_inversion ( samples : & mut [ f32 ; 576 ] ) { // There are 32 sub-bands spanning 576 samples: // //        0    18    36    54    72    90   108       558    576 //        +-----+-----+-----+-----+-----+-----+ . . . . +------+ // s[i] = | sb0 | sb1 | sb2 | sb3 | sb4 | sb5 | . . . . | sb31 | //        +-----+-----+-----+-----+-----+-----+ . . . . +------+ // // The odd sub-bands are thusly: // //      sb1  -> s[ 18.. 36] //      sb3  -> s[ 54.. 72] //      sb5  -> s[ 90..108] //      ... //      sb31 -> s[558..576] // // Each odd sample in the aforementioned sub-bands must be negated. for i in ( 18 .. 576 ) . step_by ( 36 ) { // Sample negation is unrolled into a 2x4 + 1 (9) operation to improve vectorization. for j in ( i .. i + 16 ) . step_by ( 8 ) { samples [ j + 1 ] = - samples [ j + 1 ] ; samples [ j + 3 ] = - samples [ j + 3 ] ; samples [ j + 5 ] = - samples [ j + 5 ] ; samples [ j + 7 ] = - samples [ j + 7 ] ; } samples [ i + 18 - 1 ] = - samples [ i + 18 - 1 ] ; } }
Inverts odd samples in odd sub-bands.
Inverts odd samples in odd sub - bands .
samples
&mut [f32; 576]