def sei_ff_coding(bs: BitStream): value = 0 next_byte = 0xFF while next_byte == 0xFF: next_byte = bs.read_bits(8) value += next_byte return value
def more_rbsp_data(bs: BitStream): n = bs.available() if n > 8: return True elif n <= 0: return False b = bs.read_bits(n, forward=False) return not b == (1 << (n - 1))
def __fields_in_scaling_list(d: Table, bs: BitStream): num = 8 if d.chroma_format_idc != 3 else 12 d.seq_scaling_list_present_flag = [0] * num d.ScalingList4x4 = [[0] * 16 for i in range(6)] d.UseDefaultScalingMatrix4x4Flag = [False] * 6 d.ScalingList8x8 = [[0] * 64 for i in range(6)] d.UseDefaultScalingMatrix8x8Flag = [False] * 6 for i in range(num): d.seq_scaling_list_present_flag[i] = bs.read_bits(1) if d.seq_scaling_list_present_flag[i]: if i < 6: scaling_list(d.ScalingList4x4[i], bs, d.UseDefaultScalingMatrix4x4Flag, i) else: scaling_list(d.ScalingList8x8[i - 6], bs, d.UseDefaultScalingMatrix8x8Flag, i - 6)