On 5/14/2017 6:24 PM, Mark Thompson wrote:
> +static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
> + H265RawVUI *current)
> +{
> + CodedBitstreamH265Context *h265 = ctx->priv_data;
> + const H265RawSPS *sps = h265->active_sps;
As i mentioned on irc, this is segfaulting when you try to dereference
sps. You should do the same you did with h264 instead.
> + int err;
> +
> + flag(aspect_ratio_info_present_flag);
> + if (current->aspect_ratio_info_present_flag) {
> + u(8, aspect_ratio_idc, 0, 255);
> + if (current->aspect_ratio_idc == 255) {
> + u(16, sar_width, 0, 65535);
> + u(16, sar_height, 0, 65535);
> + }
> + } else {
> + infer(aspect_ratio_idc, 0);
> + }
> +
> + flag(overscan_info_present_flag);
> + if (current->overscan_info_present_flag)
> + flag(overscan_appropriate_flag);
> +
> + flag(video_signal_type_present_flag);
> + if (current->video_signal_type_present_flag) {
> + u(3, video_format, 0, 7);
> + flag(video_full_range_flag);
> + flag(colour_description_present_flag);
> + if (current->colour_description_present_flag) {
> + u(8, colour_primaries, 0, 255);
> + u(8, transfer_characteristics, 0, 255);
> + u(8, matrix_coefficients, 0, 255);
> + } else {
> + infer(colour_primaries, 2);
> + infer(transfer_characteristics, 2);
> + infer(matrix_coefficients, 2);
> + }
> + } else {
> + infer(video_format, 5);
> + infer(video_full_range_flag, 0);
> + infer(colour_primaries, 2);
> + infer(transfer_characteristics, 2);
> + infer(matrix_coefficients, 2);
> + }
> +
> + flag(chroma_loc_info_present_flag);
> + if (current->chroma_loc_info_present_flag) {
> + ue(chroma_sample_loc_type_top_field, 0, 5);
> + ue(chroma_sample_loc_type_bottom_field, 0, 5);
> + } else {
> + infer(chroma_sample_loc_type_top_field, 0);
> + infer(chroma_sample_loc_type_bottom_field, 0);
> + }
> +
> + flag(neutral_chroma_indication_flag);
> + flag(field_seq_flag);
> + flag(frame_field_info_present_flag);
> +
> + flag(default_display_window_flag);
> + if (current->default_display_window_flag) {
> + ue(def_disp_win_left_offset, 0, 16384);
> + ue(def_disp_win_right_offset, 0, 16384);
> + ue(def_disp_win_top_offset, 0, 16384);
> + ue(def_disp_win_bottom_offset, 0, 16384);
> + }
> +
> + flag(vui_timing_info_present_flag);
> + if (current->vui_timing_info_present_flag) {
> + u(32, vui_num_units_in_tick, 1, UINT32_MAX);
> + u(32, vui_time_scale, 1, UINT32_MAX);
> + flag(vui_poc_proportional_to_timing_flag);
> + if (current->vui_poc_proportional_to_timing_flag)
> + ue(vui_num_ticks_poc_diff_one_minus1, 0, UINT32_MAX - 1);
> +
> + flag(vui_hrd_parameters_present_flag);
> + if (current->vui_hrd_parameters_present_flag) {
> + CHECK(FUNC(hrd_parameters)(ctx, rw, ¤t->hrd_parameters,
> + 1, sps->sps_max_sub_layers_minus1));
> + }
> + }
> +
> + flag(bitstream_restriction_flag);
> + if (current->bitstream_restriction_flag) {
> + flag(tiles_fixed_structure_flag);
> + flag(motion_vectors_over_pic_boundaries_flag);
> + flag(restricted_ref_pic_lists_flag);
> + ue(min_spatial_segmentation_idc, 0, 4095);
> + ue(max_bytes_per_pic_denom, 0, 16);
> + ue(max_bits_per_min_cu_denom, 0, 16);
> + ue(log2_max_mv_length_horizontal, 0, 16);
> + ue(log2_max_mv_length_vertical, 0, 16);
> + } else {
> + infer(tiles_fixed_structure_flag, 0);
> + infer(motion_vectors_over_pic_boundaries_flag, 1);
> + infer(min_spatial_segmentation_idc, 0);
> + infer(max_bytes_per_pic_denom, 2);
> + infer(max_bits_per_min_cu_denom, 1);
> + infer(log2_max_mv_length_horizontal, 15);
> + infer(log2_max_mv_length_vertical, 15);
> + }
> +
> + return 0;
> +}
> +
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel