def read_decorrelation_terms(sub_block_size, actual_size_1_less, sub_block_data
    ):
    """returns a list of decorrelation terms
    and a list of decorrelation deltas per decorrelation pass

    term[pass] , delta[pass]"""
    if actual_size_1_less == 0:
        passes = sub_block_size * 2
    else:
        passes = sub_block_size * 2 - 1
    if passes > 16:
        raise ValueError('invalid decorrelation passes count')
    decorrelation_terms = []
    decorrelation_deltas = []
    for i in range(passes):
        decorrelation_terms.append(sub_block_data.read(5) - 5)
        if not (1 <= decorrelation_terms[-1] and decorrelation_terms[-1] <=
            18 or -3 <= decorrelation_terms[-1] and decorrelation_terms[-1] <=
            -1):
            raise ValueError('invalid decorrelation term')
        decorrelation_deltas.append(sub_block_data.read(3))
    decorrelation_terms.reverse()
    decorrelation_deltas.reverse()
    return decorrelation_terms, decorrelation_deltas
