History

cbs_h266: H266RawSliceHeader, expose NumEntryPoints

Nuo Mi committed 3 years ago

Commit ea8571d1 parent ad8dc5e2 files · +12 −8Browse files

Unified · Split

2 files
  1. libavcodec/cbs_h266.h +3 −0
  2. libavcodec/cbs_h266_syntax_template.c +9 −8
libavcodec/cbs_h266.h+3−0
@@ -828,6 +828,9 @@ typedef struct H266RawSliceHeader { · 827 unmodified lines
828828 uint8_t sh_entry_offset_len_minus1;
829829 uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS];
830830
831+ // derived values
832+ uint32_t num_entry_points; ///< NumEntryPoints
833+
831834 } H266RawSliceHeader;
832835
833836 typedef struct H266RawSlice {
libavcodec/cbs_h266_syntax_template.c+9−8
@@ -3374,8 +3374,9 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, · 3373 unmodified lines
33743374 for (i = 0; i < current->sh_slice_header_extension_length; i++)
33753375 us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i);
33763376 }
3377+
3378+ current->num_entry_points = 0;
33773379 if (sps->sps_entry_point_offsets_present_flag) {
3378− int num_entry_points = 0;
33793380 uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag;
33803381 int height;
33813382 if (pps->pps_rect_slice_flag) {
@@ -3392,7 +3393,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, · 10 unmodified lines
33923393 else
33933394 height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1;
33943395
3395− num_entry_points = width_in_tiles * height;
3396+ current->num_entry_points = width_in_tiles * height;
33963397 } else {
33973398 int tile_idx;
33983399 int tile_y;
@@ -3402,18 +3403,18 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, · 3 unmodified lines
34023403 current->sh_num_tiles_in_slice_minus1; tile_idx++) {
34033404 tile_y = tile_idx / pps->num_tile_rows;
34043405 height = pps->row_height_val[tile_y];
3405− num_entry_points += (entropy_sync ? height : 1);
3406+ current->num_entry_points += (entropy_sync ? height : 1);
34063407 }
34073408 }
3408− num_entry_points--;
3409− if (num_entry_points > VVC_MAX_ENTRY_POINTS) {
3409+ current->num_entry_points--;
3410+ if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) {
34103411 av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: "
3411− "%" PRIu16 ".\n", num_entry_points);
3412+ "%" PRIu16 ".\n", current->num_entry_points);
34123413 return AVERROR_PATCHWELCOME;
34133414 }
3414− if (num_entry_points > 0) {
3415+ if (current->num_entry_points > 0) {
34153416 ue(sh_entry_offset_len_minus1, 0, 31);
3416− for (i = 0; i < num_entry_points; i++) {
3417+ for (i = 0; i < current->num_entry_points; i++) {
34173418 ubs(current->sh_entry_offset_len_minus1 + 1,
34183419 sh_entry_point_offset_minus1[i], 1, i);
34193420 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t