cbs_h266: H266RawSliceHeader, expose NumEntryPoints
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
ad8dc5e814
commit
ea8571dc99
@ -828,6 +828,9 @@ typedef struct H266RawSliceHeader {
|
|||||||
uint8_t sh_entry_offset_len_minus1;
|
uint8_t sh_entry_offset_len_minus1;
|
||||||
uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS];
|
uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS];
|
||||||
|
|
||||||
|
// derived values
|
||||||
|
uint32_t num_entry_points; ///< NumEntryPoints
|
||||||
|
|
||||||
} H266RawSliceHeader;
|
} H266RawSliceHeader;
|
||||||
|
|
||||||
typedef struct H266RawSlice {
|
typedef struct H266RawSlice {
|
||||||
|
@ -3374,8 +3374,9 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
for (i = 0; i < current->sh_slice_header_extension_length; i++)
|
for (i = 0; i < current->sh_slice_header_extension_length; i++)
|
||||||
us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i);
|
us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current->num_entry_points = 0;
|
||||||
if (sps->sps_entry_point_offsets_present_flag) {
|
if (sps->sps_entry_point_offsets_present_flag) {
|
||||||
int num_entry_points = 0;
|
|
||||||
uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag;
|
uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag;
|
||||||
int height;
|
int height;
|
||||||
if (pps->pps_rect_slice_flag) {
|
if (pps->pps_rect_slice_flag) {
|
||||||
@ -3392,7 +3393,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
else
|
else
|
||||||
height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1;
|
height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1;
|
||||||
|
|
||||||
num_entry_points = width_in_tiles * height;
|
current->num_entry_points = width_in_tiles * height;
|
||||||
} else {
|
} else {
|
||||||
int tile_idx;
|
int tile_idx;
|
||||||
int tile_y;
|
int tile_y;
|
||||||
@ -3402,18 +3403,18 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
|
|||||||
current->sh_num_tiles_in_slice_minus1; tile_idx++) {
|
current->sh_num_tiles_in_slice_minus1; tile_idx++) {
|
||||||
tile_y = tile_idx / pps->num_tile_rows;
|
tile_y = tile_idx / pps->num_tile_rows;
|
||||||
height = pps->row_height_val[tile_y];
|
height = pps->row_height_val[tile_y];
|
||||||
num_entry_points += (entropy_sync ? height : 1);
|
current->num_entry_points += (entropy_sync ? height : 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
num_entry_points--;
|
current->num_entry_points--;
|
||||||
if (num_entry_points > VVC_MAX_ENTRY_POINTS) {
|
if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) {
|
||||||
av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: "
|
av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: "
|
||||||
"%" PRIu16 ".\n", num_entry_points);
|
"%" PRIu16 ".\n", current->num_entry_points);
|
||||||
return AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
if (num_entry_points > 0) {
|
if (current->num_entry_points > 0) {
|
||||||
ue(sh_entry_offset_len_minus1, 0, 31);
|
ue(sh_entry_offset_len_minus1, 0, 31);
|
||||||
for (i = 0; i < num_entry_points; i++) {
|
for (i = 0; i < current->num_entry_points; i++) {
|
||||||
ubs(current->sh_entry_offset_len_minus1 + 1,
|
ubs(current->sh_entry_offset_len_minus1 + 1,
|
||||||
sh_entry_point_offset_minus1[i], 1, i);
|
sh_entry_point_offset_minus1[i], 1, i);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user