Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/gallium/include/pipe/p_video_state.h
4565 views
1
/**************************************************************************
2
*
3
* Copyright 2009 Younes Manton.
4
* All Rights Reserved.
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a
7
* copy of this software and associated documentation files (the
8
* "Software"), to deal in the Software without restriction, including
9
* without limitation the rights to use, copy, modify, merge, publish,
10
* distribute, sub license, and/or sell copies of the Software, and to
11
* permit persons to whom the Software is furnished to do so, subject to
12
* the following conditions:
13
*
14
* The above copyright notice and this permission notice (including the
15
* next paragraph) shall be included in all copies or substantial portions
16
* of the Software.
17
*
18
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
*
26
**************************************************************************/
27
28
#ifndef PIPE_VIDEO_STATE_H
29
#define PIPE_VIDEO_STATE_H
30
31
#include "pipe/p_defines.h"
32
#include "pipe/p_format.h"
33
#include "pipe/p_state.h"
34
#include "pipe/p_screen.h"
35
#include "util/u_hash_table.h"
36
#include "util/u_inlines.h"
37
38
#ifdef __cplusplus
39
extern "C" {
40
#endif
41
42
/*
43
* see table 6-12 in the spec
44
*/
45
enum pipe_mpeg12_picture_coding_type
46
{
47
PIPE_MPEG12_PICTURE_CODING_TYPE_I = 0x01,
48
PIPE_MPEG12_PICTURE_CODING_TYPE_P = 0x02,
49
PIPE_MPEG12_PICTURE_CODING_TYPE_B = 0x03,
50
PIPE_MPEG12_PICTURE_CODING_TYPE_D = 0x04
51
};
52
53
/*
54
* see table 6-14 in the spec
55
*/
56
enum pipe_mpeg12_picture_structure
57
{
58
PIPE_MPEG12_PICTURE_STRUCTURE_RESERVED = 0x00,
59
PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_TOP = 0x01,
60
PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_BOTTOM = 0x02,
61
PIPE_MPEG12_PICTURE_STRUCTURE_FRAME = 0x03
62
};
63
64
/*
65
* flags for macroblock_type, see section 6.3.17.1 in the spec
66
*/
67
enum pipe_mpeg12_macroblock_type
68
{
69
PIPE_MPEG12_MB_TYPE_QUANT = 0x01,
70
PIPE_MPEG12_MB_TYPE_MOTION_FORWARD = 0x02,
71
PIPE_MPEG12_MB_TYPE_MOTION_BACKWARD = 0x04,
72
PIPE_MPEG12_MB_TYPE_PATTERN = 0x08,
73
PIPE_MPEG12_MB_TYPE_INTRA = 0x10
74
};
75
76
/*
77
* flags for motion_type, see table 6-17 and 6-18 in the spec
78
*/
79
enum pipe_mpeg12_motion_type
80
{
81
PIPE_MPEG12_MO_TYPE_RESERVED = 0x00,
82
PIPE_MPEG12_MO_TYPE_FIELD = 0x01,
83
PIPE_MPEG12_MO_TYPE_FRAME = 0x02,
84
PIPE_MPEG12_MO_TYPE_16x8 = 0x02,
85
PIPE_MPEG12_MO_TYPE_DUAL_PRIME = 0x03
86
};
87
88
/*
89
* see section 6.3.17.1 and table 6-19 in the spec
90
*/
91
enum pipe_mpeg12_dct_type
92
{
93
PIPE_MPEG12_DCT_TYPE_FRAME = 0,
94
PIPE_MPEG12_DCT_TYPE_FIELD = 1
95
};
96
97
enum pipe_mpeg12_field_select
98
{
99
PIPE_MPEG12_FS_FIRST_FORWARD = 0x01,
100
PIPE_MPEG12_FS_FIRST_BACKWARD = 0x02,
101
PIPE_MPEG12_FS_SECOND_FORWARD = 0x04,
102
PIPE_MPEG12_FS_SECOND_BACKWARD = 0x08
103
};
104
105
enum pipe_h264_slice_type
106
{
107
PIPE_H264_SLICE_TYPE_P = 0x0,
108
PIPE_H264_SLICE_TYPE_B = 0x1,
109
PIPE_H264_SLICE_TYPE_I = 0x2,
110
PIPE_H264_SLICE_TYPE_SP = 0x3,
111
PIPE_H264_SLICE_TYPE_SI = 0x4
112
};
113
114
/* Same enum for h264/h265 */
115
enum pipe_h2645_enc_picture_type
116
{
117
PIPE_H2645_ENC_PICTURE_TYPE_P = 0x00,
118
PIPE_H2645_ENC_PICTURE_TYPE_B = 0x01,
119
PIPE_H2645_ENC_PICTURE_TYPE_I = 0x02,
120
PIPE_H2645_ENC_PICTURE_TYPE_IDR = 0x03,
121
PIPE_H2645_ENC_PICTURE_TYPE_SKIP = 0x04
122
};
123
124
enum pipe_h2645_enc_rate_control_method
125
{
126
PIPE_H2645_ENC_RATE_CONTROL_METHOD_DISABLE = 0x00,
127
PIPE_H2645_ENC_RATE_CONTROL_METHOD_CONSTANT_SKIP = 0x01,
128
PIPE_H2645_ENC_RATE_CONTROL_METHOD_VARIABLE_SKIP = 0x02,
129
PIPE_H2645_ENC_RATE_CONTROL_METHOD_CONSTANT = 0x03,
130
PIPE_H2645_ENC_RATE_CONTROL_METHOD_VARIABLE = 0x04
131
};
132
133
struct pipe_picture_desc
134
{
135
enum pipe_video_profile profile;
136
enum pipe_video_entrypoint entry_point;
137
bool protected_playback;
138
uint8_t *decrypt_key;
139
};
140
141
struct pipe_quant_matrix
142
{
143
enum pipe_video_format codec;
144
};
145
146
struct pipe_macroblock
147
{
148
enum pipe_video_format codec;
149
};
150
151
struct pipe_mpeg12_picture_desc
152
{
153
struct pipe_picture_desc base;
154
155
unsigned picture_coding_type;
156
unsigned picture_structure;
157
unsigned frame_pred_frame_dct;
158
unsigned q_scale_type;
159
unsigned alternate_scan;
160
unsigned intra_vlc_format;
161
unsigned concealment_motion_vectors;
162
unsigned intra_dc_precision;
163
unsigned f_code[2][2];
164
unsigned top_field_first;
165
unsigned full_pel_forward_vector;
166
unsigned full_pel_backward_vector;
167
unsigned num_slices;
168
169
const uint8_t *intra_matrix;
170
const uint8_t *non_intra_matrix;
171
172
struct pipe_video_buffer *ref[2];
173
};
174
175
struct pipe_mpeg12_macroblock
176
{
177
struct pipe_macroblock base;
178
179
/* see section 6.3.17 in the spec */
180
unsigned short x, y;
181
182
/* see section 6.3.17.1 in the spec */
183
unsigned char macroblock_type;
184
185
union {
186
struct {
187
/* see table 6-17 in the spec */
188
unsigned int frame_motion_type:2;
189
190
/* see table 6-18 in the spec */
191
unsigned int field_motion_type:2;
192
193
/* see table 6-19 in the spec */
194
unsigned int dct_type:1;
195
} bits;
196
unsigned int value;
197
} macroblock_modes;
198
199
/* see section 6.3.17.2 in the spec */
200
unsigned char motion_vertical_field_select;
201
202
/* see Table 7-7 in the spec */
203
short PMV[2][2][2];
204
205
/* see figure 6.10-12 in the spec */
206
unsigned short coded_block_pattern;
207
208
/* see figure 6.10-12 in the spec */
209
short *blocks;
210
211
/* Number of skipped macroblocks after this macroblock */
212
unsigned short num_skipped_macroblocks;
213
};
214
215
struct pipe_mpeg4_picture_desc
216
{
217
struct pipe_picture_desc base;
218
219
int32_t trd[2];
220
int32_t trb[2];
221
uint16_t vop_time_increment_resolution;
222
uint8_t vop_coding_type;
223
uint8_t vop_fcode_forward;
224
uint8_t vop_fcode_backward;
225
uint8_t resync_marker_disable;
226
uint8_t interlaced;
227
uint8_t quant_type;
228
uint8_t quarter_sample;
229
uint8_t short_video_header;
230
uint8_t rounding_control;
231
uint8_t alternate_vertical_scan_flag;
232
uint8_t top_field_first;
233
234
const uint8_t *intra_matrix;
235
const uint8_t *non_intra_matrix;
236
237
struct pipe_video_buffer *ref[2];
238
};
239
240
struct pipe_vc1_picture_desc
241
{
242
struct pipe_picture_desc base;
243
244
uint32_t slice_count;
245
uint8_t picture_type;
246
uint8_t frame_coding_mode;
247
uint8_t postprocflag;
248
uint8_t pulldown;
249
uint8_t interlace;
250
uint8_t tfcntrflag;
251
uint8_t finterpflag;
252
uint8_t psf;
253
uint8_t dquant;
254
uint8_t panscan_flag;
255
uint8_t refdist_flag;
256
uint8_t quantizer;
257
uint8_t extended_mv;
258
uint8_t extended_dmv;
259
uint8_t overlap;
260
uint8_t vstransform;
261
uint8_t loopfilter;
262
uint8_t fastuvmc;
263
uint8_t range_mapy_flag;
264
uint8_t range_mapy;
265
uint8_t range_mapuv_flag;
266
uint8_t range_mapuv;
267
uint8_t multires;
268
uint8_t syncmarker;
269
uint8_t rangered;
270
uint8_t maxbframes;
271
uint8_t deblockEnable;
272
uint8_t pquant;
273
274
struct pipe_video_buffer *ref[2];
275
};
276
277
struct pipe_h264_sps
278
{
279
uint8_t level_idc;
280
uint8_t chroma_format_idc;
281
uint8_t separate_colour_plane_flag;
282
uint8_t bit_depth_luma_minus8;
283
uint8_t bit_depth_chroma_minus8;
284
uint8_t seq_scaling_matrix_present_flag;
285
uint8_t ScalingList4x4[6][16];
286
uint8_t ScalingList8x8[6][64];
287
uint8_t log2_max_frame_num_minus4;
288
uint8_t pic_order_cnt_type;
289
uint8_t log2_max_pic_order_cnt_lsb_minus4;
290
uint8_t delta_pic_order_always_zero_flag;
291
int32_t offset_for_non_ref_pic;
292
int32_t offset_for_top_to_bottom_field;
293
uint8_t num_ref_frames_in_pic_order_cnt_cycle;
294
int32_t offset_for_ref_frame[256];
295
uint8_t max_num_ref_frames;
296
uint8_t frame_mbs_only_flag;
297
uint8_t mb_adaptive_frame_field_flag;
298
uint8_t direct_8x8_inference_flag;
299
};
300
301
struct pipe_h264_pps
302
{
303
struct pipe_h264_sps *sps;
304
305
uint8_t entropy_coding_mode_flag;
306
uint8_t bottom_field_pic_order_in_frame_present_flag;
307
uint8_t num_slice_groups_minus1;
308
uint8_t slice_group_map_type;
309
uint8_t slice_group_change_rate_minus1;
310
uint8_t num_ref_idx_l0_default_active_minus1;
311
uint8_t num_ref_idx_l1_default_active_minus1;
312
uint8_t weighted_pred_flag;
313
uint8_t weighted_bipred_idc;
314
int8_t pic_init_qp_minus26;
315
int8_t chroma_qp_index_offset;
316
uint8_t deblocking_filter_control_present_flag;
317
uint8_t constrained_intra_pred_flag;
318
uint8_t redundant_pic_cnt_present_flag;
319
uint8_t ScalingList4x4[6][16];
320
uint8_t ScalingList8x8[6][64];
321
uint8_t transform_8x8_mode_flag;
322
int8_t second_chroma_qp_index_offset;
323
};
324
325
struct pipe_h264_picture_desc
326
{
327
struct pipe_picture_desc base;
328
329
struct pipe_h264_pps *pps;
330
331
/* slice header */
332
uint32_t frame_num;
333
uint8_t field_pic_flag;
334
uint8_t bottom_field_flag;
335
uint8_t num_ref_idx_l0_active_minus1;
336
uint8_t num_ref_idx_l1_active_minus1;
337
338
uint32_t slice_count;
339
int32_t field_order_cnt[2];
340
bool is_reference;
341
uint8_t num_ref_frames;
342
343
bool is_long_term[16];
344
bool top_is_reference[16];
345
bool bottom_is_reference[16];
346
uint32_t field_order_cnt_list[16][2];
347
uint32_t frame_num_list[16];
348
349
struct pipe_video_buffer *ref[16];
350
};
351
352
struct pipe_h264_enc_rate_control
353
{
354
enum pipe_h2645_enc_rate_control_method rate_ctrl_method;
355
unsigned target_bitrate;
356
unsigned peak_bitrate;
357
unsigned frame_rate_num;
358
unsigned frame_rate_den;
359
unsigned vbv_buffer_size;
360
unsigned vbv_buf_lv;
361
unsigned target_bits_picture;
362
unsigned peak_bits_picture_integer;
363
unsigned peak_bits_picture_fraction;
364
unsigned fill_data_enable;
365
unsigned enforce_hrd;
366
};
367
368
struct pipe_h264_enc_motion_estimation
369
{
370
unsigned motion_est_quarter_pixel;
371
unsigned enc_disable_sub_mode;
372
unsigned lsmvert;
373
unsigned enc_en_ime_overw_dis_subm;
374
unsigned enc_ime_overw_dis_subm_no;
375
unsigned enc_ime2_search_range_x;
376
unsigned enc_ime2_search_range_y;
377
};
378
379
struct pipe_h264_enc_pic_control
380
{
381
unsigned enc_cabac_enable;
382
unsigned enc_constraint_set_flags;
383
unsigned enc_frame_cropping_flag;
384
unsigned enc_frame_crop_left_offset;
385
unsigned enc_frame_crop_right_offset;
386
unsigned enc_frame_crop_top_offset;
387
unsigned enc_frame_crop_bottom_offset;
388
};
389
390
struct pipe_h264_enc_picture_desc
391
{
392
struct pipe_picture_desc base;
393
394
struct pipe_h264_enc_rate_control rate_ctrl;
395
396
struct pipe_h264_enc_motion_estimation motion_est;
397
struct pipe_h264_enc_pic_control pic_ctrl;
398
399
unsigned quant_i_frames;
400
unsigned quant_p_frames;
401
unsigned quant_b_frames;
402
403
enum pipe_h2645_enc_picture_type picture_type;
404
unsigned frame_num;
405
unsigned frame_num_cnt;
406
unsigned p_remain;
407
unsigned i_remain;
408
unsigned idr_pic_id;
409
unsigned gop_cnt;
410
unsigned pic_order_cnt;
411
unsigned pic_order_cnt_type;
412
unsigned ref_idx_l0;
413
unsigned ref_idx_l1;
414
unsigned gop_size;
415
unsigned ref_pic_mode;
416
417
bool not_referenced;
418
bool enable_vui;
419
struct hash_table *frame_idx;
420
421
};
422
423
struct pipe_h265_enc_seq_param
424
{
425
uint8_t general_profile_idc;
426
uint8_t general_level_idc;
427
uint8_t general_tier_flag;
428
uint32_t intra_period;
429
uint16_t pic_width_in_luma_samples;
430
uint16_t pic_height_in_luma_samples;
431
uint32_t chroma_format_idc;
432
uint32_t bit_depth_luma_minus8;
433
uint32_t bit_depth_chroma_minus8;
434
bool strong_intra_smoothing_enabled_flag;
435
bool amp_enabled_flag;
436
bool sample_adaptive_offset_enabled_flag;
437
bool pcm_enabled_flag;
438
bool sps_temporal_mvp_enabled_flag;
439
uint8_t log2_min_luma_coding_block_size_minus3;
440
uint8_t log2_diff_max_min_luma_coding_block_size;
441
uint8_t log2_min_transform_block_size_minus2;
442
uint8_t log2_diff_max_min_transform_block_size;
443
uint8_t max_transform_hierarchy_depth_inter;
444
uint8_t max_transform_hierarchy_depth_intra;
445
uint8_t conformance_window_flag;
446
uint16_t conf_win_left_offset;
447
uint16_t conf_win_right_offset;
448
uint16_t conf_win_top_offset;
449
uint16_t conf_win_bottom_offset;
450
};
451
452
struct pipe_h265_enc_pic_param
453
{
454
uint8_t log2_parallel_merge_level_minus2;
455
uint8_t nal_unit_type;
456
bool constrained_intra_pred_flag;
457
};
458
459
struct pipe_h265_enc_slice_param
460
{
461
uint8_t max_num_merge_cand;
462
int8_t slice_cb_qp_offset;
463
int8_t slice_cr_qp_offset;
464
int8_t slice_beta_offset_div2;
465
int8_t slice_tc_offset_div2;
466
bool cabac_init_flag;
467
uint32_t slice_deblocking_filter_disabled_flag;
468
bool slice_loop_filter_across_slices_enabled_flag;
469
};
470
471
struct pipe_h265_enc_rate_control
472
{
473
enum pipe_h2645_enc_rate_control_method rate_ctrl_method;
474
unsigned target_bitrate;
475
unsigned peak_bitrate;
476
unsigned frame_rate_num;
477
unsigned frame_rate_den;
478
unsigned quant_i_frames;
479
unsigned vbv_buffer_size;
480
unsigned vbv_buf_lv;
481
unsigned target_bits_picture;
482
unsigned peak_bits_picture_integer;
483
unsigned peak_bits_picture_fraction;
484
unsigned fill_data_enable;
485
unsigned enforce_hrd;
486
};
487
488
struct pipe_h265_enc_picture_desc
489
{
490
struct pipe_picture_desc base;
491
492
struct pipe_h265_enc_seq_param seq;
493
struct pipe_h265_enc_pic_param pic;
494
struct pipe_h265_enc_slice_param slice;
495
struct pipe_h265_enc_rate_control rc;
496
497
enum pipe_h2645_enc_picture_type picture_type;
498
unsigned decoded_curr_pic;
499
unsigned reference_frames[16];
500
unsigned frame_num;
501
unsigned pic_order_cnt;
502
unsigned pic_order_cnt_type;
503
unsigned ref_idx_l0;
504
unsigned ref_idx_l1;
505
bool not_referenced;
506
struct hash_table *frame_idx;
507
};
508
509
struct pipe_h265_sps
510
{
511
uint8_t chroma_format_idc;
512
uint8_t separate_colour_plane_flag;
513
uint32_t pic_width_in_luma_samples;
514
uint32_t pic_height_in_luma_samples;
515
uint8_t bit_depth_luma_minus8;
516
uint8_t bit_depth_chroma_minus8;
517
uint8_t log2_max_pic_order_cnt_lsb_minus4;
518
uint8_t sps_max_dec_pic_buffering_minus1;
519
uint8_t log2_min_luma_coding_block_size_minus3;
520
uint8_t log2_diff_max_min_luma_coding_block_size;
521
uint8_t log2_min_transform_block_size_minus2;
522
uint8_t log2_diff_max_min_transform_block_size;
523
uint8_t max_transform_hierarchy_depth_inter;
524
uint8_t max_transform_hierarchy_depth_intra;
525
uint8_t scaling_list_enabled_flag;
526
uint8_t ScalingList4x4[6][16];
527
uint8_t ScalingList8x8[6][64];
528
uint8_t ScalingList16x16[6][64];
529
uint8_t ScalingList32x32[2][64];
530
uint8_t ScalingListDCCoeff16x16[6];
531
uint8_t ScalingListDCCoeff32x32[2];
532
uint8_t amp_enabled_flag;
533
uint8_t sample_adaptive_offset_enabled_flag;
534
uint8_t pcm_enabled_flag;
535
uint8_t pcm_sample_bit_depth_luma_minus1;
536
uint8_t pcm_sample_bit_depth_chroma_minus1;
537
uint8_t log2_min_pcm_luma_coding_block_size_minus3;
538
uint8_t log2_diff_max_min_pcm_luma_coding_block_size;
539
uint8_t pcm_loop_filter_disabled_flag;
540
uint8_t num_short_term_ref_pic_sets;
541
uint8_t long_term_ref_pics_present_flag;
542
uint8_t num_long_term_ref_pics_sps;
543
uint8_t sps_temporal_mvp_enabled_flag;
544
uint8_t strong_intra_smoothing_enabled_flag;
545
};
546
547
struct pipe_h265_pps
548
{
549
struct pipe_h265_sps *sps;
550
551
uint8_t dependent_slice_segments_enabled_flag;
552
uint8_t output_flag_present_flag;
553
uint8_t num_extra_slice_header_bits;
554
uint8_t sign_data_hiding_enabled_flag;
555
uint8_t cabac_init_present_flag;
556
uint8_t num_ref_idx_l0_default_active_minus1;
557
uint8_t num_ref_idx_l1_default_active_minus1;
558
int8_t init_qp_minus26;
559
uint8_t constrained_intra_pred_flag;
560
uint8_t transform_skip_enabled_flag;
561
uint8_t cu_qp_delta_enabled_flag;
562
uint8_t diff_cu_qp_delta_depth;
563
int8_t pps_cb_qp_offset;
564
int8_t pps_cr_qp_offset;
565
uint8_t pps_slice_chroma_qp_offsets_present_flag;
566
uint8_t weighted_pred_flag;
567
uint8_t weighted_bipred_flag;
568
uint8_t transquant_bypass_enabled_flag;
569
uint8_t tiles_enabled_flag;
570
uint8_t entropy_coding_sync_enabled_flag;
571
uint8_t num_tile_columns_minus1;
572
uint8_t num_tile_rows_minus1;
573
uint8_t uniform_spacing_flag;
574
uint16_t column_width_minus1[20];
575
uint16_t row_height_minus1[22];
576
uint8_t loop_filter_across_tiles_enabled_flag;
577
uint8_t pps_loop_filter_across_slices_enabled_flag;
578
uint8_t deblocking_filter_control_present_flag;
579
uint8_t deblocking_filter_override_enabled_flag;
580
uint8_t pps_deblocking_filter_disabled_flag;
581
int8_t pps_beta_offset_div2;
582
int8_t pps_tc_offset_div2;
583
uint8_t lists_modification_present_flag;
584
uint8_t log2_parallel_merge_level_minus2;
585
uint8_t slice_segment_header_extension_present_flag;
586
uint16_t st_rps_bits;
587
};
588
589
struct pipe_h265_picture_desc
590
{
591
struct pipe_picture_desc base;
592
593
struct pipe_h265_pps *pps;
594
595
uint8_t IDRPicFlag;
596
uint8_t RAPPicFlag;
597
uint8_t CurrRpsIdx;
598
uint32_t NumPocTotalCurr;
599
uint32_t NumDeltaPocsOfRefRpsIdx;
600
uint32_t NumShortTermPictureSliceHeaderBits;
601
uint32_t NumLongTermPictureSliceHeaderBits;
602
603
int32_t CurrPicOrderCntVal;
604
struct pipe_video_buffer *ref[16];
605
int32_t PicOrderCntVal[16];
606
uint8_t IsLongTerm[16];
607
uint8_t NumPocStCurrBefore;
608
uint8_t NumPocStCurrAfter;
609
uint8_t NumPocLtCurr;
610
uint8_t RefPicSetStCurrBefore[8];
611
uint8_t RefPicSetStCurrAfter[8];
612
uint8_t RefPicSetLtCurr[8];
613
uint8_t RefPicList[2][15];
614
bool UseRefPicList;
615
bool UseStRpsBits;
616
};
617
618
struct pipe_mjpeg_picture_desc
619
{
620
struct pipe_picture_desc base;
621
622
struct
623
{
624
uint16_t picture_width;
625
uint16_t picture_height;
626
627
struct {
628
uint8_t component_id;
629
uint8_t h_sampling_factor;
630
uint8_t v_sampling_factor;
631
uint8_t quantiser_table_selector;
632
} components[255];
633
634
uint8_t num_components;
635
} picture_parameter;
636
637
struct
638
{
639
uint8_t load_quantiser_table[4];
640
uint8_t quantiser_table[4][64];
641
} quantization_table;
642
643
struct
644
{
645
uint8_t load_huffman_table[2];
646
647
struct {
648
uint8_t num_dc_codes[16];
649
uint8_t dc_values[12];
650
uint8_t num_ac_codes[16];
651
uint8_t ac_values[162];
652
uint8_t pad[2];
653
} table[2];
654
} huffman_table;
655
656
struct
657
{
658
unsigned slice_data_size;
659
unsigned slice_data_offset;
660
unsigned slice_data_flag;
661
unsigned slice_horizontal_position;
662
unsigned slice_vertical_position;
663
664
struct {
665
uint8_t component_selector;
666
uint8_t dc_table_selector;
667
uint8_t ac_table_selector;
668
} components[4];
669
670
uint8_t num_components;
671
672
uint16_t restart_interval;
673
unsigned num_mcus;
674
} slice_parameter;
675
};
676
677
struct vp9_segment_parameter
678
{
679
struct {
680
uint16_t segment_reference_enabled:1;
681
uint16_t segment_reference:2;
682
uint16_t segment_reference_skipped:1;
683
} segment_flags;
684
685
bool alt_quant_enabled;
686
int16_t alt_quant;
687
688
bool alt_lf_enabled;
689
int16_t alt_lf;
690
691
uint8_t filter_level[4][2];
692
693
int16_t luma_ac_quant_scale;
694
int16_t luma_dc_quant_scale;
695
696
int16_t chroma_ac_quant_scale;
697
int16_t chroma_dc_quant_scale;
698
};
699
700
struct pipe_vp9_picture_desc
701
{
702
struct pipe_picture_desc base;
703
704
struct pipe_video_buffer *ref[16];
705
706
struct {
707
uint16_t frame_width;
708
uint16_t frame_height;
709
710
struct {
711
uint32_t subsampling_x:1;
712
uint32_t subsampling_y:1;
713
uint32_t frame_type:1;
714
uint32_t show_frame:1;
715
uint32_t error_resilient_mode:1;
716
uint32_t intra_only:1;
717
uint32_t allow_high_precision_mv:1;
718
uint32_t mcomp_filter_type:3;
719
uint32_t frame_parallel_decoding_mode:1;
720
uint32_t reset_frame_context:2;
721
uint32_t refresh_frame_context:1;
722
uint32_t frame_context_idx:2;
723
uint32_t segmentation_enabled:1;
724
uint32_t segmentation_temporal_update:1;
725
uint32_t segmentation_update_map:1;
726
uint32_t last_ref_frame:3;
727
uint32_t last_ref_frame_sign_bias:1;
728
uint32_t golden_ref_frame:3;
729
uint32_t golden_ref_frame_sign_bias:1;
730
uint32_t alt_ref_frame:3;
731
uint32_t alt_ref_frame_sign_bias:1;
732
uint32_t lossless_flag:1;
733
} pic_fields;
734
735
uint8_t filter_level;
736
uint8_t sharpness_level;
737
738
uint8_t log2_tile_rows;
739
uint8_t log2_tile_columns;
740
741
uint8_t frame_header_length_in_bytes;
742
743
uint16_t first_partition_size;
744
745
uint8_t mb_segment_tree_probs[7];
746
uint8_t segment_pred_probs[3];
747
748
uint8_t profile;
749
750
uint8_t bit_depth;
751
752
bool mode_ref_delta_enabled;
753
bool mode_ref_delta_update;
754
755
uint8_t base_qindex;
756
int8_t y_dc_delta_q;
757
int8_t uv_ac_delta_q;
758
int8_t uv_dc_delta_q;
759
uint8_t abs_delta;
760
} picture_parameter;
761
762
struct {
763
uint32_t slice_data_size;
764
uint32_t slice_data_offset;
765
766
uint32_t slice_data_flag;
767
768
struct vp9_segment_parameter seg_param[8];
769
} slice_parameter;
770
};
771
772
struct pipe_av1_picture_desc
773
{
774
struct pipe_picture_desc base;
775
776
struct pipe_video_buffer *ref[16];
777
778
struct {
779
uint8_t profile;
780
uint8_t order_hint_bits_minus_1;
781
uint8_t bit_depth_idx;
782
783
struct {
784
uint32_t use_128x128_superblock:1;
785
uint32_t enable_filter_intra:1;
786
uint32_t enable_intra_edge_filter:1;
787
uint32_t enable_interintra_compound:1;
788
uint32_t enable_masked_compound:1;
789
uint32_t enable_dual_filter:1;
790
uint32_t enable_order_hint:1;
791
uint32_t enable_jnt_comp:1;
792
uint32_t mono_chrome:1;
793
uint32_t ref_frame_mvs:1;
794
} seq_info_fields;
795
796
uint32_t current_frame_id;
797
798
uint16_t frame_width;
799
uint16_t frame_height;
800
uint16_t max_width;
801
uint16_t max_height;
802
803
uint8_t ref_frame_idx[7];
804
uint8_t primary_ref_frame;
805
uint8_t order_hint;
806
807
struct {
808
struct {
809
uint32_t enabled:1;
810
uint32_t update_map:1;
811
uint32_t temporal_update:1;
812
} segment_info_fields;
813
814
int16_t feature_data[8][8];
815
uint8_t feature_mask[8];
816
} seg_info;
817
818
struct {
819
struct {
820
uint32_t apply_grain:1;
821
uint32_t chroma_scaling_from_luma:1;
822
uint32_t grain_scaling_minus_8:2;
823
uint32_t ar_coeff_lag:2;
824
uint32_t ar_coeff_shift_minus_6:2;
825
uint32_t grain_scale_shift:2;
826
uint32_t overlap_flag:1;
827
uint32_t clip_to_restricted_range:1;
828
} film_grain_info_fields;
829
830
uint16_t grain_seed;
831
uint8_t num_y_points;
832
uint8_t point_y_value[14];
833
uint8_t point_y_scaling[14];
834
uint8_t num_cb_points;
835
uint8_t point_cb_value[10];
836
uint8_t point_cb_scaling[10];
837
uint8_t num_cr_points;
838
uint8_t point_cr_value[10];
839
uint8_t point_cr_scaling[10];
840
int8_t ar_coeffs_y[24];
841
int8_t ar_coeffs_cb[25];
842
int8_t ar_coeffs_cr[25];
843
uint8_t cb_mult;
844
uint8_t cb_luma_mult;
845
uint16_t cb_offset;
846
uint8_t cr_mult;
847
uint8_t cr_luma_mult;
848
uint16_t cr_offset;
849
} film_grain_info;
850
851
uint8_t tile_cols;
852
uint8_t tile_rows;
853
uint32_t tile_col_start_sb[65];
854
uint32_t tile_row_start_sb[65];
855
uint16_t context_update_tile_id;
856
857
struct {
858
uint32_t frame_type:2;
859
uint32_t show_frame:1;
860
uint32_t error_resilient_mode:1;
861
uint32_t disable_cdf_update:1;
862
uint32_t allow_screen_content_tools:1;
863
uint32_t force_integer_mv:1;
864
uint32_t allow_intrabc:1;
865
uint32_t use_superres:1;
866
uint32_t allow_high_precision_mv:1;
867
uint32_t is_motion_mode_switchable:1;
868
uint32_t use_ref_frame_mvs:1;
869
uint32_t disable_frame_end_update_cdf:1;
870
uint32_t allow_warped_motion:1;
871
} pic_info_fields;
872
873
uint8_t superres_scale_denominator;
874
875
uint8_t interp_filter;
876
uint8_t filter_level[2];
877
uint8_t filter_level_u;
878
uint8_t filter_level_v;
879
struct {
880
uint8_t sharpness_level:3;
881
uint8_t mode_ref_delta_enabled:1;
882
uint8_t mode_ref_delta_update:1;
883
} loop_filter_info_fields;
884
885
int8_t ref_deltas[8];
886
int8_t mode_deltas[2];
887
888
uint8_t base_qindex;
889
int8_t y_dc_delta_q;
890
int8_t u_dc_delta_q;
891
int8_t u_ac_delta_q;
892
int8_t v_dc_delta_q;
893
int8_t v_ac_delta_q;
894
895
struct {
896
uint16_t qm_y:4;
897
uint16_t qm_u:4;
898
uint16_t qm_v:4;
899
} qmatrix_fields;
900
901
struct {
902
uint32_t delta_q_present_flag:1;
903
uint32_t log2_delta_q_res:2;
904
uint32_t delta_lf_present_flag:1;
905
uint32_t log2_delta_lf_res:2;
906
uint32_t delta_lf_multi:1;
907
uint32_t tx_mode:2;
908
uint32_t reference_select:1;
909
uint32_t reduced_tx_set_used:1;
910
uint32_t skip_mode_present:1;
911
} mode_control_fields;
912
913
uint8_t cdef_damping_minus_3;
914
uint8_t cdef_bits;
915
uint8_t cdef_y_strengths[8];
916
uint8_t cdef_uv_strengths[8];
917
918
struct {
919
uint16_t yframe_restoration_type:2;
920
uint16_t cbframe_restoration_type:2;
921
uint16_t crframe_restoration_type:2;
922
} loop_restoration_fields;
923
924
uint16_t lr_unit_size[3];
925
926
struct {
927
uint32_t wmtype;
928
int32_t wmmat[8];
929
} wm[7];
930
931
uint32_t refresh_frame_flags;
932
} picture_parameter;
933
934
struct {
935
uint32_t slice_data_size[256];
936
uint32_t slice_data_offset[256];
937
} slice_parameter;
938
};
939
940
#ifdef __cplusplus
941
}
942
#endif
943
944
#endif /* PIPE_VIDEO_STATE_H */
945
946