/* Parses the bs_info field to extract the block partitioning used in block switching mode, refer to ISO/IEC 14496-3, section 11.6.2.  */
static void parse_bs_info(const uint32_t bs_info, unsigned int n, unsigned int div, unsigned int **div_blocks, unsigned int *num_blocks)
/* Parses the bs_info field to extract the block partitioning used in block switching mode, refer to ISO/IEC 14496-3, section 11.6.2.  */
static void parse_bs_info(const uint32_t bs_info, unsigned int n, unsigned int div, unsigned int **div_blocks, unsigned int *num_blocks)
{
    if (n < 31 && ((bs_info << n) & 0x40000000)) {
        n   *= 2;
        div += 1;
        parse_bs_info(bs_info, n + 1, div, div_blocks, num_blocks);
        parse_bs_info(bs_info, n + 2, div, div_blocks, num_blocks);
    } else {
        **div_blocks = div;
        (*div_blocks)++;
        (*num_blocks)++;
    }
}