int HevcSpsUnit::sub_layer_hrd_parameters(int subLayerId)
{
    for (size_t i = 0; i <= cpb_cnt_minus1[subLayerId]; i++)
    {
        unsigned bit_rate_value_minus1 = extractUEGolombCode();
        if (bit_rate_value_minus1 == 0xffffffff)
            return 1;
        unsigned cpb_size_value_minus1 = extractUEGolombCode();
        if (cpb_size_value_minus1 == 0xffffffff)
            return 1;
        if (sub_pic_hrd_params_present_flag)
        {
            unsigned cpb_size_du_value_minus1 = extractUEGolombCode();
            if (cpb_size_du_value_minus1 == 0xffffffff)
                return 1;
            unsigned bit_rate_du_value_minus1 = extractUEGolombCode();
            if (cpb_size_du_value_minus1 == 0xffffffff)
                return 1;
        }
        m_reader.skipBit();  // cbr_flag[ i ] u(1)
    }
    return 0;
}
int HevcSpsUnit::sub_layer_hrd_parameters(int subLayerId)
{
    for (size_t i = 0; i <= cpb_cnt_minus1[subLayerId]; i++)
    {
        unsigned bit_rate_value_minus1 = extractUEGolombCode();
        if (bit_rate_value_minus1 == 0xffffffff)
            return 1;
        unsigned cpb_size_value_minus1 = extractUEGolombCode();
        if (cpb_size_value_minus1 == 0xffffffff)
            return 1;
        if (sub_pic_hrd_params_present_flag)
        {
            unsigned cpb_size_du_value_minus1 = extractUEGolombCode();
            if (cpb_size_du_value_minus1 == 0xffffffff)
                return 1;
            unsigned bit_rate_du_value_minus1 = extractUEGolombCode();
            if (cpb_size_du_value_minus1 == 0xffffffff)
                return 1;
        }
        m_reader.skipBit();   
    }
    return 0;
}