[FFmpeg-cvslog] avcodec/cbs_h266: H266RawSliceHeader, expose curr_subpic_idx
Nuo Mi
git at videolan.org
Sat Nov 11 16:53:56 EET 2023
ffmpeg | branch: master | Nuo Mi <nuomi2021 at gmail.com> | Tue Sep 5 21:01:22 2023 +0800| [09f783692e218b446cf5778ce9271360458ebadc] | committer: James Almer
avcodec/cbs_h266: H266RawSliceHeader, expose curr_subpic_idx
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=09f783692e218b446cf5778ce9271360458ebadc
---
libavcodec/cbs_h266.h | 1 +
libavcodec/cbs_h266_syntax_template.c | 9 ++++-----
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 =
More information about the ffmpeg-cvslog
mailing list