fn imdct12_win(x: &[f32], window: &[f32; 36], out: &mut [f32; 36]) {
    debug_assert!(x.len() == 18);

    let cos12 = &IMDCT_COS_12;

    for w in 0..3 {
        for i in 0..12 {
            // Apply a 12-point (N=12) IMDCT for each of the 3 short windows.
            //
            // The IMDCT is defined as:
            //
            //        (N/2)-1
            // y[i] =   SUM   { x[k] * cos(PI/2N * (2i + 1 + N/2) * (2k + 1)) }
            //          k=0
            //
            // For N=12, the IMDCT becomes:
            //
            //         5
            // y[i] = SUM { x[k] * cos(PI/24 * (2i + 7) * (2k + 1)) }
            //        k=0
            //
            // The value of cos(..) is easily indexable by i and k, and is therefore pre-computed
            // and placed in a look-up table.
            let y = (x[w] * cos12[i][0])
                        + (x[3*1 + w] * cos12[i][1])
                        + (x[3*2 + w] * cos12[i][2])
                        + (x[3*3 + w] * cos12[i][3])
                        + (x[3*4 + w] * cos12[i][4])
                        + (x[3*5 + w] * cos12[i][5]);

            // Each adjacent 12-point IMDCT window is overlapped and added in the output, with the
            // first and last 6 samples of the output are always being 0.
            //
            // In the above calculation, y is the result of the 12-point IMDCT for sample i. For the
            // following description, assume the 12-point IMDCT result is y[0..12], where the value
            // y calculated above is y[i].
            //
            // Each sample in the IMDCT is multiplied by the appropriate window function as
            // specified in ISO/IEC 11172-3. The values of the window function are pre-computed and
            // given by window[0..12].
            //
            // Since there are 3 IMDCT windows (indexed by w), y[0..12] is calculated 3 times.
            // For the purpose of the diagram below, we label these IMDCT windows as: y0[0..12],
            // y1[0..12], and y2[0..12], for IMDCT windows 0..3 respectively.
            //
            // Therefore, the overlap-and-add operation can be visualized as below:
            //
            // 0             6           12           18           24           30            36
            // +-------------+------------+------------+------------+------------+-------------+
            // |      0      |  y0[..6]   |  y0[..6]   |  y1[6..]   |  y2[6..]   |      0      |
            // |     (6)     |            |  + y1[6..] |  + y2[..6] |            |     (6)     |
            // +-------------+------------+------------+------------+------------+-------------+
            // .             .            .            .            .            .             .
            // .             +-------------------------+            .            .             .
            // .             |      IMDCT #1 (y0)      |            .            .             .
            // .             +-------------------------+            .            .             .
            // .             .            +-------------------------+            .             .
            // .             .            |      IMDCT #2 (y1)      |            .             .
            // .             .            +-------------------------+            .             .
            // .             .            .            +-------------------------+             .
            // .             .            .            |      IMDCT #3 (y2)      |             .
            // .             .            .            +-------------------------+             .
            // .             .            .            .            .            .             .
            out[6 + 6*w + i] += y * window[i];
        }
    }
}
/// Performs the 12-point IMDCT, and windowing for each of the 3 short windows of a short block, and
/// then overlap-adds the result.
Performs the 12-point IMDCT, and windowing for each of the 3 short windows of a short block, and
then overlap-adds the result.
Performs the 12 - point IMDCT and windowing for each of the 3 short windows of a short block and then overlap - adds the result .
fn imdct12_win(x: &[f32], window: &[f32; 36], out: &mut [f32; 36]) {
    debug_assert!(x.len() == 18);
    let cos12 = &IMDCT_COS_12;
    for w in 0..3 {
        for i in 0..12 {
            // Apply a 12-point (N=12) IMDCT for each of the 3 short windows.
            //
            // The IMDCT is defined as:
            //
            //        (N/2)-1
            // y[i] =   SUM   { x[k] * cos(PI/2N * (2i + 1 + N/2) * (2k + 1)) }
            //          k=0
            //
            // For N=12, the IMDCT becomes:
            //
            //         5
            // y[i] = SUM { x[k] * cos(PI/24 * (2i + 7) * (2k + 1)) }
            //        k=0
            //
            // The value of cos(..) is easily indexable by i and k, and is therefore pre-computed
            // and placed in a look-up table.
            let y = (x[w] * cos12[i][0])
                        + (x[3*1 + w] * cos12[i][1])
                        + (x[3*2 + w] * cos12[i][2])
                        + (x[3*3 + w] * cos12[i][3])
                        + (x[3*4 + w] * cos12[i][4])
                        + (x[3*5 + w] * cos12[i][5]);
            // Each adjacent 12-point IMDCT window is overlapped and added in the output, with the
            // first and last 6 samples of the output are always being 0.
            //
            // In the above calculation, y is the result of the 12-point IMDCT for sample i. For the
            // following description, assume the 12-point IMDCT result is y[0..12], where the value
            // y calculated above is y[i].
            //
            // Each sample in the IMDCT is multiplied by the appropriate window function as
            // specified in ISO/IEC 11172-3. The values of the window function are pre-computed and
            // given by window[0..12].
            //
            // Since there are 3 IMDCT windows (indexed by w), y[0..12] is calculated 3 times.
            // For the purpose of the diagram below, we label these IMDCT windows as: y0[0..12],
            // y1[0..12], and y2[0..12], for IMDCT windows 0..3 respectively.
            //
            // Therefore, the overlap-and-add operation can be visualized as below:
            //
            // 0             6           12           18           24           30            36
            // +-------------+------------+------------+------------+------------+-------------+
            // |      0      |  y0[..6]   |  y0[..6]   |  y1[6..]   |  y2[6..]   |      0      |
            // |     (6)     |            |  + y1[6..] |  + y2[..6] |            |     (6)     |
            // +-------------+------------+------------+------------+------------+-------------+
            // .             .            .            .            .            .             .
            // .             +-------------------------+            .            .             .
            // .             |      IMDCT #1 (y0)      |            .            .             .
            // .             +-------------------------+            .            .             .
            // .             .            +-------------------------+            .             .
            // .             .            |      IMDCT #2 (y1)      |            .             .
            // .             .            +-------------------------+            .             .
            // .             .            .            +-------------------------+             .
            // .             .            .            |      IMDCT #3 (y2)      |             .
            // .             .            .            +-------------------------+             .
            // .             .            .            .            .            .             .
            out[6 + 6*w + i] += y * window[i];
        }
    }
}
fn imdct12_win ( x : & [ f32 ] , window : & [ f32 ; 36 ] , out : & mut [ f32 ; 36 ] ) { debug_assert ! ( x len ( ) 18 ) ; let cos12 = & IMDCT_COS_12 ; for w in 0 .. 3 { for i in 0 .. 12 { // Apply a 12-point (N=12) IMDCT for each of the 3 short windows. // // The IMDCT is defined as: // //        (N/2)-1 // y[i] =   SUM   { x[k] * cos(PI/2N * (2i + 1 + N/2) * (2k + 1)) } //          k=0 // // For N=12, the IMDCT becomes: // //         5 // y[i] = SUM { x[k] * cos(PI/24 * (2i + 7) * (2k + 1)) } //        k=0 // // The value of cos(..) is easily indexable by i and k, and is therefore pre-computed // and placed in a look-up table. let y = ( x [ w ] * cos12 [ i ] [ 0 ] ) + ( x [ 3 * 1 + w ] * cos12 [ i ] [ 1 ] ) + ( x [ 3 * 2 + w ] * cos12 [ i ] [ 2 ] ) + ( x [ 3 * 3 + w ] * cos12 [ i ] [ 3 ] ) + ( x [ 3 * 4 + w ] * cos12 [ i ] [ 4 ] ) + ( x [ 3 * 5 + w ] * cos12 [ i ] [ 5 ] ) ; // Each adjacent 12-point IMDCT window is overlapped and added in the output, with the // first and last 6 samples of the output are always being 0. // // In the above calculation, y is the result of the 12-point IMDCT for sample i. For the // following description, assume the 12-point IMDCT result is y[0..12], where the value // y calculated above is y[i]. // // Each sample in the IMDCT is multiplied by the appropriate window function as // specified in ISO/IEC 11172-3. The values of the window function are pre-computed and // given by window[0..12]. // // Since there are 3 IMDCT windows (indexed by w), y[0..12] is calculated 3 times. // For the purpose of the diagram below, we label these IMDCT windows as: y0[0..12], // y1[0..12], and y2[0..12], for IMDCT windows 0..3 respectively. // // Therefore, the overlap-and-add operation can be visualized as below: // // 0             6           12           18           24           30            36 // +-------------+------------+------------+------------+------------+-------------+ // |      0      |  y0[..6]   |  y0[..6]   |  y1[6..]   |  y2[6..]   |      0      | // |     (6)     |            |  + y1[6..] |  + y2[..6] |            |     (6)     | // +-------------+------------+------------+------------+------------+-------------+ // .             .            .            .            .            .             . // .             +-------------------------+            .            .             . // .             |      IMDCT #1 (y0)      |            .            .             . // .             +-------------------------+            .            .             . // .             .            +-------------------------+            .             . // .             .            |      IMDCT #2 (y1)      |            .             . // .             .            +-------------------------+            .             . // .             .            .            +-------------------------+             . // .             .            .            |      IMDCT #3 (y2)      |             . // .             .            .            +-------------------------+             . // .             .            .            .            .            .             . out [ 6 + 6 * w + i ] += y * window [ i ] ; } } }
Performs the 12-point IMDCT, and windowing for each of the 3 short windows of a short block, and
then overlap-adds the result.
Performs the 12 - point IMDCT and windowing for each of the 3 short windows of a short block and then overlap - adds the result .
x
&[f32]
window
&[f32; 36]
out
&mut [f32; 36]
x
&[f32]
window
&[f32; 36]
out
&mut [f32; 36]