cbs_h266: add VVC_MAX_VBS for max num of virtual boundaries

release/7.1
Nuo Mi 7 months ago
parent fc731d8b39
commit 8b3d1f1fb3
  1. 8
      libavcodec/cbs_h266.h
  2. 8
      libavcodec/cbs_h266_syntax_template.c
  3. 3
      libavcodec/vvc.h

@ -464,9 +464,9 @@ typedef struct H266RawSPS {
uint8_t sps_virtual_boundaries_enabled_flag;
uint8_t sps_virtual_boundaries_present_flag;
uint8_t sps_num_ver_virtual_boundaries;
uint16_t sps_virtual_boundary_pos_x_minus1[3];
uint16_t sps_virtual_boundary_pos_x_minus1[VVC_MAX_VBS];
uint8_t sps_num_hor_virtual_boundaries;
uint16_t sps_virtual_boundary_pos_y_minus1[3];
uint16_t sps_virtual_boundary_pos_y_minus1[VVC_MAX_VBS];
uint8_t sps_timing_hrd_params_present_flag;
uint8_t sps_sublayer_cpb_params_present_flag;
@ -703,9 +703,9 @@ typedef struct H266RawPictureHeader {
uint8_t ph_virtual_boundaries_present_flag;
uint8_t ph_num_ver_virtual_boundaries;
uint16_t ph_virtual_boundary_pos_x_minus1[3];
uint16_t ph_virtual_boundary_pos_x_minus1[VVC_MAX_VBS];
uint8_t ph_num_hor_virtual_boundaries;
uint16_t ph_virtual_boundary_pos_y_minus1[3];
uint16_t ph_virtual_boundary_pos_y_minus1[VVC_MAX_VBS];
uint8_t ph_pic_output_flag;
H266RefPicLists ph_ref_pic_lists;

@ -1562,13 +1562,13 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
flag(sps_virtual_boundaries_present_flag);
if (current->sps_virtual_boundaries_present_flag) {
ue(sps_num_ver_virtual_boundaries,
0, current->sps_pic_width_max_in_luma_samples <= 8 ? 0 : 3);
0, current->sps_pic_width_max_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
for (i = 0; i < current->sps_num_ver_virtual_boundaries; i++)
ues(sps_virtual_boundary_pos_x_minus1[i],
0, (current->sps_pic_width_max_in_luma_samples + 7) / 8 - 2,
1, i);
ue(sps_num_hor_virtual_boundaries,
0, current->sps_pic_height_max_in_luma_samples <= 8 ? 0 : 3);
0, current->sps_pic_height_max_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
for (i = 0; i < current->sps_num_hor_virtual_boundaries; i++)
ues(sps_virtual_boundary_pos_y_minus1[i],
0, (current->sps_pic_height_max_in_luma_samples + 7) /
@ -2714,13 +2714,13 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw,
flag(ph_virtual_boundaries_present_flag);
if (current->ph_virtual_boundaries_present_flag) {
ue(ph_num_ver_virtual_boundaries,
0, pps->pps_pic_width_in_luma_samples <= 8 ? 0 : 3);
0, pps->pps_pic_width_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
for (i = 0; i < current->ph_num_ver_virtual_boundaries; i++) {
ues(ph_virtual_boundary_pos_x_minus1[i],
0, (pps->pps_pic_width_in_luma_samples + 7) / 8 - 2, 1, i);
}
ue(ph_num_hor_virtual_boundaries,
0, pps->pps_pic_height_in_luma_samples <= 8 ? 0 : 3);
0, pps->pps_pic_height_in_luma_samples <= 8 ? 0 : VVC_MAX_VBS);
for (i = 0; i < current->ph_num_hor_virtual_boundaries; i++) {
ues(ph_virtual_boundary_pos_y_minus1[i],
0, (pps->pps_pic_height_in_luma_samples + 7) / 8 - 2, 1, i);

@ -151,6 +151,9 @@ enum {
// get near that, though, so set a lower limit here with the maximum
// possible value for 8K video (at most 135 32x32 Ctb rows).
VVC_MAX_ENTRY_POINTS = VVC_MAX_TILE_COLUMNS * 135,
// {sps, ph}_num_{ver, hor}_virtual_boundaries should in [0, 3]
VVC_MAX_VBS = 3,
};
#endif /* AVCODEC_VVC_H */

Loading…
Cancel
Save