1 /* 2 * Copyright 2021 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __AVS2D_SYNTAX_H__ 18 #define __AVS2D_SYNTAX_H__ 19 20 #include "rk_type.h" 21 22 //!< avs2 decoder picture parameters structure 23 typedef struct _DXVA_PicParams_AVS2 { 24 //!< sequence header 25 RK_U32 chroma_format_idc : 2; 26 RK_U32 pic_width_in_luma_samples : 16; 27 RK_U32 pic_height_in_luma_samples : 16; 28 RK_U32 bit_depth_luma_minus8 : 3; 29 RK_U32 bit_depth_chroma_minus8 : 3; 30 RK_U32 lcu_size : 3; 31 RK_U32 progressive_sequence : 1; 32 RK_U32 field_coded_sequence : 1; 33 RK_U32 multi_hypothesis_skip_enable_flag : 1; 34 RK_U32 dual_hypothesis_prediction_enable_flag : 1; 35 RK_U32 weighted_skip_enable_flag : 1; 36 RK_U32 asymmetrc_motion_partitions_enable_flag : 1; 37 RK_U32 nonsquare_quadtree_transform_enable_flag : 1; 38 RK_U32 nonsquare_intra_prediction_enable_flag : 1; 39 RK_U32 secondary_transform_enable_flag : 1; 40 RK_U32 sample_adaptive_offset_enable_flag : 1; 41 RK_U32 adaptive_loop_filter_enable_flag : 1; 42 RK_U32 pmvr_enable_flag : 1; 43 RK_U32 cross_slice_loopfilter_enable_flag : 1; 44 //!< picture header 45 RK_U32 picture_type : 3; 46 RK_U32 scene_reference_enable_flag : 1; 47 RK_U32 bottom_field_picture_flag : 1; 48 RK_U32 fixed_picture_qp : 1; 49 RK_U32 picture_qp : 7; 50 RK_U32 loop_filter_disable_flag : 1; 51 RK_S8 alpha_c_offset; //!< 5bits signed 52 RK_S8 beta_offset; //!< 5bits signed 53 } PicParams_Avs2d, *LP_PicParams_Avs2d; 54 55 typedef struct _DXVA_RefParams_AVS2 { 56 RK_U8 ref_pic_num; 57 RK_S32 ref_poc_list[32]; 58 RK_S32 scene_ref_slot_idx; 59 RK_S32 scene_ref_enable; 60 RK_S32 scene_ref_replace_pos; 61 } RefParams_Avs2d, *LP_RefParams_Avs2d; 62 63 typedef struct _DXVA_AlfParams_AVS2 { 64 RK_U8 enable_pic_alf_y; //!< 1bits 65 RK_U8 enable_pic_alf_cb; //!< 1bits 66 RK_U8 enable_pic_alf_cr; //!< 1bits 67 RK_U8 alf_filter_num_minus1; //!< 4bits 68 RK_U8 alf_coeff_idx_tab[16]; 69 RK_S32 alf_coeff_y[16][9]; 70 RK_S32 alf_coeff_cb[9]; 71 RK_S32 alf_coeff_cr[9]; 72 } AlfParams_Avs2d, *LP_AlfParams_Avs2d; 73 74 typedef struct _DXVA_WqmParams_AVS2 { 75 RK_U8 pic_weight_quant_enable_flag; 76 RK_S8 chroma_quant_param_delta_cb; //!< 6bits 77 RK_S8 chroma_quant_param_delta_cr; //!< 6bits 78 RK_U32 wq_matrix[2][64]; 79 } WqmParams_Avs2d, *LP_WqmParams_Avs2d; 80 81 typedef struct avs2d_syntax_t { 82 PicParams_Avs2d pp; 83 RefParams_Avs2d refp; 84 AlfParams_Avs2d alfp; 85 WqmParams_Avs2d wqmp; 86 RK_U8 *bitstream; 87 RK_U32 bitstream_size; 88 } Avs2dSyntax_t; 89 90 #endif /*__AVS2D_SYNTAX_H__*/ 91