xref: /rockchip-linux_mpp/mpp/common/vp8d_syntax.h (revision 437bfbeb9567cca9cd9080e3f6954aa9d6a94f18)
1 /*
2  *
3  * Copyright 2015 Rockchip Electronics Co. LTD
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __VP8D_SYNTAX_H__
19 #define __VP8D_SYNTAX_H__
20 
21 #include "rk_type.h"
22 
23 typedef struct _DXVA_PicEntry_VP8 {
24     union {
25         struct {
26             RK_U8 Index7Bits     : 7;
27             RK_U8 AssociatedFlag : 1;
28         };
29         RK_U8 bPicEntry;
30     };
31 } DXVA_PicEntry_VP8;
32 typedef struct _segmentation_Vp8 {
33     union {
34         struct {
35             RK_U8 segmentation_enabled         : 1;
36             RK_U8 update_mb_segmentation_map   : 1;
37             RK_U8 update_mb_segmentation_data  : 1;
38             RK_U8 mb_segement_abs_delta        : 1;
39             RK_U8 ReservedSegmentFlags4Bits    : 4;
40         };
41         RK_U8 wSegmentFlags;
42     };
43     RK_S8 segment_feature_data[2][4];
44     RK_U8 mb_segment_tree_probs[3];
45 } DXVA_segmentation_VP8;
46 
47 typedef struct VP8DDxvaParam_t {
48     RK_U32 first_part_size;
49     RK_U32 width;
50     RK_U32 height;
51     DXVA_PicEntry_VP8 CurrPic;
52     union {
53         struct {
54             RK_U8 frame_type           : 1;
55             RK_U8 version              : 3;
56             RK_U8 show_frame           : 1;
57             RK_U8 clamp_type           : 1;
58             RK_U8 ReservedFrameTag2Bits: 2;
59         };
60         RK_U8 wFrameTagFlags;
61     };
62     DXVA_segmentation_VP8 stVP8Segments;
63     RK_U8              filter_type;
64     RK_U8              filter_level;
65     RK_U8              sharpness;
66     RK_U8              mode_ref_lf_delta_enabled;
67     RK_U8              mode_ref_lf_delta_update;
68     RK_S8              ref_lf_deltas[4];
69     RK_S8              mode_lf_deltas[4];
70     RK_U8              log2_nbr_of_dct_partitions;
71     RK_U8              base_qindex;
72     RK_S8              y1dc_delta_q;
73     RK_S8              y1ac_delta_q;
74     RK_S8              y2dc_delta_q;
75     RK_S8              y2ac_delta_q;
76     RK_S8              uvdc_delta_q;
77     RK_S8              uvac_delta_q;
78 
79     DXVA_PicEntry_VP8  alt_fb_idx;
80     DXVA_PicEntry_VP8  gld_fb_idx;
81     DXVA_PicEntry_VP8  lst_fb_idx;
82 
83     RK_U8              ref_frame_sign_bias_golden;
84     RK_U8              ref_frame_sign_bias_altref;
85     RK_U8              refresh_entropy_probs;
86 
87     RK_U8              vp8_coef_update_probs[4][8][3][11];
88     RK_U8              probe_skip_false;
89     RK_U8              mb_no_coeff_skip;
90     RK_U8              prob_intra;
91     RK_U8              prob_last;
92     RK_U8              prob_golden;
93     RK_U8              intra_16x16_prob[4];
94     RK_U8              intra_chroma_prob[3];
95     RK_U8              vp8_mv_update_probs[2][19];
96 
97     RK_U32             decMode;
98     RK_U32             bool_value;
99     RK_U32             bool_range;
100     RK_U32             stream_start_offset;
101     RK_U32             dctPartitionOffsets[8];
102     RK_U32             bitstream_length;
103     RK_U32             stream_start_bit;
104     RK_U32             frameTagSize;
105     RK_U32             streamEndPos;
106     RK_U32             offsetToDctParts;
107 } DXVA_PicParams_VP8;
108 
109 #if 0
110 typedef struct VP8DDxvaParam_t {
111     RK_U32 first_part_size;
112     RK_U32 width;
113     RK_U32 height;
114     DXVA_PicEntry_VP8 CurrPic;
115     union {
116         struct {
117             RK_U8 key_frame : 1;
118             RK_U8 segmentationEnabled : 1;
119             RK_U8 segmentationMapUpdate : 1;
120             RK_U8 modeRefLfEnabled : 1;
121             RK_U8 coeffSkipMode: 1;
122             RK_U8 reservedFormatInfo: 3;
123         };
124         RK_U8 wFormatAndPictureInfoFlags;
125     };
126     RK_U32              decMode;
127     RK_U32              loopFilterType;
128     RK_U32              loopFilterSharpness;
129     RK_U32              loopFilterLevel;
130     RK_U32              segmentFeatureMode;
131     RK_U32              vpVersion;
132     RK_U32              bool_value;
133     RK_U32              bool_range;
134     RK_U32              stream_start_offset;
135     RK_U32              stream_start_bit;
136     RK_U32              frameTagSize;
137     RK_U32              streamEndPos;
138     RK_U32              nbrDctPartitions;
139     RK_U32              offsetToDctParts;
140 
141     RK_S8              qpYAc;
142     RK_S8              qpYDc;
143     RK_S8              qpY2Ac;
144     RK_S8              qpY2Dc;
145     RK_S8              qpChAc;
146     RK_S8              qpChDc;
147     RK_U8              vp8_coef_update_probs[4][8][3][11];
148     RK_U8              probe_skip_false;
149     RK_U8              prob_intra;
150     RK_U8              prob_last;
151     RK_U8              prob_golden;
152     RK_U8              intra_16x16_prob[4];
153     RK_U8              intra_chroma_prob[3];
154     RK_U8              vp8_mv_update_probs[2][19];
155     RK_U8              vp8_segment_prob[3];
156 
157     RK_U32             refFrameSignBias[2];
158     RK_S32             dcPred[2];
159     RK_S32             dcMatch[2];
160     RK_S32             segmentQp[4];
161     RK_S32             mbRefLfDelta[4];
162     RK_S32             mbModeLfDelta[4];
163     RK_U32             vp7ScanOrder[16];
164     RK_S32             segmentLoopfilter[4];
165     RK_U32             dctPartitionOffsets[8];
166     RK_U32              bitstream_length;
167     DXVA_PicEntry_VP8   frame_refs[3];
168 } DXVA_PicParams_VP8;
169 #endif
170 #endif
171