Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -806,7 +806,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 805 unmodified lines | ||
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | if (current->nal_unit_header.nuh_layer_id == 0) |
| 809 | − u(3, sps_max_sub_layers_minus1, 0, vps->vps_max_sub_layers_minus1); | |
| 809 | + u(3, sps_max_sub_layers_minus1, 0, vps->vps_max_sub_layers_minus1); | |
| 810 | 810 | else { |
| 811 | 811 | u(3, sps_ext_or_max_sub_layers_minus1, 0, HEVC_MAX_SUB_LAYERS); |
| 812 | 812 | infer(sps_max_sub_layers_minus1, current->sps_ext_or_max_sub_layers_minus1 == HEVC_MAX_SUB_LAYERS |
| @@ -816,25 +816,25 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 3 unmodified lines | ||
| 816 | 816 | multi_layer_ext_sps_flag = current->nal_unit_header.nuh_layer_id && |
| 817 | 817 | current->sps_ext_or_max_sub_layers_minus1 == HEVC_MAX_SUB_LAYERS; |
| 818 | 818 | if (!multi_layer_ext_sps_flag) { |
| 819 | − flag(sps_temporal_id_nesting_flag); | |
| 819 | + flag(sps_temporal_id_nesting_flag); | |
| 820 | 820 | |
| 821 | − if (vps->vps_temporal_id_nesting_flag && | |
| 822 | − !current->sps_temporal_id_nesting_flag) { | |
| 823 | − av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " | |
| 824 | − "sps_temporal_id_nesting_flag must be 1 if " | |
| 825 | − "vps_temporal_id_nesting_flag is 1.\n"); | |
| 826 | − return AVERROR_INVALIDDATA; | |
| 827 | − } | |
| 828 | − if (current->sps_max_sub_layers_minus1 == 0 && | |
| 829 | − current->sps_temporal_id_nesting_flag != 1) { | |
| 830 | − av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " | |
| 831 | − "sps_temporal_id_nesting_flag must be 1 if " | |
| 832 | − "sps_max_sub_layers_minus1 is 0.\n"); | |
| 833 | − return AVERROR_INVALIDDATA; | |
| 834 | − } | |
| 821 | + if (vps->vps_temporal_id_nesting_flag && | |
| 822 | + !current->sps_temporal_id_nesting_flag) { | |
| 823 | + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " | |
| 824 | + "sps_temporal_id_nesting_flag must be 1 if " | |
| 825 | + "vps_temporal_id_nesting_flag is 1.\n"); | |
| 826 | + return AVERROR_INVALIDDATA; | |
| 827 | + } | |
| 828 | + if (current->sps_max_sub_layers_minus1 == 0 && | |
| 829 | + current->sps_temporal_id_nesting_flag != 1) { | |
| 830 | + av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid stream: " | |
| 831 | + "sps_temporal_id_nesting_flag must be 1 if " | |
| 832 | + "sps_max_sub_layers_minus1 is 0.\n"); | |
| 833 | + return AVERROR_INVALIDDATA; | |
| 834 | + } | |
| 835 | 835 | |
| 836 | − CHECK(FUNC(profile_tier_level)(ctx, rw, ¤t->profile_tier_level, | |
| 837 | − 1, current->sps_max_sub_layers_minus1)); | |
| 836 | + CHECK(FUNC(profile_tier_level)(ctx, rw, ¤t->profile_tier_level, | |
| 837 | + 1, current->sps_max_sub_layers_minus1)); | |
| 838 | 838 | } else { |
| 839 | 839 | if (current->sps_max_sub_layers_minus1 > 0) |
| 840 | 840 | infer(sps_temporal_id_nesting_flag, vps->vps_temporal_id_nesting_flag); |
| @@ -849,56 +849,56 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 8 unmodified lines | ||
| 849 | 849 | if (current->update_rep_format_flag) |
| 850 | 850 | ub(8, sps_rep_format_idx); |
| 851 | 851 | } else { |
| 852 | − ue(chroma_format_idc, 0, 3); | |
| 853 | − if (current->chroma_format_idc == 3) | |
| 854 | − flag(separate_colour_plane_flag); | |
| 855 | − else | |
| 856 | − infer(separate_colour_plane_flag, 0); | |
| 852 | + ue(chroma_format_idc, 0, 3); | |
| 853 | + if (current->chroma_format_idc == 3) | |
| 854 | + flag(separate_colour_plane_flag); | |
| 855 | + else | |
| 856 | + infer(separate_colour_plane_flag, 0); | |
| 857 | 857 | |
| 858 | − ue(pic_width_in_luma_samples, 1, HEVC_MAX_WIDTH); | |
| 859 | − ue(pic_height_in_luma_samples, 1, HEVC_MAX_HEIGHT); | |
| 858 | + ue(pic_width_in_luma_samples, 1, HEVC_MAX_WIDTH); | |
| 859 | + ue(pic_height_in_luma_samples, 1, HEVC_MAX_HEIGHT); | |
| 860 | 860 | |
| 861 | − flag(conformance_window_flag); | |
| 862 | − if (current->conformance_window_flag) { | |
| 863 | − ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples); | |
| 864 | − ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples); | |
| 865 | − ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples); | |
| 866 | − ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples); | |
| 867 | − } else { | |
| 868 | − infer(conf_win_left_offset, 0); | |
| 869 | − infer(conf_win_right_offset, 0); | |
| 870 | − infer(conf_win_top_offset, 0); | |
| 871 | − infer(conf_win_bottom_offset, 0); | |
| 872 | − } | |
| 861 | + flag(conformance_window_flag); | |
| 862 | + if (current->conformance_window_flag) { | |
| 863 | + ue(conf_win_left_offset, 0, current->pic_width_in_luma_samples); | |
| 864 | + ue(conf_win_right_offset, 0, current->pic_width_in_luma_samples); | |
| 865 | + ue(conf_win_top_offset, 0, current->pic_height_in_luma_samples); | |
| 866 | + ue(conf_win_bottom_offset, 0, current->pic_height_in_luma_samples); | |
| 867 | + } else { | |
| 868 | + infer(conf_win_left_offset, 0); | |
| 869 | + infer(conf_win_right_offset, 0); | |
| 870 | + infer(conf_win_top_offset, 0); | |
| 871 | + infer(conf_win_bottom_offset, 0); | |
| 872 | + } | |
| 873 | 873 | |
| 874 | − ue(bit_depth_luma_minus8, 0, 8); | |
| 875 | − ue(bit_depth_chroma_minus8, 0, 8); | |
| 874 | + ue(bit_depth_luma_minus8, 0, 8); | |
| 875 | + ue(bit_depth_chroma_minus8, 0, 8); | |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | ue(log2_max_pic_order_cnt_lsb_minus4, 0, 12); |
| 879 | 879 | |
| 880 | 880 | if (!multi_layer_ext_sps_flag) { |
| 881 | − flag(sps_sub_layer_ordering_info_present_flag); | |
| 882 | − for (i = (current->sps_sub_layer_ordering_info_present_flag ? | |
| 883 | − 0 : current->sps_max_sub_layers_minus1); | |
| 884 | − i <= current->sps_max_sub_layers_minus1; i++) { | |
| 885 | − ues(sps_max_dec_pic_buffering_minus1[i], | |
| 886 | − 0, HEVC_MAX_DPB_SIZE - 1, 1, i); | |
| 887 | − ues(sps_max_num_reorder_pics[i], | |
| 888 | − 0, current->sps_max_dec_pic_buffering_minus1[i], 1, i); | |
| 889 | − ues(sps_max_latency_increase_plus1[i], | |
| 890 | − 0, UINT32_MAX - 1, 1, i); | |
| 891 | − } | |
| 892 | − if (!current->sps_sub_layer_ordering_info_present_flag) { | |
| 893 | − for (i = 0; i < current->sps_max_sub_layers_minus1; i++) { | |
| 894 | − infer(sps_max_dec_pic_buffering_minus1[i], | |
| 895 | − current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]); | |
| 896 | − infer(sps_max_num_reorder_pics[i], | |
| 897 | − current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]); | |
| 898 | − infer(sps_max_latency_increase_plus1[i], | |
| 899 | − current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]); | |
| 881 | + flag(sps_sub_layer_ordering_info_present_flag); | |
| 882 | + for (i = (current->sps_sub_layer_ordering_info_present_flag ? | |
| 883 | + 0 : current->sps_max_sub_layers_minus1); | |
| 884 | + i <= current->sps_max_sub_layers_minus1; i++) { | |
| 885 | + ues(sps_max_dec_pic_buffering_minus1[i], | |
| 886 | + 0, HEVC_MAX_DPB_SIZE - 1, 1, i); | |
| 887 | + ues(sps_max_num_reorder_pics[i], | |
| 888 | + 0, current->sps_max_dec_pic_buffering_minus1[i], 1, i); | |
| 889 | + ues(sps_max_latency_increase_plus1[i], | |
| 890 | + 0, UINT32_MAX - 1, 1, i); | |
| 891 | + } | |
| 892 | + if (!current->sps_sub_layer_ordering_info_present_flag) { | |
| 893 | + for (i = 0; i < current->sps_max_sub_layers_minus1; i++) { | |
| 894 | + infer(sps_max_dec_pic_buffering_minus1[i], | |
| 895 | + current->sps_max_dec_pic_buffering_minus1[current->sps_max_sub_layers_minus1]); | |
| 896 | + infer(sps_max_num_reorder_pics[i], | |
| 897 | + current->sps_max_num_reorder_pics[current->sps_max_sub_layers_minus1]); | |
| 898 | + infer(sps_max_latency_increase_plus1[i], | |
| 899 | + current->sps_max_latency_increase_plus1[current->sps_max_sub_layers_minus1]); | |
| 900 | + } | |
| 900 | 901 | } |
| 901 | − } | |
| 902 | 902 | } |
| 903 | 903 | |
| 904 | 904 | ue(log2_min_luma_coding_block_size_minus3, 0, 3); |
| @@ -937,9 +937,9 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw, · 32 unmodified lines | ||
| 937 | 937 | if (current->sps_infer_scaling_list_flag) |
| 938 | 938 | ub(6, sps_scaling_list_ref_layer_id); |
| 939 | 939 | else { |
| 940 | − flag(sps_scaling_list_data_present_flag); | |
| 941 | − if (current->sps_scaling_list_data_present_flag) | |
| 942 | − CHECK(FUNC(scaling_list_data)(ctx, rw, ¤t->scaling_list)); | |
| 940 | + flag(sps_scaling_list_data_present_flag); | |
| 941 | + if (current->sps_scaling_list_data_present_flag) | |
| 942 | + CHECK(FUNC(scaling_list_data)(ctx, rw, ¤t->scaling_list)); | |
| 943 | 943 | } |
| 944 | 944 | } else { |
| 945 | 945 | infer(sps_scaling_list_data_present_flag, 0); |