pub(super) fn requantize(
    header: &FrameHeader,
    channel: &GranuleChannel,
    buf: &mut [f32; 576],
) {
    match channel.block_type {
        BlockType::Short { is_mixed: false } => {
            requantize_short(channel, &SFB_SHORT_BANDS[header.sample_rate_idx], 0, buf);
        },
        BlockType::Short { is_mixed: true } => {
            // A mixed block is a combination of a long block and short blocks. The first few scale
            // factor bands, and thus samples, belong to a single long block, while the remaining
            // bands and samples belong to short blocks. Therefore, requantization for mixed blocks
            // can be decomposed into short and long block requantizations.
            //
            // As per ISO/IEC 11172-3, the short scale factor band at which the long block ends and
            // the short blocks begin is denoted by switch_point_s.
            let bands = SFB_MIXED_BANDS[header.sample_rate_idx];
            let switch = SFB_MIXED_SWITCH_POINT[header.sample_rate_idx];

            requantize_long(channel, &bands[..switch], buf);
            requantize_short(channel, &bands[switch..], switch, buf);
        },
        _ => {
            requantize_long(channel, &SFB_LONG_BANDS[header.sample_rate_idx], buf);
        },
    }
}
/// Requantize samples in `buf` regardless of block type.
Requantize samples in `buf` regardless of block type.
Requantize samples in ` buf ` regardless of block type .
pub(super) fn requantize(
    header: &FrameHeader,
    channel: &GranuleChannel,
    buf: &mut [f32; 576],
) {
    match channel.block_type {
        BlockType::Short { is_mixed: false } => {
            requantize_short(channel, &SFB_SHORT_BANDS[header.sample_rate_idx], 0, buf);
        },
        BlockType::Short { is_mixed: true } => {
            // A mixed block is a combination of a long block and short blocks. The first few scale
            // factor bands, and thus samples, belong to a single long block, while the remaining
            // bands and samples belong to short blocks. Therefore, requantization for mixed blocks
            // can be decomposed into short and long block requantizations.
            //
            // As per ISO/IEC 11172-3, the short scale factor band at which the long block ends and
            // the short blocks begin is denoted by switch_point_s.
            let bands = SFB_MIXED_BANDS[header.sample_rate_idx];
            let switch = SFB_MIXED_SWITCH_POINT[header.sample_rate_idx];
            requantize_long(channel, &bands[..switch], buf);
            requantize_short(channel, &bands[switch..], switch, buf);
        },
        _ => {
            requantize_long(channel, &SFB_LONG_BANDS[header.sample_rate_idx], buf);
        },
    }
}
pub ( super ) fn requantize ( header : & FrameHeader , channel : & GranuleChannel , buf : & mut [ f32 ; 576 ] , ) { match channel . block_type { BlockType :: Short { is_mixed : false } => { requantize_short ( channel , & SFB_SHORT_BANDS [ header . sample_rate_idx ] , 0 , buf ) ; } , BlockType :: Short { is_mixed : true } => { // A mixed block is a combination of a long block and short blocks. The first few scale // factor bands, and thus samples, belong to a single long block, while the remaining // bands and samples belong to short blocks. Therefore, requantization for mixed blocks // can be decomposed into short and long block requantizations. // // As per ISO/IEC 11172-3, the short scale factor band at which the long block ends and // the short blocks begin is denoted by switch_point_s. let bands = SFB_MIXED_BANDS [ header . sample_rate_idx ] ; let switch = SFB_MIXED_SWITCH_POINT [ header . sample_rate_idx ] ; requantize_long ( channel , & bands [ .. switch ] , buf ) ; requantize_short ( channel , & bands [ switch .. ] , switch , buf ) ; } , _ => { requantize_long ( channel , & SFB_LONG_BANDS [ header . sample_rate_idx ] , buf ) ; } , } }
Requantize samples in `buf` regardless of block type.
Requantize samples in ` buf ` regardless of block type .
header
&FrameHeader
channel
&GranuleChannel
buf
&mut [f32; 576]
header
&FrameHeader
channel
&GranuleChannel
buf
&mut [f32; 576]