aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorNuo Mi <nuomi2021@gmail.com>2023-09-05 21:01:22 +0800
committerJames Almer <jamrial@gmail.com>2023-11-11 11:53:21 -0300
commit09f783692e218b446cf5778ce9271360458ebadc (patch)
tree7d22a35aaa5e0cdcfde59619d1ce8cf48d7d8e7d /libavcodec
parentfa81de4af045317aefeae941cf54f349c39e81e0 (diff)
downloadffmpeg-09f783692e218b446cf5778ce9271360458ebadc.tar.gz
avcodec/cbs_h266: H266RawSliceHeader, expose curr_subpic_idx
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/cbs_h266.h1
-rw-r--r--libavcodec/cbs_h266_syntax_template.c9
2 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h
index d2ba99f522..8b3ad391b1 100644
--- a/libavcodec/cbs_h266.h
+++ b/libavcodec/cbs_h266.h
@@ -832,6 +832,7 @@ typedef struct H266RawSliceHeader {
uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS];
// derived values
+ uint16_t curr_subpic_idx; ///< CurrSubpicIdx
uint32_t num_entry_points; ///< NumEntryPoints
uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[]
diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index 5654f22878..dd884ad449 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -3008,7 +3008,6 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
const H266RefPicLists *ref_pic_lists;
int err, i;
uint8_t nal_unit_type, qp_bd_offset;
- uint16_t curr_subpic_idx;
uint16_t num_slices_in_subpic;
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);
for (i = 0; i <= sps->sps_num_subpics_minus1; i++) {
if (pps->sub_pic_id_val[i] == current->sh_subpic_id) {
- curr_subpic_idx = i;
+ current->curr_subpic_idx = i;
break;
}
}
@@ -3055,10 +3054,10 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
return AVERROR_INVALIDDATA;
}
} 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) ||
(!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) {
int width_in_tiles;
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];
}
width_in_tiles =