flags(use_delta_flag[j], 1, j);
else
infer(use_delta_flag[j], 1);
- if (current->use_delta_flag[i])
+ if (current->use_delta_flag[j])
++num_ref_pics;
}
if (num_ref_pics >= HEVC_MAX_DPB_SIZE) {
return 0;
}
+static int FUNC(vui_parameters_default)(CodedBitstreamContext *ctx,
+ RWContext *rw, H265RawVUI *current,
+ H265RawSPS *sps)
+{
+ infer(aspect_ratio_idc, 0);
+
+ infer(video_format, 5);
+ infer(video_full_range_flag, 0);
+ infer(colour_primaries, 2);
+ infer(transfer_characteristics, 2);
+ infer(matrix_coefficients, 2);
+
+ infer(chroma_sample_loc_type_top_field, 0);
+ infer(chroma_sample_loc_type_bottom_field, 0);
+
+ 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;
+}
+
static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
H265RawSPS *current)
{
flag(vui_parameters_present_flag);
if (current->vui_parameters_present_flag)
CHECK(FUNC(vui_parameters)(ctx, rw, ¤t->vui, current));
+ else
+ CHECK(FUNC(vui_parameters_default)(ctx, rw, ¤t->vui, current));
flag(sps_extension_present_flag);
if (current->sps_extension_present_flag) {
infer(num_long_term_sps, 0);
idx_size = 0;
}
- ue(num_long_term_pics, 0, HEVC_MAX_LONG_TERM_REF_PICS);
+ ue(num_long_term_pics, 0, HEVC_MAX_REFS - current->num_long_term_sps);
for (i = 0; i < current->num_long_term_sps +
current->num_long_term_pics; i++) {