diff mbox series

[FFmpeg-devel,v4,3/8] lavc/cbs_h266: Add SliceTopLeftTileIdx to H266RawPPS

Message ID 20241028085525.600988-3-fei.w.wang@intel.com
State New
Headers show
Series [FFmpeg-devel,v4,1/8] lavc/vaapi_dec: Create VA parameters dynamically | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Wang, Fei W Oct. 28, 2024, 8:55 a.m. UTC
From: Fei Wang <fei.w.wang@intel.com>

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
---
 libavcodec/cbs_h266.h                 | 1 +
 libavcodec/cbs_h266_syntax_template.c | 4 ++++
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/cbs_h266.h b/libavcodec/cbs_h266.h
index d24a8e9313..7f0e537b31 100644
--- a/libavcodec/cbs_h266.h
+++ b/libavcodec/cbs_h266.h
@@ -593,6 +593,7 @@  typedef struct H266RawPPS {
     uint16_t sub_pic_id_val[VVC_MAX_SLICES];                ///< SubpicIdVal
     uint16_t col_width_val[VVC_MAX_TILE_COLUMNS];           ///< ColWidthVal
     uint16_t row_height_val[VVC_MAX_TILE_ROWS];             ///< RowHeightVal
+    uint16_t slice_top_left_tile_idx[VVC_MAX_SLICES];
 } H266RawPPS;
 
 typedef struct H266RawAPS {
diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index b4165b43b3..a826cf8bc9 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -1976,6 +1976,7 @@  static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
             else
                 infer(pps_tile_idx_delta_present_flag, 0);
             for (i = 0; i < current->pps_num_slices_in_pic_minus1; i++) {
+                current->slice_top_left_tile_idx[i] = tile_idx;
                 tile_x = tile_idx % current->num_tile_columns;
                 tile_y = tile_idx / current->num_tile_columns;
                 if (tile_x != current->num_tile_columns - 1) {
@@ -2058,6 +2059,8 @@  static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
                         }
                         num_slices_in_tile = j;
                     }
+                    for (int k = 0; k < num_slices_in_tile; k++)
+                        current->slice_top_left_tile_idx[i + k] = tile_idx;
                     i += num_slices_in_tile - 1;
                 } else {
                     uint16_t height = 0;
@@ -2101,6 +2104,7 @@  static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
             if (i == current->pps_num_slices_in_pic_minus1) {
                 uint16_t height = 0;
 
+                current->slice_top_left_tile_idx[i] = tile_idx;
                 tile_x = tile_idx % current->num_tile_columns;
                 tile_y = tile_idx / current->num_tile_columns;
                 if (tile_y >= current->num_tile_rows)