summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2020-03-05 17:40:43 +0800
committerHe Junyan <junyan.he@hotmail.com>2020-06-05 19:28:01 +0800
commitdbed28d41904a364930268f76bb2cf64d9b58e7b (patch)
treeec6cf878c4d054e7acf9dbf429bcb5f3d36cdc82
parent71db3572845a968151b55b79baaa7370b572b621 (diff)
libs: encoder: h265: Add tile info to bitstream.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/294>
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_h265.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c
index 37143ea1..16fb90d7 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c
@@ -771,6 +771,25 @@ bs_write_pps (GstBitWriter * bs,
/* entropy_coding_sync_enabled_flag */
WRITE_UINT32 (bs, pic_param->pic_fields.bits.entropy_coding_sync_enabled_flag,
1);
+
+ /* tiles info */
+ if (pic_param->pic_fields.bits.tiles_enabled_flag) {
+ WRITE_UE (bs, pic_param->num_tile_columns_minus1);
+ WRITE_UE (bs, pic_param->num_tile_rows_minus1);
+ /* uniform_spacing_flag is 1 now */
+ WRITE_UINT32 (bs, 1, 1);
+ /* if (!uniform_spacing_flag) {
+ for (i = 0; i < num_tile_columns_minus1; i++)
+ column_width_minus1[i]
+ ue (v)
+ for (i = 0; i < num_tile_rows_minus1; i++)
+ row_height_minus1[i]
+ ue (v)
+ } */
+ WRITE_UINT32 (bs,
+ pic_param->pic_fields.bits.loop_filter_across_tiles_enabled_flag, 1);
+ }
+
/* pps_loop_filter_across_slices_enabled_flag */
WRITE_UINT32 (bs,
pic_param->pic_fields.bits.pps_loop_filter_across_slices_enabled_flag, 1);
@@ -970,7 +989,12 @@ bs_write_slice (GstBitWriter * bs,
WRITE_UINT32 (bs,
slice_param->slice_fields.bits.
slice_loop_filter_across_slices_enabled_flag, 1);
+ }
+ if (pic_param->pic_fields.bits.tiles_enabled_flag
+ || pic_param->pic_fields.bits.entropy_coding_sync_enabled_flag) {
+ /* output a num_entry_point_offsets, which should be 0 here */
+ WRITE_UE (bs, 0);
}
/* byte_alignment() */