def compute_max_value(ad_bits):
    """Compute the max value for the codebook with codewords of length ad_bits

    :param ad_bits: codeword length
    :type ad_bits: int
    :return: max value
    :rtype: int
    """
    tab = [0, None, 5, 17, 82, 375, 1263, 5262, 17579, 72909, 305276]
    return tab[ad_bits]