1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/cbs_h266: H266RawSliceHeader, expose curr_subpic_idx

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Nuo Mi 2023-09-05 21:01:22 +08:00 committed by James Almer
parent fa81de4af0
commit 09f783692e
2 changed files with 5 additions and 5 deletions

View File

@ -832,6 +832,7 @@ typedef struct H266RawSliceHeader {
uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS]; uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS];
// derived values // derived values
uint16_t curr_subpic_idx; ///< CurrSubpicIdx
uint32_t num_entry_points; ///< NumEntryPoints uint32_t num_entry_points; ///< NumEntryPoints
uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[] uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[]

View File

@ -3008,7 +3008,6 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
const H266RefPicLists *ref_pic_lists; const H266RefPicLists *ref_pic_lists;
int err, i; int err, i;
uint8_t nal_unit_type, qp_bd_offset; uint8_t nal_unit_type, qp_bd_offset;
uint16_t curr_subpic_idx;
uint16_t num_slices_in_subpic; uint16_t num_slices_in_subpic;
HEADER("Slice Header"); HEADER("Slice Header");
@ -3046,7 +3045,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
ub(sps->sps_subpic_id_len_minus1 + 1, sh_subpic_id); ub(sps->sps_subpic_id_len_minus1 + 1, sh_subpic_id);
for (i = 0; i <= sps->sps_num_subpics_minus1; i++) { for (i = 0; i <= sps->sps_num_subpics_minus1; i++) {
if (pps->sub_pic_id_val[i] == current->sh_subpic_id) { if (pps->sub_pic_id_val[i] == current->sh_subpic_id) {
curr_subpic_idx = i; current->curr_subpic_idx = i;
break; break;
} }
} }
@ -3055,10 +3054,10 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} else { } else {
curr_subpic_idx = 0; current->curr_subpic_idx = 0;
} }
num_slices_in_subpic = pps->num_slices_in_subpic[curr_subpic_idx]; num_slices_in_subpic = pps->num_slices_in_subpic[current->curr_subpic_idx];
if ((pps->pps_rect_slice_flag && num_slices_in_subpic > 1) || if ((pps->pps_rect_slice_flag && num_slices_in_subpic > 1) ||
(!pps->pps_rect_slice_flag && pps->num_tiles_in_pic > 1)) { (!pps->pps_rect_slice_flag && pps->num_tiles_in_pic > 1)) {
@ -3375,7 +3374,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
if (pps->pps_rect_slice_flag) { if (pps->pps_rect_slice_flag) {
int width_in_tiles; int width_in_tiles;
int slice_idx = current->sh_slice_address; int slice_idx = current->sh_slice_address;
for (i = 0; i < curr_subpic_idx; i++) { for (i = 0; i < current->curr_subpic_idx; i++) {
slice_idx += pps->num_slices_in_subpic[i]; slice_idx += pps->num_slices_in_subpic[i];
} }
width_in_tiles = width_in_tiles =