From dbd9a2082b6aa55c279081fd50b6db50ece9b5f5 Mon Sep 17 00:00:00 2001 From: "Liu, Chunjuan" Date: Mon, 4 Sep 2023 09:57:33 +0800 Subject: [PATCH] Add VVC decode LibVA interface. Signed-off-by: Liu, Chunjuan --- va/Makefile.am | 1 + va/meson.build | 1 + va/va.h | 76 ++++- va/va_dec_vvc.h | 688 ++++++++++++++++++++++++++++++++++++++ va/va_str.c | 7 + va/va_trace.c | 852 +++++++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 1622 insertions(+), 3 deletions(-) create mode 100644 va/va_dec_vvc.h diff --git a/va/Makefile.am b/va/Makefile.am index 8d16d422c..37a8423e9 100644 --- a/va/Makefile.am +++ b/va/Makefile.am @@ -48,6 +48,7 @@ libva_source_h = \ va_dec_jpeg.h \ va_dec_vp8.h \ va_dec_vp9.h \ + va_dec_vvc.h \ va_drmcommon.h \ va_egl.h \ va_enc_hevc.h \ diff --git a/va/meson.build b/va/meson.build index cca645f03..6005cf8d2 100644 --- a/va/meson.build +++ b/va/meson.build @@ -27,6 +27,7 @@ libva_headers = [ 'va_dec_vp8.h', 'va_dec_vp9.h', 'va_dec_av1.h', + 'va_dec_vvc.h', 'va_drmcommon.h', 'va_egl.h', 'va_enc_hevc.h', diff --git a/va/va.h b/va/va.h index d349704e8..1d99fa6ff 100644 --- a/va/va.h +++ b/va/va.h @@ -120,12 +120,13 @@ extern "C" { * - \ref api_enc_vp8 * - \ref api_enc_vp9 * - \ref api_enc_av1 - * - Decoder (HEVC, JPEG, VP8, VP9, AV1) + * - Decoder (HEVC, JPEG, VP8, VP9, AV1, VVC) * - \ref api_dec_hevc * - \ref api_dec_jpeg * - \ref api_dec_vp8 * - \ref api_dec_vp9 * - \ref api_dec_av1 + * - \ref api_dec_vvc * - \ref api_vpp * - \ref api_prot * - FEI (H264, HEVC) @@ -538,7 +539,9 @@ typedef enum { VAProfileHEVCSccMain444_10 = 34, /** \brief Profile ID used for protected video playback. */ VAProfileProtected = 35, - VAProfileH264High10 = 36 + VAProfileH264High10 = 36, + VAProfileVVCMain10 = 37, + VAProfileVVCMultilayerMain10 = 38 } VAProfile; /** @@ -2149,6 +2152,37 @@ typedef enum { */ VAEncDeltaQpPerBlockBufferType = 61, + /** + * \brief VVC ALF data buffer + * + * Refer to \c VAAlfDataVVC + */ + VAAlfBufferType = 62, + /** + * \brief VVC LMCS data buffer + * + * Refer to \c VALmcsDataVVC + */ + VALmcsBufferType = 63, + /** + * \brief VVC SubPic data buffer + * + * Refer to \c VASubPicVVC + */ + VASubPicBufferType = 64, + /** + * \brief VVC Tile Dimension data buffer + * + * Data buffer of tile widths and heights, with each element formatted as uint16_t + */ + VATileBufferType = 65, + /** + * \brief VVC Slice Structure data buffer + * + * Refer to \c VASliceStructVVC + */ + VASliceStructBufferType = 66, + VABufferTypeMax } VABufferType; @@ -5283,6 +5317,43 @@ typedef struct _VAPictureHEVC { */ #define VA_PICTURE_HEVC_RPS_LT_CURR 0x00000040 +/**************************** + * VVC data structures + ****************************/ +/** + * \brief Description of picture properties of those in DPB surfaces. + * + * Only progressive scan is supported, each surface contains one whole + * frame picture. + */ + +typedef struct _VAPictureVVC { + /** \brief reconstructed picture buffer surface index + * invalid when taking value VA_INVALID_SURFACE. + */ + VASurfaceID picture_id; + + /** \brief picture order count. */ + int32_t pic_order_cnt; + + /* described below */ + uint32_t flags; + + /** \brief Reserved bytes for future use, must be zero */ + uint32_t va_reserved[VA_PADDING_LOW]; +} VAPictureVVC; + +/* flags in VAPictureVVC could be OR of the following */ +#define VA_PICTURE_VVC_INVALID 0x00000001 +/** \brief Long term reference picture */ +#define VA_PICTURE_VVC_LONG_TERM_REFERENCE 0x00000002 +/** \brief Unavailable reference picture + * This flag indicates the situation that the process of + * "generating unavailable reference pictures" (spec section 8.3.4) + * is required. + */ +#define VA_PICTURE_VVC_UNAVAILABLE_REFERENCE 0x00000004 + typedef enum { VACopyObjectSurface = 0, VACopyObjectBuffer = 1, @@ -5328,6 +5399,7 @@ VAStatus vaCopy(VADisplay dpy, VACopyObject * dst, VACopyObject * src, VACopyOpt #include #include #include +#include #include #include #include diff --git a/va/va_dec_vvc.h b/va/va_dec_vvc.h new file mode 100644 index 000000000..bbd403994 --- /dev/null +++ b/va/va_dec_vvc.h @@ -0,0 +1,688 @@ +/* + * Copyright (c) 2024 Intel Corporation. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file va_dec_vvc.h + * \brief The VVC decoding API + * + * This file contains the \ref api_dec_vvc "VVC decoding API". + */ + +#ifndef VA_DEC_VVC_H +#define VA_DEC_VVC_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup api_dec_vvc VVC decoding API + * + * This VVC decoding API supports Main 10 profile and Multilayer Main 10 profile. + * And it supports only long slice format. + * + * @{ + */ + +/** + * \brief Weighted Prediction Parameters. + */ +typedef struct _VAWeightedPredInfo { + /** \brief Weighted Prediction parameters. + * All the parameters except reserved bytes are VVC syntax. + */ + uint8_t luma_log2_weight_denom; + int8_t delta_chroma_log2_weight_denom; + uint8_t num_l0_weights; + uint8_t luma_weight_l0_flag[15]; + uint8_t chroma_weight_l0_flag[15]; + int8_t delta_luma_weight_l0[15]; + int8_t luma_offset_l0[15]; + int8_t delta_chroma_weight_l0[15][2]; + int16_t delta_chroma_offset_l0[15][2]; + uint8_t num_l1_weights; + uint8_t luma_weight_l1_flag[15]; + uint8_t chroma_weight_l1_flag[15]; + int8_t delta_luma_weight_l1[15]; + int8_t luma_offset_l1[15]; + int8_t delta_chroma_weight_l1[15][2]; + int16_t delta_chroma_offset_l1[15][2]; + /** \brief Reserved for future use, must be zero */ + uint16_t reserved16b; + uint32_t reserved32b; +} VAWeightedPredInfo; + +/** + * \brief VVC Decoding Picture Parameter Buffer Structure + * + * This structure conveys picture level parameters and should be sent once + * per frame. + * + * Host decoder is required to send in a buffer of VAPictureParameterBufferVVC + * as the first va buffer for each frame. + * + */ +typedef struct _VAPictureParameterBufferVVC { + /** \brief buffer description of decoded current picture + */ + VAPictureVVC CurrPic; + /** \brief buffer description of reference frames in DPB */ + VAPictureVVC ReferenceFrames[15]; + /** \brief picture width, shall be integer multiple of Max(8, MinCbSizeY). */ + uint16_t pps_pic_width_in_luma_samples; + /** \brief picture height, shall be integer multiple of Max(8, MinCbSizeY). */ + uint16_t pps_pic_height_in_luma_samples; + + /** \brief sequence level parameters. + * All the parameters except reserved bytes are VVC syntax or spec variables. + */ + uint16_t sps_num_subpics_minus1; + uint8_t sps_chroma_format_idc; + uint8_t sps_bitdepth_minus8; + uint8_t sps_log2_ctu_size_minus5; + uint8_t sps_log2_min_luma_coding_block_size_minus2; + uint8_t sps_log2_transform_skip_max_size_minus2; + /** \brief chroma QP mapping table. + * ChromaQpTable[][] corresponds to VVC spec variable with the same name. + * It is derived according to formula (57) in VVC spec section 7.4.3.4. + */ + int8_t ChromaQpTable[3][111]; + uint8_t sps_six_minus_max_num_merge_cand; + uint8_t sps_five_minus_max_num_subblock_merge_cand; + uint8_t sps_max_num_merge_cand_minus_max_num_gpm_cand; + uint8_t sps_log2_parallel_merge_level_minus2; + uint8_t sps_min_qp_prime_ts; + uint8_t sps_six_minus_max_num_ibc_merge_cand; + uint8_t sps_num_ladf_intervals_minus2; + int8_t sps_ladf_lowest_interval_qp_offset; + int8_t sps_ladf_qp_offset[4]; + uint16_t sps_ladf_delta_threshold_minus1[4]; + /** \brief Reserved for future use, must be zero */ + uint32_t reserved32b01[VA_PADDING_LOW - 2]; + + union { + struct { + uint64_t sps_subpic_info_present_flag : 1; + uint64_t sps_independent_subpics_flag : 1; + uint64_t sps_subpic_same_size_flag : 1; + uint64_t sps_entropy_coding_sync_enabled_flag : 1; + uint64_t sps_qtbtt_dual_tree_intra_flag : 1; + uint64_t sps_max_luma_transform_size_64_flag : 1; + uint64_t sps_transform_skip_enabled_flag : 1; + uint64_t sps_bdpcm_enabled_flag : 1; + uint64_t sps_mts_enabled_flag : 1; + uint64_t sps_explicit_mts_intra_enabled_flag : 1; + uint64_t sps_explicit_mts_inter_enabled_flag : 1; + uint64_t sps_lfnst_enabled_flag : 1; + uint64_t sps_joint_cbcr_enabled_flag : 1; + uint64_t sps_same_qp_table_for_chroma_flag : 1; + uint64_t sps_sao_enabled_flag : 1; + uint64_t sps_alf_enabled_flag : 1; + uint64_t sps_ccalf_enabled_flag : 1; + uint64_t sps_lmcs_enabled_flag : 1; + uint64_t sps_sbtmvp_enabled_flag : 1; + uint64_t sps_amvr_enabled_flag : 1; + uint64_t sps_smvd_enabled_flag : 1; + uint64_t sps_mmvd_enabled_flag : 1; + uint64_t sps_sbt_enabled_flag : 1; + uint64_t sps_affine_enabled_flag : 1; + uint64_t sps_6param_affine_enabled_flag : 1; + uint64_t sps_affine_amvr_enabled_flag : 1; + uint64_t sps_affine_prof_enabled_flag : 1; + uint64_t sps_bcw_enabled_flag : 1; + uint64_t sps_ciip_enabled_flag : 1; + uint64_t sps_gpm_enabled_flag : 1; + uint64_t sps_isp_enabled_flag : 1; + uint64_t sps_mrl_enabled_flag : 1; + uint64_t sps_mip_enabled_flag : 1; + uint64_t sps_cclm_enabled_flag : 1; + uint64_t sps_chroma_horizontal_collocated_flag : 1; + uint64_t sps_chroma_vertical_collocated_flag : 1; + uint64_t sps_palette_enabled_flag : 1; + uint64_t sps_act_enabled_flag : 1; + uint64_t sps_ibc_enabled_flag : 1; + uint64_t sps_ladf_enabled_flag : 1; + uint64_t sps_explicit_scaling_list_enabled_flag : 1; + uint64_t sps_scaling_matrix_for_lfnst_disabled_flag : 1; + uint64_t sps_scaling_matrix_for_alternative_colour_space_disabled_flag : 1; + uint64_t sps_scaling_matrix_designated_colour_space_flag : 1; + uint64_t sps_virtual_boundaries_enabled_flag : 1; + uint64_t sps_virtual_boundaries_present_flag : 1; + /** \brief Reserved for future use, must be zero */ + uint64_t reserved : 18; + } bits; + uint64_t value; + } sps_flags; + + /** \brief picture level parameters. + * All the parameters except reserved bytes are VVC syntax or spec variables. + */ + /** \brief number of vertical virtual boundaries on the picture. + * NumVerVirtualBoundaries corresponds to VVC spec variable with the same name. + * It is derived according to formula (78) in VVC spec section 7.4.3.8. + */ + uint8_t NumVerVirtualBoundaries; + /** \brief number of horizontal virtual boundaries on the picture. + * NumHorVirtualBoundaries corresponds to VVC spec variable with the same name. + * It is derived according to formula (80) in VVC spec section 7.4.3.8. + */ + uint8_t NumHorVirtualBoundaries; + /** \brief location of the vertical virtual boundary in units of luma samples. + * VirtualBoundaryPosX[] corresponds to VVC spec variable with the same name. + * It is derived according to formula (79) in VVC spec section 7.4.3.8. + */ + uint16_t VirtualBoundaryPosX[3]; + /** \brief location of the horizontal virtual boundary in units of luma samples. + * VirtualBoundaryPosY[] corresponds to VVC spec variable with the same name. + * It is derived according to formula (81) in VVC spec section 7.4.3.8. + */ + uint16_t VirtualBoundaryPosY[3]; + + int32_t pps_scaling_win_left_offset; + int32_t pps_scaling_win_right_offset; + int32_t pps_scaling_win_top_offset; + int32_t pps_scaling_win_bottom_offset; + + int8_t pps_num_exp_tile_columns_minus1; + uint16_t pps_num_exp_tile_rows_minus1; + uint16_t pps_num_slices_in_pic_minus1; + uint16_t pps_pic_width_minus_wraparound_offset; + int8_t pps_cb_qp_offset; + int8_t pps_cr_qp_offset; + int8_t pps_joint_cbcr_qp_offset_value; + uint8_t pps_chroma_qp_offset_list_len_minus1; + int8_t pps_cb_qp_offset_list[6]; + int8_t pps_cr_qp_offset_list[6]; + int8_t pps_joint_cbcr_qp_offset_list[6]; + /** \brief Reserved for future use, must be zero */ + uint16_t reserved16b01; + uint32_t reserved32b02[VA_PADDING_LOW - 2]; + + union { + struct { + uint32_t pps_loop_filter_across_tiles_enabled_flag : 1; + uint32_t pps_rect_slice_flag : 1; + uint32_t pps_single_slice_per_subpic_flag : 1; + uint32_t pps_loop_filter_across_slices_enabled_flag : 1; + uint32_t pps_weighted_pred_flag : 1; + uint32_t pps_weighted_bipred_flag : 1; + uint32_t pps_ref_wraparound_enabled_flag : 1; + uint32_t pps_cu_qp_delta_enabled_flag : 1; + uint32_t pps_cu_chroma_qp_offset_list_enabled_flag : 1; + uint32_t pps_deblocking_filter_override_enabled_flag : 1; + uint32_t pps_deblocking_filter_disabled_flag : 1; + uint32_t pps_dbf_info_in_ph_flag : 1; + uint32_t pps_sao_info_in_ph_flag : 1; + uint32_t pps_alf_info_in_ph_flag : 1; + /** \brief Reserved for future use, must be zero */ + uint32_t reserved : 18; + } bits; + uint32_t value; + } pps_flags; + + /** \brief picture header parameters. + * All the parameters except reserved bytes are VVC syntax or spec variables. + */ + uint8_t ph_lmcs_aps_id; + uint8_t ph_scaling_list_aps_id; + uint8_t ph_log2_diff_min_qt_min_cb_intra_slice_luma; + uint8_t ph_max_mtt_hierarchy_depth_intra_slice_luma; + uint8_t ph_log2_diff_max_bt_min_qt_intra_slice_luma; + uint8_t ph_log2_diff_max_tt_min_qt_intra_slice_luma; + uint8_t ph_log2_diff_min_qt_min_cb_intra_slice_chroma; + uint8_t ph_max_mtt_hierarchy_depth_intra_slice_chroma; + uint8_t ph_log2_diff_max_bt_min_qt_intra_slice_chroma; + uint8_t ph_log2_diff_max_tt_min_qt_intra_slice_chroma; + uint8_t ph_cu_qp_delta_subdiv_intra_slice; + uint8_t ph_cu_chroma_qp_offset_subdiv_intra_slice; + uint8_t ph_log2_diff_min_qt_min_cb_inter_slice; + uint8_t ph_max_mtt_hierarchy_depth_inter_slice; + uint8_t ph_log2_diff_max_bt_min_qt_inter_slice; + uint8_t ph_log2_diff_max_tt_min_qt_inter_slice; + uint8_t ph_cu_qp_delta_subdiv_inter_slice; + uint8_t ph_cu_chroma_qp_offset_subdiv_inter_slice; + /** \brief Reserved for future use, must be zero */ + uint16_t reserved16b02; + uint32_t reserved32b03[VA_PADDING_LOW - 2]; + + union { + struct { + uint32_t ph_non_ref_pic_flag : 1; + uint32_t ph_alf_enabled_flag : 1; + uint32_t ph_alf_cb_enabled_flag : 1; + uint32_t ph_alf_cr_enabled_flag : 1; + uint32_t ph_alf_cc_cb_enabled_flag : 1; + uint32_t ph_alf_cc_cr_enabled_flag : 1; + uint32_t ph_lmcs_enabled_flag : 1; + uint32_t ph_chroma_residual_scale_flag : 1; + uint32_t ph_explicit_scaling_list_enabled_flag : 1; + uint32_t ph_virtual_boundaries_present_flag : 1; + uint32_t ph_temporal_mvp_enabled_flag : 1; + uint32_t ph_mmvd_fullpel_only_flag : 1; + uint32_t ph_mvd_l1_zero_flag : 1; + uint32_t ph_bdof_disabled_flag : 1; + uint32_t ph_dmvr_disabled_flag : 1; + uint32_t ph_prof_disabled_flag : 1; + uint32_t ph_joint_cbcr_sign_flag : 1; + uint32_t ph_sao_luma_enabled_flag : 1; + uint32_t ph_sao_chroma_enabled_flag : 1; + uint32_t ph_deblocking_filter_disabled_flag : 1; + /** \brief Reserved for future use, must be zero */ + uint32_t reserved : 12; + } bits; + uint32_t value; + } ph_flags; + + /** \brief Reserved for future use, must be zero */ + uint32_t reserved32b04; + + union { + struct { + /** \brief Flag to indicate if current picture is an intra picture. + * Takes value 1 when all slices of current picture are intra slices. + * Takes value 0 when some slices of current picture may not be + * intra slices. + */ + uint32_t IntraPicFlag : 1; // [0..1] + /** \brief Reserved for future use, must be zero */ + uint32_t reserved : 31; + } fields; + uint32_t value; + } PicMiscFlags; + + /** \brief Reserved bytes for future use, must be zero */ + uint32_t reserved32b[VA_PADDING_HIGH + 1]; + +} VAPictureParameterBufferVVC; + +/** + * \brief VVC Slice Parameter Buffer Structure + * + * VASliceParameterBufferVVC structure should be accompanied by a + * slice data buffer, which holds the whole packed slice NAL unit bit stream + * with emulation prevention bytes not removed. + * + * This structure conveys parameters related to slice header and should + * be sent once per slice. + */ +typedef struct _VASliceParameterBufferVVC { + /** @name Codec-independent Slice Parameter Buffer base. */ + + /**@{*/ + + /** \brief Number of bytes in the slice data buffer for this slice + * counting from and including NAL unit header. + */ + uint32_t slice_data_size; + /** \brief The offset to the NAL unit header for this slice */ + uint32_t slice_data_offset; + /** \brief Slice data buffer flags. See \c VA_SLICE_DATA_FLAG_XXX. */ + uint32_t slice_data_flag; + /** + * \brief Byte offset from NAL unit header to the beginning of slice_data(). + * + * This byte offset is relative to and includes the NAL unit header + * and represents the number of bytes parsed in the slice_header() + * after the removal of any emulation prevention bytes in + * there. However, the slice data buffer passed to the hardware is + * the original bitstream, thus including any emulation prevention + * bytes. + */ + uint32_t slice_data_byte_offset; + /** \brief index into ReferenceFrames[] + * RefPicList[][] corresponds to VVC spec variable with the same name. + * Value range [0..14, 0xFF], where 0xFF indicates invalid entry. + */ + uint8_t RefPicList[2][15]; + + /** + * \brief the subpicture ID of the subpicture that contains the slice. + * The value of the variable CurrSubpicIdx + * is derived to be such that SubpicIdVal[CurrSubpicIdx] is equal + * to sh_subpic_id. CurrSubpicIdx is the index of array VASubPicArrayBufferVVC.SubPicSet[]. + * And it is the spec variable with the same name. + */ + uint16_t sh_subpic_id; + /* parameters below are VVC syntax or spec variables. */ + uint16_t sh_slice_address; + uint16_t sh_num_tiles_in_slice_minus1; + uint8_t sh_slice_type; + uint8_t sh_num_alf_aps_ids_luma; + uint8_t sh_alf_aps_id_luma[7]; + uint8_t sh_alf_aps_id_chroma; + uint8_t sh_alf_cc_cb_aps_id; + uint8_t sh_alf_cc_cr_aps_id; + /** + * \brief NumRefIdxActive[i] - 1 specifies the maximum reference index + * for RPL i that may be used to decode the slice. When NumRefIdxActive[i] + * is equal to 0, no reference index for RPL i is used to decode the slice. + * NumRefIdxActive[] corresponds to VVC spec variable with the same name. + * It is derived according to formula (138) in VVC spec section 7.4.8. + */ + uint8_t NumRefIdxActive[2]; + uint8_t sh_collocated_ref_idx; + /** + * \brief initial value of the QpY quantization parameter for the slice. + * SliceQpY corresponds to VVC spec variable with the same name. + * It is derived according to formula (86) in VVC spec section 7.4.3.8 + * and formula (139) in VVC Spec section 7.4.8. + */ + int8_t SliceQpY; + /* parameters below are VVC syntax. */ + int8_t sh_cb_qp_offset; + int8_t sh_cr_qp_offset; + int8_t sh_joint_cbcr_qp_offset; + int8_t sh_luma_beta_offset_div2; + int8_t sh_luma_tc_offset_div2; + int8_t sh_cb_beta_offset_div2; + int8_t sh_cb_tc_offset_div2; + int8_t sh_cr_beta_offset_div2; + int8_t sh_cr_tc_offset_div2; + /** \brief Reserved bytes for future use, must be zero */ + uint8_t reserved8b[VA_PADDING_LOW - 1]; + uint32_t reserved32b; + + // weighted prediction info + VAWeightedPredInfo WPInfo; + + union { + struct { + /* flags below are VVC syntax. */ + uint32_t sh_alf_enabled_flag : 1; + uint32_t sh_alf_cb_enabled_flag : 1; + uint32_t sh_alf_cr_enabled_flag : 1; + uint32_t sh_alf_cc_cb_enabled_flag : 1; + uint32_t sh_alf_cc_cr_enabled_flag : 1; + uint32_t sh_lmcs_used_flag : 1; + uint32_t sh_explicit_scaling_list_used_flag : 1; + uint32_t sh_cabac_init_flag : 1; + uint32_t sh_collocated_from_l0_flag : 1; + uint32_t sh_cu_chroma_qp_offset_enabled_flag : 1; + uint32_t sh_sao_luma_used_flag : 1; + uint32_t sh_sao_chroma_used_flag : 1; + uint32_t sh_deblocking_filter_disabled_flag : 1; + uint32_t sh_dep_quant_used_flag : 1; + uint32_t sh_sign_data_hiding_used_flag : 1; + uint32_t sh_ts_residual_coding_disabled_flag : 1; + /** \brief Reserved for future use, must be zero */ + uint32_t reserved : 16; + } bits; + uint32_t value; + } sh_flags; + + /** \brief Reserved bytes for future use, must be zero */ + uint32_t va_reserved[VA_PADDING_MEDIUM]; +} VASliceParameterBufferVVC; + +/** + * \brief VVC Scaling List Data Structure + * + * Host decoder sends in an array of VVC Scaling Lists through one or multiple + * buffers which may contain 1 to 8 VAScalingListVVC data structures in total. + * Each buffer contains an integer number of VAScalingListVVC data structures + * with no gap in between. + * Driver may store the data internally. Host decoder may choose not to + * send the same scaling list data for each frame. When a VAScalingListVVC + * structure carries a same value of aps_adaptation_parameter_set_id + * as a previously stored structure, driver should override the old structure + * with values in the new structure. + * VAIQMatrixBufferType is used to send this buffer. + */ +typedef struct _VAScalingListVVC { + /** \brief VVC syntax to specify the identifier for the APS.*/ + uint8_t aps_adaptation_parameter_set_id; + /** \brief Reserved for future use, must be zero */ + uint8_t reserved8b; + /** + * \brief Specifies the spec variable ScalingMatrixDCRec[id−14], + * where id = [14..27]. + */ + uint8_t ScalingMatrixDCRec[14]; + /** + * \brief Specifies the spec variable ScalingMatrixRec[id][x][y], + * where id = [0..1]. Check section 7.4.3.20 for derivation process. + */ + uint8_t ScalingMatrixRec2x2[2][2][2]; + /** + * \brief Specifies the spec variable ScalingMatrixRec[id][x][y], + * where id = [2..7]. Check section 7.4.3.20 for derivation process. + */ + uint8_t ScalingMatrixRec4x4[6][4][4]; + /** + * \brief Specifies the spec variable ScalingMatrixRec[id][x][y], + * where id = [8..27]. Check section 7.4.3.20 for derivation process. + */ + uint8_t ScalingMatrixRec8x8[20][8][8]; + + /** \brief Reserved bytes for future use, must be zero */ + uint32_t va_reserved[VA_PADDING_MEDIUM]; +} VAScalingListVVC; + +/** + * \brief VVC Adaptive Loop Filter Data Structure + * + * Host decoder sends in an array of VVC ALF sets through one or multiple + * buffers which may contain 1 to 8 VAAlfDataVVC data structures in total. + * Each buffer contains an integer number of VAAlfDataVVC data structures + * with no gap in between. + * Driver may store the data internally. Host decoder may choose not to + * send the same ALF data for each frame. When a VAAlfDataVVC structure + * carries a same value of aps_adaptation_parameter_set_id as a previously + * stored structure, driver should override the old structure + * with values in the new structure. + * VAAlfBufferType is used to send this buffer. + */ +typedef struct _VAAlfDataVVC { + /** + * \brief VVC Adaptive Loop Filter parameters. + * All the parameters except reserved bytes are VVC syntax or spec variables. + */ + uint8_t aps_adaptation_parameter_set_id; + uint8_t alf_luma_num_filters_signalled_minus1; + uint8_t alf_luma_coeff_delta_idx[25]; + int8_t filtCoeff[25][12]; + uint8_t alf_luma_clip_idx[25][12]; + uint8_t alf_chroma_num_alt_filters_minus1; + int8_t AlfCoeffC[8][6]; + uint8_t alf_chroma_clip_idx[8][6]; + uint8_t alf_cc_cb_filters_signalled_minus1; + int8_t CcAlfApsCoeffCb[4][7]; + uint8_t alf_cc_cr_filters_signalled_minus1; + int8_t CcAlfApsCoeffCr[4][7]; + /** \brief Reserved bytes for future use, must be zero */ + uint16_t reserved16b; + uint32_t reserved32b; + + union { + struct { + uint32_t alf_luma_filter_signal_flag : 1; + uint32_t alf_chroma_filter_signal_flag : 1; + uint32_t alf_cc_cb_filter_signal_flag : 1; + uint32_t alf_cc_cr_filter_signal_flag : 1; + uint32_t alf_luma_clip_flag : 1; + uint32_t alf_chroma_clip_flag : 1; + /** \brief Reserved for future use, must be zero */ + uint32_t reserved : 26; + } bits; + uint32_t value; + } alf_flags; + + /** \brief Reserved for future use, must be zero */ + uint32_t va_reserved[VA_PADDING_MEDIUM]; +} VAAlfDataVVC; + +/** + * \brief VVC Luma Mapping with Chroma Scaling Data Structure + * + * Host decoder sends in an array of VVC LMCS sets through one or multiple + * buffers which may contain 1 to 4 VALmcsDataVVC data structures in total. + * Each buffer contains an integer number of VALmcsDataVVC data structures + * with no gap in between. + * Driver may store the data internally. Host decoder may choose not to + * send the same LMCS data for each frame. When a VALmcsDataVVC structure + * carries a same value of aps_adaptation_parameter_set_id as a previously + * stored structure, driver should override the old structure + * with values in the new structure. + * VALmcsBufferType is used to send this buffer. + */ +typedef struct _VALmcsDataVVC { + /** + * \brief VVC Luma Mapping with Chroma Scaling parameters. + * All the parameters except reserved bytes are VVC syntax or spec variables. + */ + uint8_t aps_adaptation_parameter_set_id; + uint8_t lmcs_min_bin_idx; + uint8_t lmcs_delta_max_bin_idx; + int16_t lmcsDeltaCW[16]; + int8_t lmcsDeltaCrs; + /** \brief Reserved for future use, must be zero */ + uint8_t reserved8b[VA_PADDING_LOW - 1]; + uint32_t va_reserved[VA_PADDING_MEDIUM]; +} VALmcsDataVVC; + +/** + * \brief VVC SubPicture Data Structure + * + * Host decoder sends in an array of VVC SubPic sets through one or + * multiple buffers which contain sps_num_subpics_minus1 + 1 + * VASubPicVVC data structures in total. Each buffer contains + * an integer number of VASubPicVVC data structures with no gap in between. + * The Subpic sets are sent sequentially in the order of indices + * from 0 to sps_num_subpics_minus1 according to the bitstream. + * VASubPicBufferType is used to send this buffer. + */ +typedef struct _VASubPicVVC { + /** + * \brief VVC SubPicture layout parameters. + * All the parameters except reserved bytes are VVC syntax or spec variables. + */ + uint16_t sps_subpic_ctu_top_left_x; + uint16_t sps_subpic_ctu_top_left_y; + uint16_t sps_subpic_width_minus1; + uint16_t sps_subpic_height_minus1; + /** \brief the subpicture ID of the i-th subpicture. + * It is same variable as in VVC spec. + */ + uint16_t SubpicIdVal; + + union { + struct { + uint16_t sps_subpic_treated_as_pic_flag : 1; + uint16_t sps_loop_filter_across_subpic_enabled_flag : 1; + /** \brief Reserved for future use, must be zero */ + uint16_t reserved : 14; + } bits; + uint16_t value; + } subpic_flags; + + /** \brief Reserved for future use, must be zero */ + uint32_t va_reserved[VA_PADDING_LOW]; +} VASubPicVVC; + +/** + * \brief data buffer of tile widths and heights. + * VATileBufferType is used to send this buffer. + * + * Host decoder sends in number of pps_num_exp_tile_columns_minus1 + 1 + * tile column widths of pps_tile_column_width_minus1[i], followed by + * number of pps_num_exp_tile_rows_minus1 + 1 of tile row heights of + * pps_tile_row_height_minus1[i], through one or multiple buffers. + * Each tile width or height is formatted as + uint16_t tile_dimension; + * Each buffer contains an integer number of tile_dimension with + * no gap in between. + * The buffers with type VATileBufferType should be submitted for each + * picture. And driver will derive the tile structure from it. + * When pps_num_exp_tile_columns_minus1 + pps_num_exp_tile_rows_minus1 equals 0, + * this buffer is still submitted by app to driver. + */ + + +/** + * \brief VVC SliceStruct Data Structure + * + * Host decoder sends in an array of SliceStruct sets through one or multiple + * buffers. These SliceStruct sets contain only the "explicit" slices parsed + * from PPS header. + * Each SliceStruct set is described by VASliceStructVVC data structure. + * Each buffer contains an integer number of VASliceStructVVC data structures, + * which are laid out sequentially in the order of + * ascending slice indices according to the spec with no gap in between. + * + * When pps_rect_slice_flag equals 0 or there are no explicit slices, + * this buffer is not submitted by app to driver. Otherwise, for each picture, + * this buffer should be submitted. + * + * Note: When pps_slice_width_in_tiles_minus1 + pps_slice_height_in_tiles_minus1 + * equals 0, if the sum of pps_exp_slice_height_in_ctus_minus1 + 1 of all those + * slices with same SliceTopLeftTileIdx value is less than the height of tile + * SliceTopLeftTileIdx in unit of CTUs, driver should derive the rest slices in + * that tile according to equation (21) in spec section 6.5.1. And VASliceStructVVC + * for these (derived) slices are not passed in to LibVA by App. + * + * App should populate the data entries regardless of values of + * pps_single_slice_per_subpic_flag or sps_subpic_info_present_flag. + * + * VASliceStructBufferType is used to send this buffer. + */ +typedef struct _VASliceStructVVC { + /** \brief the tile index of which the starting CTU (top-left) of + * the slice belongs to. The tile index is in raster scan order. + * Same syntax variable as in VVC spec. + */ + uint16_t SliceTopLeftTileIdx; + /* plus 1 specifies the width of the rectangular slice in units + * of tile columns. + */ + uint16_t pps_slice_width_in_tiles_minus1; + /* plus 1 specifies the height of the rectangular slice in units + * of tile rows. If the slice does not cover the whole tile, + * pps_slice_height_in_tiles_minus1 shall be 0. + */ + uint16_t pps_slice_height_in_tiles_minus1; + /* plus 1 specifies the height of the rectangular slice in units + * of CTU rows. + * If pps_slice_width_in_tiles_minus1 + pps_slice_height_in_tiles_minus1 > 0, + * set this value to 0. + * If pps_slice_width_in_tiles_minus1 + pps_slice_height_in_tiles_minus1 == 0, + * and if there is only one slice in tile, set this value to the number of + * CTU rows of the tile minus 1, otherwise, set the value equal to + * corresponding pps_exp_slice_height_in_ctus_minus1 from bitstream. + */ + uint16_t pps_exp_slice_height_in_ctus_minus1; + + /** \brief Reserved for future use, must be zero */ + uint32_t va_reserved[VA_PADDING_LOW]; +} VASliceStructVVC; + + +/**@}*/ + +#ifdef __cplusplus +} +#endif + +#endif /* VA_DEC_VVC_H */ diff --git a/va/va_str.c b/va/va_str.c index 3d96f9b66..9d651d0a0 100644 --- a/va/va_str.c +++ b/va/va_str.c @@ -66,6 +66,8 @@ const char *vaProfileStr(VAProfile profile) TOSTR(VAProfileAV1Profile1); TOSTR(VAProfileHEVCSccMain444_10); TOSTR(VAProfileProtected); + TOSTR(VAProfileVVCMain10); + TOSTR(VAProfileVVCMultilayerMain10); default: break; } @@ -205,6 +207,11 @@ const char *vaBufferTypeStr(VABufferType bufferType) TOSTR(VAProtectedSessionExecuteBufferType); TOSTR(VAEncryptionParameterBufferType); TOSTR(VAEncDeltaQpPerBlockBufferType); + TOSTR(VAAlfBufferType); + TOSTR(VALmcsBufferType); + TOSTR(VASubPicBufferType); + TOSTR(VATileBufferType); + TOSTR(VASliceStructBufferType); case VABufferTypeMax: break; } diff --git a/va/va_trace.c b/va/va_trace.c index 535d2034d..8993d6218 100644 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 2009-2011 Intel Corporation. All Rights Reserved. + * Copyright (c) 2009-2024 Intel Corporation. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -37,6 +37,7 @@ #include "va_dec_vp8.h" #include "va_dec_vp9.h" #include "va_dec_hevc.h" +#include "va_dec_vvc.h" #include "va_str.h" #include "va_vpp.h" #include @@ -2341,6 +2342,804 @@ static inline void va_TraceFlagIfNotZero( } } +static void va_TraceVAPictureParameterBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + int i, j; + VAPictureParameterBufferVVC* p = (VAPictureParameterBufferVVC*)data; + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + va_TraceMsg(trace_ctx, "\t--VAPictureParameterBufferVVC\n"); + + va_TraceMsg(trace_ctx, "\tCurrPic.picture_id = 0x%08x\n", p->CurrPic.picture_id); + va_TraceMsg(trace_ctx, "\tCurrPic.frame_idx = %d\n", p->CurrPic.pic_order_cnt); + va_TraceMsg(trace_ctx, "\tCurrPic.flags = %d\n", p->CurrPic.flags); + + va_TraceMsg(trace_ctx, "\tReferenceFrames (picture_id-pic_order_cnt-flags):\n"); + for (i = 0; i < 15; i++) { + if ((p->ReferenceFrames[i].picture_id != VA_INVALID_SURFACE) && + ((p->ReferenceFrames[i].flags & VA_PICTURE_VVC_INVALID) == 0)) { + va_TraceMsg(trace_ctx, "\t\t0x%08x-%08d-0x%08x\n", + p->ReferenceFrames[i].picture_id, + p->ReferenceFrames[i].pic_order_cnt, + p->ReferenceFrames[i].flags); + } else + va_TraceMsg(trace_ctx, "\t\tinv-inv-inv-inv-inv\n"); + } + va_TraceMsg(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tpps_pic_width_in_luma_samples = %d\n", p->pps_pic_width_in_luma_samples); + va_TraceMsg(trace_ctx, "\tpps_pic_height_in_luma_samples = %d\n", p->pps_pic_height_in_luma_samples); + va_TraceMsg(trace_ctx, "\tsps_num_subpics_minus1 = %d\n", p->sps_num_subpics_minus1); + va_TraceMsg(trace_ctx, "\tsps_chroma_format_idc = %d\n", p->sps_chroma_format_idc); + va_TraceMsg(trace_ctx, "\tsps_bitdepth_minus8 = %d\n", p->sps_bitdepth_minus8); + va_TraceMsg(trace_ctx, "\tsps_log2_ctu_size_minus5 = %d\n", p->sps_log2_ctu_size_minus5); + va_TraceMsg(trace_ctx, "\tsps_log2_min_luma_coding_block_size_minus2 = %d\n", p->sps_log2_min_luma_coding_block_size_minus2); + va_TraceMsg(trace_ctx, "\tsps_log2_transform_skip_max_size_minus2 = %d\n", p->sps_log2_transform_skip_max_size_minus2); + + va_TraceMsg(trace_ctx, "\tChromaQpTable[3][111] =\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 3; i++) { + for (j = 0; j < 111; j++) { + va_TracePrint(trace_ctx, "\t%d", p->ChromaQpTable[i][j]); + if ((j + 1) % 8 == 0) + TRACE_NEWLINE(); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tsps_six_minus_max_num_merge_cand = %d\n", p->sps_six_minus_max_num_merge_cand); + va_TraceMsg(trace_ctx, "\tsps_five_minus_max_num_subblock_merge_cand = %d\n", p->sps_five_minus_max_num_subblock_merge_cand); + va_TraceMsg(trace_ctx, "\tsps_max_num_merge_cand_minus_max_num_gpm_cand = %d\n", p->sps_max_num_merge_cand_minus_max_num_gpm_cand); + va_TraceMsg(trace_ctx, "\tsps_log2_parallel_merge_level_minus2 = %d\n", p->sps_log2_parallel_merge_level_minus2); + va_TraceMsg(trace_ctx, "\tsps_min_qp_prime_ts = %d\n", p->sps_min_qp_prime_ts); + va_TraceMsg(trace_ctx, "\tsps_six_minus_max_num_ibc_merge_cand = %d\n", p->sps_six_minus_max_num_ibc_merge_cand); + va_TraceMsg(trace_ctx, "\tsps_num_ladf_intervals_minus2 = %d\n", p->sps_num_ladf_intervals_minus2); + va_TraceMsg(trace_ctx, "\tsps_ladf_lowest_interval_qp_offset = %d\n", p->sps_ladf_lowest_interval_qp_offset); + + va_TraceMsg(trace_ctx, "\tsps_ladf_qp_offset[4]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 4; i++) { + va_TracePrint(trace_ctx, "\t%d", p->sps_ladf_qp_offset[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tsps_ladf_delta_threshold_minus1[4]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 4; i++) { + va_TracePrint(trace_ctx, "\t%d", p->sps_ladf_delta_threshold_minus1[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\treserved32b01[2]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 2; i++) { + va_TracePrint(trace_ctx, "\t%d", p->reserved32b01[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tsps_flags = %llu\n", p->sps_flags.value); + va_TraceMsg(trace_ctx, "\tsps_subpic_info_present_flag = %llu\n", p->sps_flags.bits.sps_subpic_info_present_flag); + va_TraceMsg(trace_ctx, "\tsps_independent_subpics_flag = %llu\n", p->sps_flags.bits.sps_independent_subpics_flag); + va_TraceMsg(trace_ctx, "\tsps_subpic_same_size_flag = %llu\n", p->sps_flags.bits.sps_subpic_same_size_flag); + va_TraceMsg(trace_ctx, "\tsps_entropy_coding_sync_enabled_flag = %llu\n", p->sps_flags.bits.sps_entropy_coding_sync_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_qtbtt_dual_tree_intra_flag = %llu\n", p->sps_flags.bits.sps_qtbtt_dual_tree_intra_flag); + va_TraceMsg(trace_ctx, "\tsps_max_luma_transform_size_64_flag = %llu\n", p->sps_flags.bits.sps_max_luma_transform_size_64_flag); + va_TraceMsg(trace_ctx, "\tsps_transform_skip_enabled_flag = %llu\n", p->sps_flags.bits.sps_transform_skip_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_bdpcm_enabled_flag = %llu\n", p->sps_flags.bits.sps_bdpcm_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_mts_enabled_flag = %llu\n", p->sps_flags.bits.sps_mts_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_explicit_mts_intra_enabled_flag = %llu\n", p->sps_flags.bits.sps_explicit_mts_intra_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_explicit_mts_inter_enabled_flag = %llu\n", p->sps_flags.bits.sps_explicit_mts_inter_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_lfnst_enabled_flag = %llu\n", p->sps_flags.bits.sps_lfnst_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_joint_cbcr_enabled_flag = %llu\n", p->sps_flags.bits.sps_joint_cbcr_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_same_qp_table_for_chroma_flag = %llu\n", p->sps_flags.bits.sps_same_qp_table_for_chroma_flag); + va_TraceMsg(trace_ctx, "\tsps_sao_enabled_flag = %llu\n", p->sps_flags.bits.sps_sao_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_alf_enabled_flag = %llu\n", p->sps_flags.bits.sps_alf_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_ccalf_enabled_flag = %llu\n", p->sps_flags.bits.sps_ccalf_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_lmcs_enabled_flag = %llu\n", p->sps_flags.bits.sps_lmcs_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_sbtmvp_enabled_flag = %llu\n", p->sps_flags.bits.sps_sbtmvp_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_amvr_enabled_flag = %llu\n", p->sps_flags.bits.sps_amvr_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_smvd_enabled_flag = %llu\n", p->sps_flags.bits.sps_smvd_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_mmvd_enabled_flag = %llu\n", p->sps_flags.bits.sps_mmvd_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_sbt_enabled_flag = %llu\n", p->sps_flags.bits.sps_sbt_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_affine_enabled_flag = %llu\n", p->sps_flags.bits.sps_affine_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_6param_affine_enabled_flag = %llu\n", p->sps_flags.bits.sps_6param_affine_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_affine_amvr_enabled_flag = %llu\n", p->sps_flags.bits.sps_affine_amvr_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_affine_prof_enabled_flag = %llu\n", p->sps_flags.bits.sps_affine_prof_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_bcw_enabled_flag = %llu\n", p->sps_flags.bits.sps_bcw_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_ciip_enabled_flag = %llu\n", p->sps_flags.bits.sps_ciip_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_gpm_enabled_flag = %llu\n", p->sps_flags.bits.sps_gpm_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_isp_enabled_flag = %llu\n", p->sps_flags.bits.sps_isp_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_mrl_enabled_flag = %llu\n", p->sps_flags.bits.sps_mrl_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_mip_enabled_flag = %llu\n", p->sps_flags.bits.sps_mip_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_cclm_enabled_flag = %llu\n", p->sps_flags.bits.sps_cclm_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_chroma_horizontal_collocated_flag = %llu\n", p->sps_flags.bits.sps_chroma_horizontal_collocated_flag); + va_TraceMsg(trace_ctx, "\tsps_chroma_vertical_collocated_flag = %llu\n", p->sps_flags.bits.sps_chroma_vertical_collocated_flag); + va_TraceMsg(trace_ctx, "\tsps_palette_enabled_flag = %llu\n", p->sps_flags.bits.sps_palette_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_act_enabled_flag = %llu\n", p->sps_flags.bits.sps_act_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_ibc_enabled_flag = %llu\n", p->sps_flags.bits.sps_ibc_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_ladf_enabled_flag = %llu\n", p->sps_flags.bits.sps_ladf_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_explicit_scaling_list_enabled_flag = %llu\n", p->sps_flags.bits.sps_explicit_scaling_list_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_scaling_matrix_for_lfnst_disabled_flag = %llu\n", p->sps_flags.bits.sps_scaling_matrix_for_lfnst_disabled_flag); + va_TraceMsg(trace_ctx, "\tsps_scaling_matrix_for_alternative_colour_space_disabled_flag = %llu\n", p->sps_flags.bits.sps_scaling_matrix_for_alternative_colour_space_disabled_flag); + va_TraceMsg(trace_ctx, "\tsps_scaling_matrix_designated_colour_space_flag = %llu\n", p->sps_flags.bits.sps_scaling_matrix_designated_colour_space_flag); + va_TraceMsg(trace_ctx, "\tsps_virtual_boundaries_enabled_flag = %llu\n", p->sps_flags.bits.sps_virtual_boundaries_enabled_flag); + va_TraceMsg(trace_ctx, "\tsps_virtual_boundaries_present_flag = %llu\n", p->sps_flags.bits.sps_virtual_boundaries_present_flag); + va_TraceMsg(trace_ctx, "\treserved = %llu\n", p->sps_flags.bits.reserved); + + va_TraceMsg(trace_ctx, "\tNumVerVirtualBoundaries = %d\n", p->NumVerVirtualBoundaries); + va_TraceMsg(trace_ctx, "\tNumHorVirtualBoundaries = %d\n", p->NumHorVirtualBoundaries); + va_TraceMsg(trace_ctx, "\tVirtualBoundaryPosX[3]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 3; i++) { + va_TracePrint(trace_ctx, "\t%d", p->VirtualBoundaryPosX[i]); + } + va_TracePrint(trace_ctx, "\n"); + va_TraceMsg(trace_ctx, "\tVirtualBoundaryPosY[3]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 3; i++) { + va_TracePrint(trace_ctx, "\t%d", p->VirtualBoundaryPosY[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tpps_scaling_win_left_offset = %d\n", p->pps_scaling_win_left_offset); + va_TraceMsg(trace_ctx, "\tpps_scaling_win_right_offset = %d\n", p->pps_scaling_win_right_offset); + va_TraceMsg(trace_ctx, "\tpps_scaling_win_top_offset = %d\n", p->pps_scaling_win_top_offset); + va_TraceMsg(trace_ctx, "\tpps_scaling_win_bottom_offset = %d\n", p->pps_scaling_win_bottom_offset); + + va_TraceMsg(trace_ctx, "\tpps_num_exp_tile_columns_minus1 = %d\n", p->pps_num_exp_tile_columns_minus1); + va_TraceMsg(trace_ctx, "\tpps_num_exp_tile_rows_minus1 = %d\n", p->pps_num_exp_tile_rows_minus1); + va_TraceMsg(trace_ctx, "\tpps_num_slices_in_pic_minus1 = %d\n", p->pps_num_slices_in_pic_minus1); + va_TraceMsg(trace_ctx, "\tpps_pic_width_minus_wraparound_offset = %d\n", p->pps_pic_width_minus_wraparound_offset); + va_TraceMsg(trace_ctx, "\tpps_cb_qp_offset = %d\n", p->pps_cb_qp_offset); + va_TraceMsg(trace_ctx, "\tpps_cr_qp_offset = %d\n", p->pps_cr_qp_offset); + va_TraceMsg(trace_ctx, "\tpps_joint_cbcr_qp_offset_value = %d\n", p->pps_joint_cbcr_qp_offset_value); + va_TraceMsg(trace_ctx, "\tpps_chroma_qp_offset_list_len_minus1 = %d\n", p->pps_chroma_qp_offset_list_len_minus1); + + va_TraceMsg(trace_ctx, "\tpps_cb_qp_offset_list[6]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 6; i++) { + va_TracePrint(trace_ctx, "\t%d", p->pps_cb_qp_offset_list[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tpps_cr_qp_offset_list[6]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 6; i++) { + va_TracePrint(trace_ctx, "\t%d", p->pps_cr_qp_offset_list[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tpps_joint_cbcr_qp_offset_list[6]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 6; i++) { + va_TracePrint(trace_ctx, "\t%d", p->pps_joint_cbcr_qp_offset_list[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\treserved16b01 = %d\n", p->reserved16b01); + va_TraceMsg(trace_ctx, "\treserved32b02[2]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 2; i++) { + va_TracePrint(trace_ctx, "\t%d", p->reserved32b02[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tpps_flags = %d\n", p->pps_flags.value); + va_TraceMsg(trace_ctx, "\tpps_loop_filter_across_tiles_enabled_flag = %d\n", p->pps_flags.bits.pps_loop_filter_across_tiles_enabled_flag); + va_TraceMsg(trace_ctx, "\tpps_rect_slice_flag = %d\n", p->pps_flags.bits.pps_rect_slice_flag); + va_TraceMsg(trace_ctx, "\tpps_single_slice_per_subpic_flag = %d\n", p->pps_flags.bits.pps_single_slice_per_subpic_flag); + va_TraceMsg(trace_ctx, "\tpps_loop_filter_across_slices_enabled_flag = %d\n", p->pps_flags.bits.pps_loop_filter_across_slices_enabled_flag); + va_TraceMsg(trace_ctx, "\tpps_weighted_pred_flag = %d\n", p->pps_flags.bits.pps_weighted_pred_flag); + va_TraceMsg(trace_ctx, "\tpps_weighted_bipred_flag = %d\n", p->pps_flags.bits.pps_weighted_bipred_flag); + va_TraceMsg(trace_ctx, "\tpps_ref_wraparound_enabled_flag = %d\n", p->pps_flags.bits.pps_ref_wraparound_enabled_flag); + va_TraceMsg(trace_ctx, "\tpps_cu_qp_delta_enabled_flag = %d\n", p->pps_flags.bits.pps_cu_qp_delta_enabled_flag); + va_TraceMsg(trace_ctx, "\tpps_cu_chroma_qp_offset_list_enabled_flag = %d\n", p->pps_flags.bits.pps_cu_chroma_qp_offset_list_enabled_flag); + va_TraceMsg(trace_ctx, "\tpps_deblocking_filter_override_enabled_flag = %d\n", p->pps_flags.bits.pps_deblocking_filter_override_enabled_flag); + va_TraceMsg(trace_ctx, "\tpps_deblocking_filter_disabled_flag = %d\n", p->pps_flags.bits.pps_deblocking_filter_disabled_flag); + va_TraceMsg(trace_ctx, "\tpps_dbf_info_in_ph_flag = %d\n", p->pps_flags.bits.pps_dbf_info_in_ph_flag); + va_TraceMsg(trace_ctx, "\tpps_sao_info_in_ph_flag = %d\n", p->pps_flags.bits.pps_sao_info_in_ph_flag); + va_TraceMsg(trace_ctx, "\tpps_alf_info_in_ph_flag = %d\n", p->pps_flags.bits.pps_alf_info_in_ph_flag); + va_TraceMsg(trace_ctx, "\treserved = %d\n", p->pps_flags.bits.reserved); + + va_TraceMsg(trace_ctx, "\tph_lmcs_aps_id = %d\n", p->ph_lmcs_aps_id); + va_TraceMsg(trace_ctx, "\tph_scaling_list_aps_id = %d\n", p->ph_scaling_list_aps_id); + va_TraceMsg(trace_ctx, "\tph_log2_diff_min_qt_min_cb_intra_slice_luma = %d\n", p->ph_log2_diff_min_qt_min_cb_intra_slice_luma); + va_TraceMsg(trace_ctx, "\tph_max_mtt_hierarchy_depth_intra_slice_luma = %d\n", p->ph_max_mtt_hierarchy_depth_intra_slice_luma); + va_TraceMsg(trace_ctx, "\tph_log2_diff_max_bt_min_qt_intra_slice_luma = %d\n", p->ph_log2_diff_max_bt_min_qt_intra_slice_luma); + va_TraceMsg(trace_ctx, "\tph_log2_diff_max_tt_min_qt_intra_slice_luma = %d\n", p->ph_log2_diff_max_tt_min_qt_intra_slice_luma); + va_TraceMsg(trace_ctx, "\tph_log2_diff_min_qt_min_cb_intra_slice_chroma = %d\n", p->ph_log2_diff_min_qt_min_cb_intra_slice_chroma); + va_TraceMsg(trace_ctx, "\tph_max_mtt_hierarchy_depth_intra_slice_chroma = %d\n", p->ph_max_mtt_hierarchy_depth_intra_slice_chroma); + va_TraceMsg(trace_ctx, "\tph_log2_diff_max_bt_min_qt_intra_slice_chroma = %d\n", p->ph_log2_diff_max_bt_min_qt_intra_slice_chroma); + va_TraceMsg(trace_ctx, "\tph_log2_diff_max_tt_min_qt_intra_slice_chroma = %d\n", p->ph_log2_diff_max_tt_min_qt_intra_slice_chroma); + va_TraceMsg(trace_ctx, "\tph_cu_qp_delta_subdiv_intra_slice = %d\n", p->ph_cu_qp_delta_subdiv_intra_slice); + va_TraceMsg(trace_ctx, "\tph_cu_chroma_qp_offset_subdiv_intra_slice = %d\n", p->ph_cu_chroma_qp_offset_subdiv_intra_slice); + va_TraceMsg(trace_ctx, "\tph_log2_diff_min_qt_min_cb_inter_slice = %d\n", p->ph_log2_diff_min_qt_min_cb_inter_slice); + va_TraceMsg(trace_ctx, "\tph_max_mtt_hierarchy_depth_inter_slice = %d\n", p->ph_max_mtt_hierarchy_depth_inter_slice); + va_TraceMsg(trace_ctx, "\tph_log2_diff_max_bt_min_qt_inter_slice = %d\n", p->ph_log2_diff_max_bt_min_qt_inter_slice); + va_TraceMsg(trace_ctx, "\tph_log2_diff_max_tt_min_qt_inter_slice = %d\n", p->ph_log2_diff_max_tt_min_qt_inter_slice); + va_TraceMsg(trace_ctx, "\tph_cu_qp_delta_subdiv_inter_slice = %d\n", p->ph_cu_qp_delta_subdiv_inter_slice); + va_TraceMsg(trace_ctx, "\tph_cu_chroma_qp_offset_subdiv_inter_slice = %d\n", p->ph_cu_chroma_qp_offset_subdiv_inter_slice); + va_TraceMsg(trace_ctx, "\treserved16b02 = %d\n", p->reserved16b02); + va_TraceMsg(trace_ctx, "\treserved32b03[2]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 2; i++) { + va_TracePrint(trace_ctx, "\t%d", p->reserved32b03[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tph_flags = %d\n", p->ph_flags.value); + va_TraceMsg(trace_ctx, "\tph_non_ref_pic_flag = %d\n", p->ph_flags.bits.ph_non_ref_pic_flag); + va_TraceMsg(trace_ctx, "\tph_alf_enabled_flag = %d\n", p->ph_flags.bits.ph_alf_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_alf_cb_enabled_flag = %d\n", p->ph_flags.bits.ph_alf_cb_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_alf_cr_enabled_flag = %d\n", p->ph_flags.bits.ph_alf_cr_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_alf_cc_cb_enabled_flag = %d\n", p->ph_flags.bits.ph_alf_cc_cb_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_alf_cc_cr_enabled_flag = %d\n", p->ph_flags.bits.ph_alf_cc_cr_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_lmcs_enabled_flag = %d\n", p->ph_flags.bits.ph_lmcs_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_chroma_residual_scale_flag = %d\n", p->ph_flags.bits.ph_chroma_residual_scale_flag); + va_TraceMsg(trace_ctx, "\tph_explicit_scaling_list_enabled_flag = %d\n", p->ph_flags.bits.ph_explicit_scaling_list_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_virtual_boundaries_present_flag = %d\n", p->ph_flags.bits.ph_virtual_boundaries_present_flag); + va_TraceMsg(trace_ctx, "\tph_temporal_mvp_enabled_flag = %d\n", p->ph_flags.bits.ph_temporal_mvp_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_mmvd_fullpel_only_flag = %d\n", p->ph_flags.bits.ph_mmvd_fullpel_only_flag); + va_TraceMsg(trace_ctx, "\tph_mvd_l1_zero_flag = %d\n", p->ph_flags.bits.ph_mvd_l1_zero_flag); + va_TraceMsg(trace_ctx, "\tph_bdof_disabled_flag = %d\n", p->ph_flags.bits.ph_bdof_disabled_flag); + va_TraceMsg(trace_ctx, "\tph_dmvr_disabled_flag = %d\n", p->ph_flags.bits.ph_dmvr_disabled_flag); + va_TraceMsg(trace_ctx, "\tph_prof_disabled_flag = %d\n", p->ph_flags.bits.ph_prof_disabled_flag); + va_TraceMsg(trace_ctx, "\tph_joint_cbcr_sign_flag = %d\n", p->ph_flags.bits.ph_joint_cbcr_sign_flag); + va_TraceMsg(trace_ctx, "\tph_sao_luma_enabled_flag = %d\n", p->ph_flags.bits.ph_sao_luma_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_sao_chroma_enabled_flag = %d\n", p->ph_flags.bits.ph_sao_chroma_enabled_flag); + va_TraceMsg(trace_ctx, "\tph_deblocking_filter_disabled_flag = %d\n", p->ph_flags.bits.ph_deblocking_filter_disabled_flag); + va_TraceMsg(trace_ctx, "\treserved = %d\n", p->ph_flags.bits.reserved); + va_TraceMsg(trace_ctx, "\treserved32b04 = %d\n", p->reserved32b04); + + va_TraceMsg(trace_ctx, "\tPicMiscFlags = %d\n", p->PicMiscFlags.value); + va_TraceMsg(trace_ctx, "\tIntraPicFlag = %d\n", p->PicMiscFlags.fields.IntraPicFlag); + va_TraceMsg(trace_ctx, "\treserved = %d\n", p->PicMiscFlags.fields.reserved); + va_TraceMsg(trace_ctx, "\treserved32b[17]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 17; i++) { + va_TracePrint(trace_ctx, "\t%d", p->reserved32b[i]); + } + va_TracePrint(trace_ctx, "\n"); + return; +} + +static void va_TraceVASliceParameterBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + int i, j; + VASliceParameterBufferVVC* p = (VASliceParameterBufferVVC*)data; + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + trace_ctx->trace_slice_no++; + trace_ctx->trace_slice_size = p->slice_data_size; + + va_TraceMsg(trace_ctx, "\t--VASliceParameterBufferVVC\n"); + va_TraceMsg(trace_ctx, "\tslice_data_size = %d\n", p->slice_data_size); + va_TraceMsg(trace_ctx, "\tslice_data_offset = %d\n", p->slice_data_offset); + va_TraceMsg(trace_ctx, "\tslice_data_flag = %d\n", p->slice_data_flag); + va_TraceMsg(trace_ctx, "\tslice_data_byte_offset = %d\n", p->slice_data_byte_offset); + + va_TraceMsg(trace_ctx, "\tRefPicList[2][15]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 2; i++) { + for (j = 0; j < 15; j++) { + va_TracePrint(trace_ctx, "\t%d", p->RefPicList[i][j]); + if ((j + 1) % 8 == 0) + TRACE_NEWLINE(); + } + TRACE_NEWLINE(); + } + + va_TraceMsg(trace_ctx, "\tsh_subpic_id = %d\n", p->sh_subpic_id); + va_TraceMsg(trace_ctx, "\tsh_slice_address = %d\n", p->sh_slice_address); + va_TraceMsg(trace_ctx, "\tsh_num_tiles_in_slice_minus1 = %d\n", p->sh_num_tiles_in_slice_minus1); + va_TraceMsg(trace_ctx, "\tsh_slice_type = %d\n", p->sh_slice_type); + va_TraceMsg(trace_ctx, "\tsh_num_alf_aps_ids_luma = %d\n", p->sh_num_alf_aps_ids_luma); + + va_TraceMsg(trace_ctx, "\tsh_alf_aps_id_luma[7]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 7; i++) { + va_TracePrint(trace_ctx, "\t%d", p->sh_alf_aps_id_luma[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tsh_alf_aps_id_chroma = %d\n", p->sh_alf_aps_id_chroma); + va_TraceMsg(trace_ctx, "\tsh_alf_cc_cb_aps_id = %d\n", p->sh_alf_cc_cb_aps_id); + va_TraceMsg(trace_ctx, "\tsh_alf_cc_cr_aps_id = %d\n", p->sh_alf_cc_cr_aps_id); + + va_TraceMsg(trace_ctx, "\tNumRefIdxActive[2]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 2; i++) { + va_TracePrint(trace_ctx, "\t%d", p->NumRefIdxActive[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tsh_collocated_ref_idx = %d\n", p->sh_collocated_ref_idx); + va_TraceMsg(trace_ctx, "\tSliceQpY = %d\n", p->SliceQpY); + va_TraceMsg(trace_ctx, "\tsh_cb_qp_offset = %d\n", p->sh_cb_qp_offset); + va_TraceMsg(trace_ctx, "\tsh_cr_qp_offset = %d\n", p->sh_cr_qp_offset); + va_TraceMsg(trace_ctx, "\tsh_joint_cbcr_qp_offset = %d\n", p->sh_joint_cbcr_qp_offset); + va_TraceMsg(trace_ctx, "\tsh_luma_beta_offset_div2 = %d\n", p->sh_luma_beta_offset_div2); + va_TraceMsg(trace_ctx, "\tsh_luma_tc_offset_div2 = %d\n", p->sh_luma_tc_offset_div2); + va_TraceMsg(trace_ctx, "\tsh_cb_beta_offset_div2 = %d\n", p->sh_cb_beta_offset_div2); + va_TraceMsg(trace_ctx, "\tsh_cb_tc_offset_div2 = %d\n", p->sh_cb_tc_offset_div2); + va_TraceMsg(trace_ctx, "\tsh_cr_beta_offset_div2 = %d\n", p->sh_cr_beta_offset_div2); + va_TraceMsg(trace_ctx, "\tsh_cr_tc_offset_div2 = %d\n", p->sh_cr_tc_offset_div2); + va_TraceMsg(trace_ctx, "\treserved8b[3]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 3; i++) { + va_TracePrint(trace_ctx, "\t%d", p->reserved8b[i]); + } + va_TracePrint(trace_ctx, "\n"); + va_TraceMsg(trace_ctx, "\treserved32b = %d\n", p->reserved32b); + + va_TraceMsg(trace_ctx, "\tWPInfo=\n"); + va_TraceMsg(trace_ctx, "\tluma_log2_weight_denom = %d\n", p->WPInfo.luma_log2_weight_denom); + va_TraceMsg(trace_ctx, "\tdelta_chroma_log2_weight_denom = %d\n", p->WPInfo.delta_chroma_log2_weight_denom); + va_TraceMsg(trace_ctx, "\tnum_l0_weights = %d\n", p->WPInfo.num_l0_weights); + va_TraceMsg(trace_ctx, "\tluma_weight_l0_flag[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.luma_weight_l0_flag[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tchroma_weight_l0_flag[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.chroma_weight_l0_flag[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tdelta_luma_weight_l0[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.delta_luma_weight_l0[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tluma_offset_l0[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.luma_offset_l0[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l0[15][2] = \n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 15; i++) { + for (j = 0; j < 2; j++) { + va_TracePrint(trace_ctx, "\t%d", p->WPInfo.delta_chroma_weight_l0[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tdelta_chroma_offset_l0[15][2] = \n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 15; i++) { + for (j = 0; j < 2; j++) { + va_TracePrint(trace_ctx, "\t%d", p->WPInfo.delta_chroma_offset_l0[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tnum_l1_weights = %d\n", p->WPInfo.num_l1_weights); + va_TraceMsg(trace_ctx, "\tluma_weight_l1_flag[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.luma_weight_l1_flag[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tchroma_weight_l1_flag[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.chroma_weight_l1_flag[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tdelta_luma_weight_l1[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.delta_luma_weight_l1[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tluma_offset_l1[15]=\n"); + for (i = 0; i < 15; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->WPInfo.luma_offset_l1[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tdelta_chroma_weight_l1[15][2] = \n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 15; i++) { + for (j = 0; j < 2; j++) { + va_TracePrint(trace_ctx, "\t%d", p->WPInfo.delta_chroma_weight_l1[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tdelta_chroma_offset_l1[15][2] = \n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 15; i++) { + for (j = 0; j < 2; j++) { + va_TracePrint(trace_ctx, "\t%d", p->WPInfo.delta_chroma_offset_l1[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + va_TraceMsg(trace_ctx, "\treserved16b = %d\n", p->WPInfo.reserved16b); + va_TraceMsg(trace_ctx, "\treserved32b = %d\n", p->WPInfo.reserved32b); + + va_TraceMsg(trace_ctx, "\tsh_flags = %d\n", p->sh_flags.value); + va_TraceMsg(trace_ctx, "\tsh_alf_enabled_flag = %d\n", p->sh_flags.bits.sh_alf_enabled_flag); + va_TraceMsg(trace_ctx, "\tsh_alf_cb_enabled_flag = %d\n", p->sh_flags.bits.sh_alf_cb_enabled_flag); + va_TraceMsg(trace_ctx, "\tsh_alf_cr_enabled_flag = %d\n", p->sh_flags.bits.sh_alf_cr_enabled_flag); + va_TraceMsg(trace_ctx, "\tsh_alf_cc_cb_enabled_flag = %d\n", p->sh_flags.bits.sh_alf_cc_cb_enabled_flag); + va_TraceMsg(trace_ctx, "\tsh_alf_cc_cr_enabled_flag = %d\n", p->sh_flags.bits.sh_alf_cc_cr_enabled_flag); + va_TraceMsg(trace_ctx, "\tsh_lmcs_used_flag = %d\n", p->sh_flags.bits.sh_lmcs_used_flag); + va_TraceMsg(trace_ctx, "\tsh_explicit_scaling_list_used_flag = %d\n", p->sh_flags.bits.sh_explicit_scaling_list_used_flag); + va_TraceMsg(trace_ctx, "\tsh_cabac_init_flag = %d\n", p->sh_flags.bits.sh_cabac_init_flag); + va_TraceMsg(trace_ctx, "\tsh_collocated_from_l0_flag = %d\n", p->sh_flags.bits.sh_collocated_from_l0_flag); + va_TraceMsg(trace_ctx, "\tsh_cu_chroma_qp_offset_enabled_flag = %d\n", p->sh_flags.bits.sh_cu_chroma_qp_offset_enabled_flag); + va_TraceMsg(trace_ctx, "\tsh_sao_luma_used_flag = %d\n", p->sh_flags.bits.sh_sao_luma_used_flag); + va_TraceMsg(trace_ctx, "\tsh_sao_chroma_used_flag = %d\n", p->sh_flags.bits.sh_sao_chroma_used_flag); + va_TraceMsg(trace_ctx, "\tsh_deblocking_filter_disabled_flag = %d\n", p->sh_flags.bits.sh_deblocking_filter_disabled_flag); + va_TraceMsg(trace_ctx, "\tsh_dep_quant_used_flag = %d\n", p->sh_flags.bits.sh_dep_quant_used_flag); + va_TraceMsg(trace_ctx, "\tsh_sign_data_hiding_used_flag = %d\n", p->sh_flags.bits.sh_sign_data_hiding_used_flag); + va_TraceMsg(trace_ctx, "\tsh_ts_residual_coding_disabled_flag = %d\n", p->sh_flags.bits.sh_ts_residual_coding_disabled_flag); + va_TraceMsg(trace_ctx, "\treserved = %d\n", p->sh_flags.bits.reserved); + + va_TraceMsg(trace_ctx, NULL); +} + +static void va_TraceVAScalingListBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + int i, j, k; + VAScalingListVVC* p = (VAScalingListVVC*)data; + + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + va_TraceMsg(trace_ctx, "\t--VAScalingListBufferVVC\n"); + + va_TraceMsg(trace_ctx, "\taps_adaptation_parameter_set_id = %d\n", p->aps_adaptation_parameter_set_id); + va_TraceMsg(trace_ctx, "\treserved8b = %d\n", p->reserved8b); + va_TraceMsg(trace_ctx, "\tScalingMatrixDCRec[14]=\n"); + for (i = 0; i < 14; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->ScalingMatrixDCRec[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tScalingMatrixRec2x2[2][2][2] = \n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 2; i++) { + for (j = 0; j < 2; j++) { + for (k = 0; k < 2; k++) { + va_TracePrint(trace_ctx, "\t%d", p->ScalingMatrixRec2x2[i][j][k]); + } + TRACE_NEWLINE(); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tScalingMatrixRec4x4[6][4][4] = \n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 6; i++) { + for (j = 0; j < 4; j++) { + for (k = 0; k < 4; k++) { + va_TracePrint(trace_ctx, "\t%d", p->ScalingMatrixRec4x4[i][j][k]); + } + TRACE_NEWLINE(); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tScalingMatrixRec8x8[20][8][8] = \n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 20; i++) { + for (j = 0; j < 8; j++) { + for (k = 0; k < 8; k++) { + va_TracePrint(trace_ctx, "\t%d", p->ScalingMatrixRec8x8[i][j][k]); + } + TRACE_NEWLINE(); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tva_reserved[8]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 8; i++) { + va_TracePrint(trace_ctx, "\t%d", p->va_reserved[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, NULL); +} + +static void va_TraceVAAlfBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + int i, j; + VAAlfDataVVC* p = (VAAlfDataVVC*)data; + + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + va_TraceMsg(trace_ctx, "\t--VAAlfDataBufferVVC\n"); + + va_TraceMsg(trace_ctx, "\taps_adaptation_parameter_set_id = %d\n", p->aps_adaptation_parameter_set_id); + va_TraceMsg(trace_ctx, "\talf_luma_num_filters_signalled_minus1 = %d\n", p->alf_luma_num_filters_signalled_minus1); + va_TraceMsg(trace_ctx, "\talf_luma_coeff_delta_idx[25]=\n"); + for (i = 0; i < 25; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->alf_luma_coeff_delta_idx[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tfiltCoeff[25][12]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 25; i++) { + for (j = 0; j < 12; j++) { + va_TracePrint(trace_ctx, "\t%d", p->filtCoeff[i][j]); + if ((j + 1) % 8 == 0) + TRACE_NEWLINE(); + } + TRACE_NEWLINE(); + } + + va_TraceMsg(trace_ctx, "\talf_luma_clip_idx[25][12]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 25; i++) { + for (j = 0; j < 12; j++) { + va_TracePrint(trace_ctx, "\t%d", p->alf_luma_clip_idx[i][j]); + if ((j + 1) % 8 == 0) + TRACE_NEWLINE(); + } + TRACE_NEWLINE(); + } + + va_TraceMsg(trace_ctx, "\talf_chroma_num_alt_filters_minus1 = %d\n", p->alf_chroma_num_alt_filters_minus1); + va_TraceMsg(trace_ctx, "\tAlfCoeffC[8][6]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 8; i++) { + for (j = 0; j < 6; j++) { + va_TracePrint(trace_ctx, "\t%d", p->AlfCoeffC[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\talf_chroma_clip_idx[8][6]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 8; i++) { + for (j = 0; j < 6; j++) { + va_TracePrint(trace_ctx, "\t%d", p->alf_chroma_clip_idx[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\talf_cc_cb_filters_signalled_minus1 = %d\n", p->alf_cc_cb_filters_signalled_minus1); + va_TraceMsg(trace_ctx, "\tCcAlfApsCoeffCb[4][7]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 4; i++) { + for (j = 0; j < 7; j++) { + va_TracePrint(trace_ctx, "\t%d", p->CcAlfApsCoeffCb[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\talf_cc_cr_filters_signalled_minus1 = %d\n", p->alf_cc_cr_filters_signalled_minus1); + va_TraceMsg(trace_ctx, "\tCcAlfApsCoeffCr[4][7]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 4; i++) { + for (j = 0; j < 7; j++) { + va_TracePrint(trace_ctx, "\t%d", p->CcAlfApsCoeffCr[i][j]); + } + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\treserved16b = %d\n", p->reserved16b); + va_TraceMsg(trace_ctx, "\treserved32b = %d\n", p->reserved32b); + + va_TraceMsg(trace_ctx, "\talf_flags = %d\n", p->alf_flags.value); + va_TraceMsg(trace_ctx, "\talf_luma_filter_signal_flag = %d\n", p->alf_flags.bits.alf_luma_filter_signal_flag); + va_TraceMsg(trace_ctx, "\talf_chroma_filter_signal_flag = %d\n", p->alf_flags.bits.alf_chroma_filter_signal_flag); + va_TraceMsg(trace_ctx, "\talf_cc_cb_filter_signal_flag = %d\n", p->alf_flags.bits.alf_cc_cb_filter_signal_flag); + va_TraceMsg(trace_ctx, "\talf_cc_cr_filter_signal_flag = %d\n", p->alf_flags.bits.alf_cc_cr_filter_signal_flag); + va_TraceMsg(trace_ctx, "\talf_luma_clip_flag = %d\n", p->alf_flags.bits.alf_luma_clip_flag); + va_TraceMsg(trace_ctx, "\talf_chroma_clip_flag = %d\n", p->alf_flags.bits.alf_chroma_clip_flag); + va_TraceMsg(trace_ctx, "\treserved = %d\n", p->alf_flags.bits.reserved); + + va_TraceMsg(trace_ctx, "\tva_reserved[8]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 8; i++) { + va_TracePrint(trace_ctx, "\t%d", p->va_reserved[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, NULL); +} + +static void va_TraceVALmcsBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + int i; + VALmcsDataVVC* p = (VALmcsDataVVC*)data; + + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + va_TraceMsg(trace_ctx, "\t--VALmcsDataBufferVVC\n"); + va_TraceMsg(trace_ctx, "\taps_adaptation_parameter_set_id = %d\n", p->aps_adaptation_parameter_set_id); + va_TraceMsg(trace_ctx, "\tlmcs_min_bin_idx = %d\n", p->lmcs_min_bin_idx); + va_TraceMsg(trace_ctx, "\tlmcs_delta_max_bin_idx = %d\n", p->lmcs_delta_max_bin_idx); + + va_TraceMsg(trace_ctx, "\tlmcsDeltaCW[16]=\n"); + for (i = 0; i < 16; i++) { + va_TraceMsg(trace_ctx, "\t%d", p->lmcsDeltaCW[i]); + if ((i + 1) % 8 == 0) + TRACE_NEWLINE(); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tlmcsDeltaCrs = %d\n", p->lmcsDeltaCrs); + va_TraceMsg(trace_ctx, "\treserved8b[3]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 3; i++) { + va_TracePrint(trace_ctx, "\t%d", p->reserved8b[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, "\tva_reserved[8]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 8; i++) { + va_TracePrint(trace_ctx, "\t%d", p->va_reserved[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, NULL); +} + +static void va_TraceVASubPicBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + int i; + VASubPicVVC* p = (VASubPicVVC*)data; + + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + va_TraceMsg(trace_ctx, "\t--VASubPicBufferVVC\n"); + + va_TraceMsg(trace_ctx, "\tsps_subpic_ctu_top_left_x = %d\n", p->sps_subpic_ctu_top_left_x); + va_TraceMsg(trace_ctx, "\tsps_subpic_ctu_top_left_y = %d\n", p->sps_subpic_ctu_top_left_y); + va_TraceMsg(trace_ctx, "\tsps_subpic_width_minus1 = %d\n", p->sps_subpic_width_minus1); + va_TraceMsg(trace_ctx, "\tsps_subpic_height_minus1 = %d\n", p->sps_subpic_height_minus1); + va_TraceMsg(trace_ctx, "\tSubpicIdVal = %d\n", p->SubpicIdVal); + + va_TraceMsg(trace_ctx, "\tsubpic_flags = %d\n", p->subpic_flags.value); + va_TraceMsg(trace_ctx, "\tsps_subpic_treated_as_pic_flag = %d\n", p->subpic_flags.bits.sps_subpic_treated_as_pic_flag); + va_TraceMsg(trace_ctx, "\tsps_loop_filter_across_subpic_enabled_flag = %d\n", p->subpic_flags.bits.sps_loop_filter_across_subpic_enabled_flag); + va_TraceMsg(trace_ctx, "\treserved = %d\n", p->subpic_flags.bits.reserved); + + va_TraceMsg(trace_ctx, "\tva_reserved[4]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 4; i++) { + va_TracePrint(trace_ctx, "\t%d", p->va_reserved[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, NULL); +} + +static void va_TraceVATileBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + uint16_t* p = (uint16_t*)data; + + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + va_TraceMsg(trace_ctx, "\t--VATileBufferVVC\n"); + va_TraceMsg(trace_ctx, "\ttile_dimension = %d\n", *p); + + va_TraceMsg(trace_ctx, NULL); +} + +static void va_TraceVASliceStructBufferVVC( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* data) +{ + int i; + VASliceStructVVC* p = (VASliceStructVVC*)data; + + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + va_TraceMsg(trace_ctx, "\t--VASliceStructBufferVVC\n"); + va_TraceMsg(trace_ctx, "\tSliceTopLeftTileIdx = %d\n", p->SliceTopLeftTileIdx); + va_TraceMsg(trace_ctx, "\tpps_slice_width_in_tiles_minus1 = %d\n", p->pps_slice_width_in_tiles_minus1); + va_TraceMsg(trace_ctx, "\tpps_slice_height_in_tiles_minus1 = %d\n", p->pps_slice_height_in_tiles_minus1); + va_TraceMsg(trace_ctx, "\tpps_exp_slice_height_in_ctus_minus1 = %d\n", p->pps_exp_slice_height_in_ctus_minus1); + + va_TraceMsg(trace_ctx, "\tva_reserved[4]=\n"); + va_TraceMsg(trace_ctx, ""); + for (i = 0; i < 4; i++) { + va_TracePrint(trace_ctx, "\t%d", p->va_reserved[i]); + } + va_TracePrint(trace_ctx, "\n"); + + va_TraceMsg(trace_ctx, NULL); +} + + static inline void va_TraceIsRextProfile( VADisplay dpy, VAContextID context, @@ -5261,6 +6060,49 @@ static void va_TraceMPEG4Buf( } } +static void va_TraceVVCBuf( + VADisplay dpy, + VAContextID context, + VABufferID buffer, + VABufferType type, + unsigned int size, + unsigned int num_elements, + void* pbuf +) +{ + DPY2TRACECTX(dpy, context, VA_INVALID_ID); + + switch (type) { + case VAPictureParameterBufferType: + va_TraceVAPictureParameterBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VASliceParameterBufferType: + va_TraceVASliceParameterBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAIQMatrixBufferType: + va_TraceVAScalingListBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VAAlfBufferType: + va_TraceVAAlfBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VALmcsBufferType: + va_TraceVALmcsBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VASubPicBufferType: + va_TraceVASubPicBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VATileBufferType: + va_TraceVATileBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + case VASliceStructBufferType: + va_TraceVASliceStructBufferVVC(dpy, context, buffer, type, size, num_elements, pbuf); + break; + default: + va_TraceVABuffers(dpy, context, buffer, type, size, num_elements, pbuf); + break; + } +} + static void va_TraceHEVCBuf( VADisplay dpy, VAContextID context, @@ -5913,6 +6755,14 @@ void va_TraceRenderPicture( va_TraceHEVCBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size * j); } break; + case VAProfileVVCMain10: + case VAProfileVVCMultilayerMain10: + for (j = 0; j < num_elements; j++) { + va_TraceMsg(trace_ctx, "\telement[%d] = \n", j); + + va_TraceVVCBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size * j); + } + break; case VAProfileVP9Profile0: case VAProfileVP9Profile1: case VAProfileVP9Profile2: