History

cbs_h266: H266RawSliceHeader, expose NumEntryPoints

Nuo Mi committed 3 years ago

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

Showing the changes to libavcodec (2 of 2 files). Show all

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
828 uint8_t sh_entry_offset_len_minus1;828 uint8_t sh_entry_offset_len_minus1;
829 uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS];829 uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS];
830 830
831 // derived values
832 uint32_t num_entry_points; ///< NumEntryPoints
833
831} H266RawSliceHeader;834} H266RawSliceHeader;
832 835
833typedef struct H266RawSlice {836typedef 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
3374 for (i = 0; i < current->sh_slice_header_extension_length; i++)3374 for (i = 0; i < current->sh_slice_header_extension_length; i++)
3375 us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i);3375 us(8, sh_slice_header_extension_data_byte[i], 0x00, 0xff, 1, i);
3376 }3376 }
3377
3378 current->num_entry_points = 0;
3377 if (sps->sps_entry_point_offsets_present_flag) {3379 if (sps->sps_entry_point_offsets_present_flag) {
3378 int num_entry_points = 0;
3379 uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag;3380 uint8_t entropy_sync = sps->sps_entropy_coding_sync_enabled_flag;
3380 int height;3381 int height;
3381 if (pps->pps_rect_slice_flag) {3382 if (pps->pps_rect_slice_flag) {
@@ -3392,7 +3393,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, · 10 unmodified lines
3392 else3393 else
3393 height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1;3394 height = pps->pps_slice_height_in_tiles_minus1[slice_idx] + 1;
3394 3395
3395 num_entry_points = width_in_tiles * height;3396 current->num_entry_points = width_in_tiles * height;
3396 } else {3397 } else {
3397 int tile_idx;3398 int tile_idx;
3398 int tile_y;3399 int tile_y;
@@ -3402,18 +3403,18 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw, · 3 unmodified lines
3402 current->sh_num_tiles_in_slice_minus1; tile_idx++) {3403 current->sh_num_tiles_in_slice_minus1; tile_idx++) {
3403 tile_y = tile_idx / pps->num_tile_rows;3404 tile_y = tile_idx / pps->num_tile_rows;
3404 height = pps->row_height_val[tile_y];3405 height = pps->row_height_val[tile_y];
3405 num_entry_points += (entropy_sync ? height : 1);3406 current->num_entry_points += (entropy_sync ? height : 1);
3406 }3407 }
3407 }3408 }
3408 num_entry_points--;3409 current->num_entry_points--;
3409 if (num_entry_points > VVC_MAX_ENTRY_POINTS) {3410 if (current->num_entry_points > VVC_MAX_ENTRY_POINTS) {
3410 av_log(ctx->log_ctx, AV_LOG_ERROR, "Too many entry points: "3411 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);
3412 return AVERROR_PATCHWELCOME;3413 return AVERROR_PATCHWELCOME;
3413 }3414 }
3414 if (num_entry_points > 0) {3415 if (current->num_entry_points > 0) {
3415 ue(sh_entry_offset_len_minus1, 0, 31);3416 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++) {
3417 ubs(current->sh_entry_offset_len_minus1 + 1,3418 ubs(current->sh_entry_offset_len_minus1 + 1,
3418 sh_entry_point_offset_minus1[i], 1, i);3419 sh_entry_point_offset_minus1[i], 1, i);
3419 }3420 }

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