コード例 #1
0
    def hrd_parameters(self, str_payload):
        dict_info = self.dict_info

        dict_info["cpb_cnt_minus1"] = pyUtils.read_ue(str_payload)
        dict_info["bit_rate_scale"] = pyUtils.read_bits(str_payload, 4)
        dict_info["cpb_size_scale"] = pyUtils.read_bits(str_payload, 4)

        dict_info["bit_rate_value_minus1"] = [
            0 for i in range(dict_info["cpb_cnt_minus1"] + 1)
        ]
        dict_info["cpb_size_value_minus1"] = [
            0 for i in range(dict_info["cpb_cnt_minus1"] + 1)
        ]
        dict_info["cbr_flag"] = [
            0 for i in range(dict_info["cpb_cnt_minus1"] + 1)
        ]
        for schedse1idex in range(dict_info["cpb_cnt_minus1"] + 1):
            dict_info["bit_rate_value_minus1"][schedse1idex] = pyUtils.read_ue(
                str_payload)
            dict_info["cpb_size_value_minus1"][schedse1idex] = pyUtils.read_ue(
                str_payload)
            dict_info["cbr_flag"][schedse1idex] = pyUtils.read_bits(
                str_payload, 1)

        dict_info[
            "initial_cpb_removal_delay_length_minus1"] = pyUtils.read_bits(
                str_payload, 5)
        dict_info["cpb_removal_delay_length_minus1"] = pyUtils.read_bits(
            str_payload, 5)
        dict_info["dpb_output_delay_length_minus1"] = pyUtils.read_bits(
            str_payload, 5)
        dict_info["time_offset_length"] = pyUtils.read_bits(str_payload, 5)
コード例 #2
0
ファイル: pySliceHeader.py プロジェクト: zpvan/py_avc_stream
    def dec_ref_pic_marking(self, str_payload):
        dict_info = self.dict_info
        nal_info = self.nal_info

        if nal_info["nal_unit_type"] == 5:
            dict_info["no_output_of_prior_pics_flag"] = pyUtils.read_bits(
                str_payload, 1)
            dict_info["long_term_reference_flag"] = pyUtils.read_bits(
                str_payload, 1)
        else:
            dict_info[
                "adaptive_ref_pic_marking_mode_flag"] = pyUtils.read_bits(
                    str_payload, 1)
            if dict_info["adaptive_ref_pic_marking_mode_flag"] == 1:
                dict_info["memory_management_control_operation"] = 1
                while dict_info["memory_management_control_operation"] != 0:
                    dict_info[
                        "memory_management_control_operation"] = pyUtils.read_ue(
                            str_payload)
                    if dict_info[
                            "memory_management_control_operation"] == 1 or dict_info[
                                "memory_management_control_operation"] == 3:
                        dict_info[
                            "difference_of_pic_nums_minus1"] = pyUtils.read_ue(
                                str_payload)
                    if dict_info["memory_management_control_operation"] == 2:
                        dict_info["long_term_pic_num"] = pyUtils.read_ue(
                            str_payload)
                    if dict_info[
                            "memory_management_control_operation"] == 3 or dict_info[
                                "memory_management_control_operation"] == 6:
                        dict_info["long_term_frame_idx"] = pyUtils.read_ue(
                            str_payload)
                    if dict_info["memory_management_control_operation"] == 4:
                        dict_info[
                            "max_long_term_frame_idx_plus1"] = pyUtils.read_ue(
                                str_payload)
コード例 #3
0
ファイル: pySliceHeader.py プロジェクト: zpvan/py_avc_stream
    def ref_pic_list_reordering(self, str_payload):
        dict_info = self.dict_info

        if (dict_info["slice_type"] % 5) != 2 and (dict_info["slice_type"] %
                                                   5) != 4:
            # slice_type != I and slice_type != SI
            dict_info["ref_pic_list_reordering_flag_l0"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["ref_pic_list_reordering_flag_l0"] == 1:
                dict_info["reordering_of_pic_nums_idc"] = 0
                while dict_info["reordering_of_pic_nums_idc"] != 3:
                    dict_info["reordering_of_pic_nums_idc"] = pyUtils.read_ue(
                        str_payload)
                    if dict_info[
                            "reordering_of_pic_nums_idc"] == 0 or dict_info[
                                "reordering_of_pic_nums_idc"] == 1:
                        dict_info["abs_diff_pic_num_minus1"] = pyUtils.read_ue(
                            str_payload)
                    elif dict_info["reordering_of_pic_nums_idc"] == 2:
                        dict_info["long_term_pic_num"] = pyUtils.read_ue(
                            str_payload)

        if (dict_info["slice_type"] % 5) == 1:
            # slice_type == B
            dict_info["ref_pic_list_reordering_flag_l1"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["ref_pic_list_reordering_flag_l1"] == 1:
                dict_info["reordering_of_pic_nums_idc"] = 0
                while dict_info["reordering_of_pic_nums_idc"] != 3:
                    dict_info["reordering_of_pic_nums_idc"] = pyUtils.read_ue(
                        str_payload)
                    if dict_info[
                            "reordering_of_pic_nums_idc"] == 0 or dict_info[
                                "reordering_of_pic_nums_idc"] == 1:
                        dict_info["abs_diff_pic_num_minus1"] = pyUtils.read_ue(
                            str_payload)
                    elif dict_info["reordering_of_pic_nums_idc"] == 2:
                        dict_info["long_term_pic_num"] = pyUtils.read_ue(
                            str_payload)
コード例 #4
0
    def vui_parameters(self, str_payload):
        dict_info = self.dict_info

        dict_info["aspect_ratio_info_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["aspect_ratio_info_present_flag"] == 1:
            dict_info["aspect_ratio_idc"] = pyUtils.read_bits(str_payload, 8)
            if dict_info["aspect_ratio_idc"] == self.Extended_SAR:
                dict_info["sar_width"] = pyUtils.read_bits(str_payload, 16)
                dict_info["sar_height"] = pyUtils.read_bits(str_payload, 16)
        dict_info["overscan_info_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["overscan_info_present_flag"] == 1:
            dict_info["overscan_appropriate_flag"] = pyUtils.read_bits(
                str_payload, 1)
        dict_info["video_signal_type_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["video_signal_type_present_flag"] == 1:
            dict_info["video_format"] = pyUtils.read_bits(str_payload, 3)
            dict_info["video_full_range_flag"] = pyUtils.read_bits(
                str_payload, 1)
            dict_info["colour_description_present_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["colour_description_present_flag"] == 1:
                dict_info["colour_primaries"] = pyUtils.read_bits(
                    str_payload, 8)
                dict_info["transfer_characteristics"] = pyUtils.read_bits(
                    str_payload, 8)
                dict_info["matrix_coefficients"] = pyUtils.read_bits(
                    str_payload, 8)
        dict_info["chroma_loc_info_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["chroma_loc_info_present_flag"] == 1:
            dict_info["chroma_sample_loc_type_top_field"] = pyUtils.read_ue(
                str_payload)
            dict_info["chroma_sample_loc_type_bottom_field"] = pyUtils.read_ue(
                str_payload)
        dict_info["timing_info_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["timing_info_present_flag"] == 1:
            dict_info["num_units_in_tick"] = pyUtils.read_bits(str_payload, 32)
            dict_info["time_scale"] = pyUtils.read_bits(str_payload, 32)
            dict_info["fixed_frame_rate_flag"] = pyUtils.read_bits(
                str_payload, 1)
        dict_info["nal_hrd_parameters_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["nal_hrd_parameters_present_flag"] == 1:
            self.hrd_parameters(str_payload)
        dict_info["vcl_hrd_parameters_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["vcl_hrd_parameters_present_flag"] == 1:
            self.hrd_parameters(str_payload)
        if dict_info["nal_hrd_parameters_present_flag"] == 1 or dict_info[
                "vcl_hrd_parameters_present_flag"] == 1:
            dict_info["low_delay_hrd_flag"] = pyUtils.read_bits(str_payload, 1)
        dict_info["pic_struct_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        dict_info["bitstream_restriction_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if dict_info["bitstream_restriction_flag"] == 1:
            dict_info[
                "motion_vectors_over_pic_boundaries_flag"] = pyUtils.read_bits(
                    str_payload, 1)
            dict_info["max_bytes_per_pic_denom"] = pyUtils.read_ue(str_payload)
            dict_info["max_bits_per_mb_denom"] = pyUtils.read_ue(str_payload)
            dict_info["log2_max_mv_length_horizontal"] = pyUtils.read_ue(
                str_payload)
            dict_info["log2_max_mv_length_vertical"] = pyUtils.read_ue(
                str_payload)
            dict_info["num_reorder_frames"] = pyUtils.read_ue(str_payload)
            dict_info["max_dec_frame_buffering"] = pyUtils.read_ue(str_payload)
コード例 #5
0
    def parse(self):
        dict_info = self.dict_info

        str_sps_bin = BitArray(self.rbsp).bin
        print("sps binary = " + str_sps_bin)
        str_payload = pyUtils.StrBinArray(str_sps_bin)

        dict_info["profile_idc"] = pyUtils.read_bits(str_payload, 8)
        dict_info["constraint_set0_flag"] = pyUtils.read_bits(str_payload, 1)
        dict_info["constraint_set1_flag"] = pyUtils.read_bits(str_payload, 1)
        dict_info["constraint_set2_flag"] = pyUtils.read_bits(str_payload, 1)
        dict_info["constraint_set3_flag"] = pyUtils.read_bits(str_payload, 1)
        dict_info["reserved_zero_4bits"] = pyUtils.read_bits(str_payload, 4)
        dict_info["level_idc"] = pyUtils.read_bits(str_payload, 8)
        dict_info["seq_parameter_set_id"] = pyUtils.read_ue(str_payload)
        if (dict_info["profile_idc"] == 100 or dict_info["profile_idc"] == 110
                or dict_info["profile_idc"] == 122
                or dict_info["profile_idc"] == 144):
            dict_info["chroma_format_idc"] = pyUtils.read_ue(str_payload)
            if dict_info["chroma_format_idc"] == 3:
                dict_info[
                    "residual_colour_transform_flag"] = pyUtils.read_bits(
                        str_payload, 1)
            dict_info["bit_depth_luma_minus8"] = pyUtils.read_ue(str_payload)
            dict_info["bit_depth_chroma_minus8"] = pyUtils.read_ue(str_payload)
            dict_info[
                "qpprime_y_zero_transform_bypass_flag"] = pyUtils.read_bits(
                    str_payload, 1)
            dict_info["seq_scaling_matrix_present_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["seq_scaling_matrix_present_flag"] == 1:
                dict_info["seq_scaling_list_present_flag"] = [
                    0 for i in range(8)
                ]
                dict_info["scaling_list_4x4"] = [[0 for j in range(16)]
                                                 for i in range(6)]
                dict_info["use_default_scaling_matrix_4x4_flag"] = [
                    0 for i in range(6)
                ]
                dict_info["scaling_list_8x8"] = [[0 for j in range(64)]
                                                 for i in range(2)]
                dict_info["use_default_scaling_matrix_8x8_flag"] = [
                    0 for i in range(2)
                ]
                for i in range(8):
                    dict_info["seq_scaling_list_present_flag"][
                        i] = pyUtils.read_bits(str_payload, 1)
                    if dict_info["seq_scaling_list_present_flag"][i] == 1:
                        if i < 6:
                            pyUtils.scaling_list(
                                str_payload, dict_info["scaling_list_4x4"][i],
                                16, dict_info[
                                    "use_default_scaling_matrix_4x4_flag"][i])
                        else:
                            pyUtils.scaling_list(
                                str_payload,
                                dict_info["scaling_list_8x8"][i - 6], 64,
                                dict_info[
                                    "use_default_scaling_matrix_8x8_flag"][i -
                                                                           6])
            dict_info["log2_max_frame_num_minus4"] = pyUtils.read_ue(
                str_payload)
            dict_info["pic_order_cnt_type"] = pyUtils.read_ue(str_payload)
            if dict_info["pic_order_cnt_type"] == 0:
                dict_info[
                    "log2_max_pic_order_cnt_lsb_minus4"] = pyUtils.read_ue(
                        str_payload)
            elif dict_info["pic_order_cnt_type"] == 1:
                dict_info[
                    "delta_pic_order_always_zero_flag"] = pyUtils.read_bits(
                        str_payload, 1)
                dict_info["offset_for_non_ref_pic"] = pyUtils.read_se(
                    str_payload)
                dict_info["offset_for_top_to_bottom_field"] = pyUtils.read_se(
                    str_payload)
                dict_info[
                    "num_ref_frames_in_pic_order_cnt_cycle"] = pyUtils.read_ue(
                        str_payload)
                dict_info["offset_for_ref_frame"] = [
                    0 for i in range(
                        dict_info["num_ref_frames_in_pic_order_cnt_cycle"])
                ]
                for i in range(
                        dict_info["num_ref_frames_in_pic_order_cnt_cycle"]):
                    dict_info["offset_for_ref_frame"][i] = pyUtils.read_se(
                        str_payload)
            dict_info["num_ref_frames"] = pyUtils.read_ue(str_payload)
            dict_info[
                "gaps_in_frame_num_value_allowed_flag"] = pyUtils.read_bits(
                    str_payload, 1)
            dict_info["pic_width_in_mbs_minus1"] = pyUtils.read_ue(str_payload)
            dict_info["pic_height_in_map_units_minus1"] = pyUtils.read_ue(
                str_payload)
            dict_info["frame_mbs_only_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["frame_mbs_only_flag"] == 0:
                dict_info["mb_adaptive_frame_field_flag"] = pyUtils.read_bits(
                    str_payload, 1)
            dict_info["direct_8x8_inference_flag"] = pyUtils.read_bits(
                str_payload, 1)
            dict_info["frame_cropping_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["frame_cropping_flag"] == 1:
                dict_info["frame_crop_left_offset"] = pyUtils.read_ue(
                    str_payload)
                dict_info["frame_crop_right_offset"] = pyUtils.read_ue(
                    str_payload)
                dict_info["frame_crop_top_offset"] = pyUtils.read_ue(
                    str_payload)
                dict_info["frame_crop_bottom_offset"] = pyUtils.read_ue(
                    str_payload)
            dict_info["vui_parameters_present_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["vui_parameters_present_flag"] == 1:
                self.vui_parameters(str_payload)
            pyUtils.rbsp_trailing_bits(str_payload)
コード例 #6
0
ファイル: pyPps.py プロジェクト: zpvan/py_avc_stream
    def parse(self):
        dict_info = self.dict_info

        str_pps_bin = BitArray(self.rbsp).bin
        print("pps binary = " + str_pps_bin)
        str_payload = pyUtils.StrBinArray(str_pps_bin)

        dict_info["pic_parameter_set_id"] = pyUtils.read_ue(str_payload)
        dict_info["seq_parameter_set_id"] = pyUtils.read_ue(str_payload)
        dict_info["entropy_coding_mode_flag"] = pyUtils.read_bits(
            str_payload, 1)
        dict_info["pic_order_present_flag"] = pyUtils.read_bits(str_payload, 1)
        dict_info["num_slice_groups_minus1"] = pyUtils.read_ue(str_payload)
        if dict_info["num_slice_groups_minus1"] > 0:
            dict_info["slice_group_map_type"] = pyUtils.read_ue(str_payload)
            if dict_info["slice_group_map_type"] == 0:
                dict_info["run_length_minus1"] = [
                    0 for i in range(dict_info["num_slice_groups_minus1"] + 1)
                ]
                for i_group in range(dict_info["num_slice_groups_minus1"] + 1):
                    dict_info["run_length_minus1"][i_group] = pyUtils.read_ue(
                        str_payload)
            elif dict_info["slice_group_map_type"] == 2:
                dict_info["top_left"] = [
                    0 for i in range(dict_info["num_slice_groups_minus1"] + 1)
                ]
                dict_info["bottom_right"] = [
                    0 for i in range(dict_info["num_slice_groups_minus1"] + 1)
                ]
                for i_group in range(dict_info["num_slice_groups_minus1"] + 1):
                    dict_info["top_left"][i_group] = pyUtils.read_ue(
                        str_payload)
                    dict_info["bottom_right"][i_group] = pyUtils.read_ue(
                        str_payload)
            elif dict_info["slice_group_map_type"] == 3 or dict_info[
                    "slice_group_map_type"] == 4 or dict_info[
                        "slice_group_map_type"] == 5:
                dict_info[
                    "slice_group_change_direction_flag"] = pyUtils.read_bits(
                        str_payload, 1)
                dict_info["slice_group_change_rate_minus1"] = pyUtils.read_ue(
                    str_payload)
                dict_info["pic_size_in_map_units_minus1"] = pyUtils.read_ue(
                    str_payload)
                for i in range(dict_info["pic_size_in_map_units_minus1"] + 1):
                    pass
        dict_info["num_ref_idx_l0_active_minus1"] = pyUtils.read_ue(
            str_payload)
        dict_info["num_ref_idx_l1_active_minus1"] = pyUtils.read_ue(
            str_payload)
        dict_info["weighted_pred_flag"] = pyUtils.read_bits(str_payload, 1)
        dict_info["weighted_bipred_idc"] = pyUtils.read_bits(str_payload, 2)
        dict_info["pic_init_qp_minus26"] = pyUtils.read_se(str_payload)
        dict_info["pic_init_qs_minus26"] = pyUtils.read_se(str_payload)
        dict_info["chroma_qp_index_offset"] = pyUtils.read_se(str_payload)
        dict_info[
            "deblocking_filter_control_present_flag"] = pyUtils.read_bits(
                str_payload, 1)
        dict_info["constrained_intra_pred_flag"] = pyUtils.read_bits(
            str_payload, 1)
        dict_info["redundant_pic_cnt_present_flag"] = pyUtils.read_bits(
            str_payload, 1)
        if pyUtils.more_rbsp_data(str_payload):
            dict_info["transform_8x8_mode_flag"] = pyUtils.read_bits(
                str_payload, 1)
            dict_info["pic_scaling_matrix_present_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["pic_scaling_matrix_present_flag"] == 1:
                dict_info["pic_scaling_list_present_flag"] = [
                    0 for i in range(6 + 2 * self.transform_8x8_mode_flag)
                ]
                dict_info["scaling_list_4x4"] = [[0 for j in range(16)]
                                                 for i in range(6)]
                dict_info["use_default_scaling_matrix_4x4_flag"] = [
                    0 for i in range(6)
                ]
                dict_info["scaling_list_8x8"] = [[0 for j in range(64)]
                                                 for i in range(2)]
                dict_info["use_default_scaling_matrix_8x8_flag"] = [
                    0 for i in range(2)
                ]
                for i in range(6 + 2 * self.transform_8x8_mode_flag):
                    dict_info["pic_scaling_list_present_flag"][
                        i] = pyUtils.read_bits(str_payload, 1)
                    if dict_info["pic_scaling_list_present_flag"][i] == 1:
                        if i < 6:
                            pyUtils.scaling_list(
                                str_payload, dict_info["scaling_list_4x4"][i],
                                16, dict_info[
                                    "use_default_scaling_matrix_4x4_flag"][i])
                        else:
                            pyUtils.scaling_list(
                                str_payload,
                                dict_info["scaling_list_8x8"][i - 6], 64,
                                dict_info[
                                    "use_default_scaling_matrix_8x8_flag"][i -
                                                                           6])
            dict_info["second_chroma_qp_index_offset"] = pyUtils.read_se(
                str_payload)
            pyUtils.rbsp_trailing_bits(str_payload)
コード例 #7
0
ファイル: pySliceHeader.py プロジェクト: zpvan/py_avc_stream
    def pred_weight_table(self, str_payload):
        dict_info = self.dict_info
        active_sps = self.active_sps

        dict_info["luma_log2_weight_denom"] = pyUtils.read_ue(str_payload)
        if active_sps["chroma_format_idc"] != 0:
            dict_info["chroma_log2_weight_denom"] = pyUtils.read_ue(
                str_payload)

        dict_info["luma_weight_l0"] = [
            0 for i in range(dict_info["num_ref_idx_l0_active_minus1"] + 1)
        ]
        dict_info["luma_offset_l0"] = [
            0 for i in range(dict_info["num_ref_idx_l0_active_minus1"] + 1)
        ]
        dict_info["chroma_weight_l0"] = [[
            0 for j in range(2)
        ] for i in range(dict_info["num_ref_idx_l0_active_minus1"] + 1)]
        dict_info["chroma_offset_l0"] = [[
            0 for j in range(2)
        ] for i in range(dict_info["num_ref_idx_l0_active_minus1"] + 1)]
        for i in range(dict_info["num_ref_idx_l0_active_minus1"] + 1):
            dict_info["luma_weight_l0_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["luma_weight_l0_flag"] == 1:
                dict_info["luma_weight_l0"][i] = pyUtils.read_se(str_payload)
                dict_info["luma_offset_l0"][i] = pyUtils.read_se(str_payload)
            if active_sps["chroma_format_idc"] != 0:
                dict_info["chroma_weight_l0_flag"] = pyUtils.read_bits(
                    str_payload, 1)
                if dict_info["chroma_weight_l0_flag"] == 1:
                    for j in range(2):
                        dict_info["chroma_weight_l0"][i][j] = pyUtils.read_se(
                            str_payload)
                        dict_info["chroma_offset_l0"][i][j] = pyUtils.read_se(
                            str_payload)

        if (dict_info["slice_type"] % 5) == 1:
            # slice_type == B
            dict_info["luma_weight_l1"] = [
                0 for i in range(dict_info["num_ref_idx_l1_active_minus1"] + 1)
            ]
            dict_info["luma_offset_l1"] = [
                0 for i in range(dict_info["num_ref_idx_l1_active_minus1"] + 1)
            ]
            dict_info["chroma_weight_l1"] = [[
                0 for j in range(2)
            ] for i in range(dict_info["num_ref_idx_l1_active_minus1"] + 1)]
            dict_info["chroma_offset_l1"] = [[
                0 for j in range(2)
            ] for i in range(dict_info["num_ref_idx_l1_active_minus1"] + 1)]
            for i in range(dict_info["num_ref_idx_l1_active_minus1"] + 1):
                dict_info["luma_weight_l1_flag"] = pyUtils.read_bits(
                    str_payload, 1)
                if dict_info["luma_weight_l1_flag"] == 1:
                    dict_info["luma_weight_l1"][i] = pyUtils.read_se(
                        str_payload)
                    dict_info["luma_offset_l1"][i] = pyUtils.read_se(
                        str_payload)
                if active_sps["chroma_format_idc"] != 0:
                    dict_info["chroma_weight_l1_flag"] = pyUtils.read_bits(
                        str_payload, 1)
                    if dict_info["chroma_weight_l1_flag"] == 1:
                        for j in range(2):
                            dict_info["chroma_weight_l1"][i][
                                j] = pyUtils.read_se(str_payload)
                            dict_info["chroma_offset_l1"][i][
                                j] = pyUtils.read_se(str_payload)
コード例 #8
0
ファイル: pySliceHeader.py プロジェクト: zpvan/py_avc_stream
    def parse(self):
        print("slice_header parse begin")
        dict_info = self.dict_info
        active_sps = self.active_sps
        active_pps = self.active_pps
        nal_info = self.nal_info

        str_slice_header_bin = BitArray(self.rbsp).bin
        # print("slice header binary = " + str_slice_header_bin)
        str_payload = pyUtils.StrBinArray(str_slice_header_bin)

        dict_info["first_mb_in_slice"] = pyUtils.read_ue(str_payload)
        dict_info["slice_type"] = pyUtils.read_ue(str_payload)
        dict_info["pic_parameter_set_id"] = pyUtils.read_ue(str_payload)
        dict_info["frame_num"] = pyUtils.read_bits(
            str_payload, active_sps["log2_max_frame_num_minus4"] + 4)
        if active_sps["frame_mbs_only_flag"] == 0:
            dict_info["field_pic_flag"] = pyUtils.read_bits(str_payload, 1)
            if dict_info["field_pic_flag"] == 1:
                dict_info["bottom_field_flag"] = pyUtils.read_bits(
                    str_payload, 1)
        if nal_info["nal_unit_type"] == 5:
            dict_info["idr_pic_id"] = pyUtils.read_ue(str_payload)
        if active_sps["pic_order_cnt_type"] == 0:
            dict_info["pic_order_cnt_lsb"] = pyUtils.read_bits(
                str_payload,
                active_sps["log2_max_pic_order_cnt_lsb_minus4"] + 4)
            if active_pps["pic_order_present_flag"] == 1 and dict_info[
                    "field_pic_flag"] == 0:
                dict_info["delta_pic_order_cnt_bottom"] = pyUtils.read_se(
                    str_payload)
        if active_sps["pic_order_cnt_type"] == 1 and active_sps[
                "delta_pic_order_always_zero_flag"] == 0:
            dict_info["delta_pic_order_cnt"] = []
            dict_info["delta_pic_order_cnt"].append(
                pyUtils.read_se(str_payload))
            if active_pps["pic_order_present_flag"] == 1 and dict_info[
                    "field_pic_flag"] == 0:
                dict_info["delta_pic_order_cnt"].append(
                    pyUtils.read_se(str_payload))
        if active_pps["redundant_pic_cnt_present_flag"] == 1:
            dict_info["redundant_pic_cnt"] = pyUtils.read_ue(str_payload)
        if (dict_info["slice_type"] % 5) == 1:
            # slice_type == B
            dict_info["direct_spatial_mv_pred_flag"] = pyUtils.read_bits(
                str_payload, 1)
        if (dict_info["slice_type"] %
                5) == 0 or (dict_info["slice_type"] %
                            5) == 3 or (dict_info["slice_type"] % 5) == 1:
            # slice_type == P or slice_type == SP or slice_type == B
            dict_info["num_ref_idx_active_override_flag"] = pyUtils.read_bits(
                str_payload, 1)
            if dict_info["num_ref_idx_active_override_flag"] == 1:
                dict_info["num_ref_idx_l0_active_minus1"] = pyUtils.read_ue(
                    str_payload)
                if (dict_info["slice_type"] % 5) == 1:
                    dict_info[
                        "num_ref_idx_l1_active_minus1"] = pyUtils.read_ue(
                            str_payload)
        self.ref_pic_list_reordering(str_payload)
        if (active_pps["weighted_pred_flag"] == 1 and
            ((dict_info["slice_type"] % 5) == 0 or
             (dict_info["slice_type"] % 5) == 3)) or (
                 active_pps["weighted_bipred_idc"] == 1 and
                 (dict_info["slice_type"] % 5) == 1):
            self.pred_weight_table(str_payload)
        if nal_info["nal_ref_idc"] != 0:
            self.dec_ref_pic_marking(str_payload)
        if active_pps["entropy_coding_mode_flag"] == 1 and (
                dict_info["slice_type"] %
                5) != 2 and (dict_info["slice_type"] % 5) != 4:
            dict_info["cabac_init_idc"] = pyUtils.read_ue(str_payload)
        dict_info["slice_qp_delta"] = pyUtils.read_se(str_payload)
        if (dict_info["slice_type"] % 5) == 3 or (dict_info["slice_type"] %
                                                  5) == 4:
            if (dict_info["slice_type"] % 5) == 3:
                dict_info["sp_for_switch_flag"] = pyUtils.read_bits(
                    str_payload, 1)
            dict_info["slice_qs_delta"] = pyUtils.read_se(str_payload)
        if active_pps["deblocking_filter_control_present_flag"] == 1:
            dict_info["disable_deblocking_filter_idc"] = pyUtils.read_ue(
                str_payload)
            if dict_info["disable_deblocking_filter_idc"] != 1:
                dict_info["slice_alpha_c0_offset_div2"] = pyUtils.read_se(
                    str_payload)
                dict_info["slice_beta_offset_div2"] = pyUtils.read_se(
                    str_payload)
        if active_pps["num_slice_groups_minus1"] > 0 and active_pps[
                "slice_group_map_type"] >= 3 and active_pps[
                    "slice_group_map_type"] <= 5:
            # self.slice_group_change_cycle =
            pass

        print("slice_header parse begin")
        pass