xref: /rockchip-linux_mpp/mpp/common/avs2d_syntax.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
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     RK_S32      cur_poc;
54 } PicParams_Avs2d, *LP_PicParams_Avs2d;
55 
56 typedef struct _DXVA_RefParams_AVS2 {
57     RK_U8       ref_pic_num;
58     RK_S32      ref_poc_list[32];
59     RK_S32      scene_ref_slot_idx;
60     RK_S32      scene_ref_enable;
61     RK_S32      scene_ref_replace_pos;
62 } RefParams_Avs2d, *LP_RefParams_Avs2d;
63 
64 typedef struct _DXVA_AlfParams_AVS2 {
65     RK_U8       enable_pic_alf_y;       //!< 1bits
66     RK_U8       enable_pic_alf_cb;      //!< 1bits
67     RK_U8       enable_pic_alf_cr;      //!< 1bits
68     RK_U8       alf_filter_num_minus1;  //!< 4bits
69     RK_U8       alf_coeff_idx_tab[16];
70     RK_S32      alf_coeff_y[16][9];
71     RK_S32      alf_coeff_cb[9];
72     RK_S32      alf_coeff_cr[9];
73 } AlfParams_Avs2d, *LP_AlfParams_Avs2d;
74 
75 typedef struct _DXVA_WqmParams_AVS2 {
76     RK_U8               pic_weight_quant_enable_flag;
77     RK_S8               chroma_quant_param_delta_cb;    //!< 6bits
78     RK_S8               chroma_quant_param_delta_cr;    //!< 6bits
79     RK_U32              wq_matrix[2][64];
80 } WqmParams_Avs2d, *LP_WqmParams_Avs2d;
81 
82 typedef struct avs2d_syntax_t {
83     PicParams_Avs2d     pp;
84     RefParams_Avs2d     refp;
85     AlfParams_Avs2d     alfp;
86     WqmParams_Avs2d     wqmp;
87     RK_U8              *bitstream;
88     RK_U32              bitstream_size;
89 } Avs2dSyntax_t;
90 
91 #endif /*__AVS2D_SYNTAX_H__*/
92