/* Build subband samples with noise weighted by q->tone_level. Called by synthfilt_build_sb_samples. */
static void build_sb_samples_from_noise(QDM2Context *q, int sb)
/* Build subband samples with noise weighted by q->tone_level. Called by synthfilt_build_sb_samples. */
static void build_sb_samples_from_noise(QDM2Context *q, int sb)
{
    int ch, j;
    FIX_NOISE_IDX(q->noise_idx);
    if (!q->nb_channels)
        return;
    for (ch = 0; ch < q->nb_channels; ch++)
        for (j = 0; j < 64; j++) {
            q->sb_samples[ch][j * 2][sb] = (int32_t)(f2i_scale * SB_DITHERING_NOISE(sb,q->noise_idx) * q->tone_level[ch][sb][j] + .5);
            q->sb_samples[ch][j * 2 + 1][sb] = (int32_t)(f2i_scale * SB_DITHERING_NOISE(sb,q->noise_idx) * q->tone_level[ch][sb][j] + .5);
        }
}