vl: add VP9 picture description
[mesa.git] / src / gallium / include / pipe / p_video_state.h
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 enum pipe_h264_enc_picture_type
115 {
116 PIPE_H264_ENC_PICTURE_TYPE_P = 0x00,
117 PIPE_H264_ENC_PICTURE_TYPE_B = 0x01,
118 PIPE_H264_ENC_PICTURE_TYPE_I = 0x02,
119 PIPE_H264_ENC_PICTURE_TYPE_IDR = 0x03,
120 PIPE_H264_ENC_PICTURE_TYPE_SKIP = 0x04
121 };
122
123 enum pipe_h265_enc_picture_type
124 {
125 PIPE_H265_ENC_PICTURE_TYPE_P = 0x00,
126 PIPE_H265_ENC_PICTURE_TYPE_B = 0x01,
127 PIPE_H265_ENC_PICTURE_TYPE_I = 0x02,
128 PIPE_H265_ENC_PICTURE_TYPE_IDR = 0x03,
129 PIPE_H265_ENC_PICTURE_TYPE_SKIP = 0x04
130 };
131
132 enum pipe_h264_enc_rate_control_method
133 {
134 PIPE_H264_ENC_RATE_CONTROL_METHOD_DISABLE = 0x00,
135 PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT_SKIP = 0x01,
136 PIPE_H264_ENC_RATE_CONTROL_METHOD_VARIABLE_SKIP = 0x02,
137 PIPE_H264_ENC_RATE_CONTROL_METHOD_CONSTANT = 0x03,
138 PIPE_H264_ENC_RATE_CONTROL_METHOD_VARIABLE = 0x04
139 };
140
141 enum pipe_h265_enc_rate_control_method
142 {
143 PIPE_H265_ENC_RATE_CONTROL_METHOD_DISABLE = 0x00,
144 PIPE_H265_ENC_RATE_CONTROL_METHOD_CONSTANT_SKIP = 0x01,
145 PIPE_H265_ENC_RATE_CONTROL_METHOD_VARIABLE_SKIP = 0x02,
146 PIPE_H265_ENC_RATE_CONTROL_METHOD_CONSTANT = 0x03,
147 PIPE_H265_ENC_RATE_CONTROL_METHOD_VARIABLE = 0x04
148 };
149
150 struct pipe_picture_desc
151 {
152 enum pipe_video_profile profile;
153 enum pipe_video_entrypoint entry_point;
154 };
155
156 struct pipe_quant_matrix
157 {
158 enum pipe_video_format codec;
159 };
160
161 struct pipe_macroblock
162 {
163 enum pipe_video_format codec;
164 };
165
166 struct pipe_mpeg12_picture_desc
167 {
168 struct pipe_picture_desc base;
169
170 unsigned picture_coding_type;
171 unsigned picture_structure;
172 unsigned frame_pred_frame_dct;
173 unsigned q_scale_type;
174 unsigned alternate_scan;
175 unsigned intra_vlc_format;
176 unsigned concealment_motion_vectors;
177 unsigned intra_dc_precision;
178 unsigned f_code[2][2];
179 unsigned top_field_first;
180 unsigned full_pel_forward_vector;
181 unsigned full_pel_backward_vector;
182 unsigned num_slices;
183
184 const uint8_t *intra_matrix;
185 const uint8_t *non_intra_matrix;
186
187 struct pipe_video_buffer *ref[2];
188 };
189
190 struct pipe_mpeg12_macroblock
191 {
192 struct pipe_macroblock base;
193
194 /* see section 6.3.17 in the spec */
195 unsigned short x, y;
196
197 /* see section 6.3.17.1 in the spec */
198 unsigned char macroblock_type;
199
200 union {
201 struct {
202 /* see table 6-17 in the spec */
203 unsigned int frame_motion_type:2;
204
205 /* see table 6-18 in the spec */
206 unsigned int field_motion_type:2;
207
208 /* see table 6-19 in the spec */
209 unsigned int dct_type:1;
210 } bits;
211 unsigned int value;
212 } macroblock_modes;
213
214 /* see section 6.3.17.2 in the spec */
215 unsigned char motion_vertical_field_select;
216
217 /* see Table 7-7 in the spec */
218 short PMV[2][2][2];
219
220 /* see figure 6.10-12 in the spec */
221 unsigned short coded_block_pattern;
222
223 /* see figure 6.10-12 in the spec */
224 short *blocks;
225
226 /* Number of skipped macroblocks after this macroblock */
227 unsigned short num_skipped_macroblocks;
228 };
229
230 struct pipe_mpeg4_picture_desc
231 {
232 struct pipe_picture_desc base;
233
234 int32_t trd[2];
235 int32_t trb[2];
236 uint16_t vop_time_increment_resolution;
237 uint8_t vop_coding_type;
238 uint8_t vop_fcode_forward;
239 uint8_t vop_fcode_backward;
240 uint8_t resync_marker_disable;
241 uint8_t interlaced;
242 uint8_t quant_type;
243 uint8_t quarter_sample;
244 uint8_t short_video_header;
245 uint8_t rounding_control;
246 uint8_t alternate_vertical_scan_flag;
247 uint8_t top_field_first;
248
249 const uint8_t *intra_matrix;
250 const uint8_t *non_intra_matrix;
251
252 struct pipe_video_buffer *ref[2];
253 };
254
255 struct pipe_vc1_picture_desc
256 {
257 struct pipe_picture_desc base;
258
259 uint32_t slice_count;
260 uint8_t picture_type;
261 uint8_t frame_coding_mode;
262 uint8_t postprocflag;
263 uint8_t pulldown;
264 uint8_t interlace;
265 uint8_t tfcntrflag;
266 uint8_t finterpflag;
267 uint8_t psf;
268 uint8_t dquant;
269 uint8_t panscan_flag;
270 uint8_t refdist_flag;
271 uint8_t quantizer;
272 uint8_t extended_mv;
273 uint8_t extended_dmv;
274 uint8_t overlap;
275 uint8_t vstransform;
276 uint8_t loopfilter;
277 uint8_t fastuvmc;
278 uint8_t range_mapy_flag;
279 uint8_t range_mapy;
280 uint8_t range_mapuv_flag;
281 uint8_t range_mapuv;
282 uint8_t multires;
283 uint8_t syncmarker;
284 uint8_t rangered;
285 uint8_t maxbframes;
286 uint8_t deblockEnable;
287 uint8_t pquant;
288
289 struct pipe_video_buffer *ref[2];
290 };
291
292 struct pipe_h264_sps
293 {
294 uint8_t level_idc;
295 uint8_t chroma_format_idc;
296 uint8_t separate_colour_plane_flag;
297 uint8_t bit_depth_luma_minus8;
298 uint8_t bit_depth_chroma_minus8;
299 uint8_t seq_scaling_matrix_present_flag;
300 uint8_t ScalingList4x4[6][16];
301 uint8_t ScalingList8x8[6][64];
302 uint8_t log2_max_frame_num_minus4;
303 uint8_t pic_order_cnt_type;
304 uint8_t log2_max_pic_order_cnt_lsb_minus4;
305 uint8_t delta_pic_order_always_zero_flag;
306 int32_t offset_for_non_ref_pic;
307 int32_t offset_for_top_to_bottom_field;
308 uint8_t num_ref_frames_in_pic_order_cnt_cycle;
309 int32_t offset_for_ref_frame[256];
310 uint8_t max_num_ref_frames;
311 uint8_t frame_mbs_only_flag;
312 uint8_t mb_adaptive_frame_field_flag;
313 uint8_t direct_8x8_inference_flag;
314 };
315
316 struct pipe_h264_pps
317 {
318 struct pipe_h264_sps *sps;
319
320 uint8_t entropy_coding_mode_flag;
321 uint8_t bottom_field_pic_order_in_frame_present_flag;
322 uint8_t num_slice_groups_minus1;
323 uint8_t slice_group_map_type;
324 uint8_t slice_group_change_rate_minus1;
325 uint8_t num_ref_idx_l0_default_active_minus1;
326 uint8_t num_ref_idx_l1_default_active_minus1;
327 uint8_t weighted_pred_flag;
328 uint8_t weighted_bipred_idc;
329 int8_t pic_init_qp_minus26;
330 int8_t chroma_qp_index_offset;
331 uint8_t deblocking_filter_control_present_flag;
332 uint8_t constrained_intra_pred_flag;
333 uint8_t redundant_pic_cnt_present_flag;
334 uint8_t ScalingList4x4[6][16];
335 uint8_t ScalingList8x8[6][64];
336 uint8_t transform_8x8_mode_flag;
337 int8_t second_chroma_qp_index_offset;
338 };
339
340 struct pipe_h264_picture_desc
341 {
342 struct pipe_picture_desc base;
343
344 struct pipe_h264_pps *pps;
345
346 /* slice header */
347 uint32_t frame_num;
348 uint8_t field_pic_flag;
349 uint8_t bottom_field_flag;
350 uint8_t num_ref_idx_l0_active_minus1;
351 uint8_t num_ref_idx_l1_active_minus1;
352
353 uint32_t slice_count;
354 int32_t field_order_cnt[2];
355 bool is_reference;
356 uint8_t num_ref_frames;
357
358 bool is_long_term[16];
359 bool top_is_reference[16];
360 bool bottom_is_reference[16];
361 uint32_t field_order_cnt_list[16][2];
362 uint32_t frame_num_list[16];
363
364 struct pipe_video_buffer *ref[16];
365 };
366
367 struct pipe_h264_enc_rate_control
368 {
369 enum pipe_h264_enc_rate_control_method rate_ctrl_method;
370 unsigned target_bitrate;
371 unsigned peak_bitrate;
372 unsigned frame_rate_num;
373 unsigned frame_rate_den;
374 unsigned vbv_buffer_size;
375 unsigned vbv_buf_lv;
376 unsigned target_bits_picture;
377 unsigned peak_bits_picture_integer;
378 unsigned peak_bits_picture_fraction;
379 unsigned fill_data_enable;
380 unsigned enforce_hrd;
381 };
382
383 struct pipe_h264_enc_motion_estimation
384 {
385 unsigned motion_est_quarter_pixel;
386 unsigned enc_disable_sub_mode;
387 unsigned lsmvert;
388 unsigned enc_en_ime_overw_dis_subm;
389 unsigned enc_ime_overw_dis_subm_no;
390 unsigned enc_ime2_search_range_x;
391 unsigned enc_ime2_search_range_y;
392 };
393
394 struct pipe_h264_enc_pic_control
395 {
396 unsigned enc_cabac_enable;
397 unsigned enc_constraint_set_flags;
398 };
399
400 struct pipe_h264_enc_picture_desc
401 {
402 struct pipe_picture_desc base;
403
404 struct pipe_h264_enc_rate_control rate_ctrl;
405
406 struct pipe_h264_enc_motion_estimation motion_est;
407 struct pipe_h264_enc_pic_control pic_ctrl;
408
409 unsigned quant_i_frames;
410 unsigned quant_p_frames;
411 unsigned quant_b_frames;
412
413 enum pipe_h264_enc_picture_type picture_type;
414 unsigned frame_num;
415 unsigned frame_num_cnt;
416 unsigned p_remain;
417 unsigned i_remain;
418 unsigned idr_pic_id;
419 unsigned gop_cnt;
420 unsigned pic_order_cnt;
421 unsigned pic_order_cnt_type;
422 unsigned ref_idx_l0;
423 unsigned ref_idx_l1;
424 unsigned gop_size;
425 unsigned ref_pic_mode;
426
427 bool not_referenced;
428 bool enable_vui;
429 struct util_hash_table *frame_idx;
430
431 };
432
433 struct pipe_h265_enc_seq_param
434 {
435 uint8_t general_profile_idc;
436 uint8_t general_level_idc;
437 uint8_t general_tier_flag;
438 uint32_t intra_period;
439 uint16_t pic_width_in_luma_samples;
440 uint16_t pic_height_in_luma_samples;
441 uint32_t chroma_format_idc;
442 uint32_t bit_depth_luma_minus8;
443 uint32_t bit_depth_chroma_minus8;
444 bool strong_intra_smoothing_enabled_flag;
445 bool amp_enabled_flag;
446 bool sample_adaptive_offset_enabled_flag;
447 bool pcm_enabled_flag;
448 bool sps_temporal_mvp_enabled_flag;
449 uint8_t log2_min_luma_coding_block_size_minus3;
450 uint8_t log2_diff_max_min_luma_coding_block_size;
451 uint8_t log2_min_transform_block_size_minus2;
452 uint8_t log2_diff_max_min_transform_block_size;
453 uint8_t max_transform_hierarchy_depth_inter;
454 uint8_t max_transform_hierarchy_depth_intra;
455 };
456
457 struct pipe_h265_enc_pic_param
458 {
459 uint8_t log2_parallel_merge_level_minus2;
460 uint8_t nal_unit_type;
461 bool constrained_intra_pred_flag;
462 };
463
464 struct pipe_h265_enc_slice_param
465 {
466 uint8_t max_num_merge_cand;
467 int8_t slice_cb_qp_offset;
468 int8_t slice_cr_qp_offset;
469 int8_t slice_beta_offset_div2;
470 int8_t slice_tc_offset_div2;
471 bool cabac_init_flag;
472 uint32_t slice_deblocking_filter_disabled_flag;
473 bool slice_loop_filter_across_slices_enabled_flag;
474 };
475
476 struct pipe_h265_enc_rate_control
477 {
478 enum pipe_h265_enc_rate_control_method rate_ctrl_method;
479 unsigned target_bitrate;
480 unsigned peak_bitrate;
481 unsigned frame_rate_num;
482 unsigned frame_rate_den;
483 unsigned quant_i_frames;
484 unsigned vbv_buffer_size;
485 unsigned vbv_buf_lv;
486 unsigned target_bits_picture;
487 unsigned peak_bits_picture_integer;
488 unsigned peak_bits_picture_fraction;
489 unsigned fill_data_enable;
490 unsigned enforce_hrd;
491 };
492
493 struct pipe_h265_enc_picture_desc
494 {
495 struct pipe_picture_desc base;
496
497 struct pipe_h265_enc_seq_param seq;
498 struct pipe_h265_enc_pic_param pic;
499 struct pipe_h265_enc_slice_param slice;
500 struct pipe_h265_enc_rate_control rc;
501
502 enum pipe_h265_enc_picture_type picture_type;
503 unsigned decoded_curr_pic;
504 unsigned reference_frames[16];
505 unsigned frame_num;
506 unsigned pic_order_cnt;
507 unsigned pic_order_cnt_type;
508 unsigned ref_idx_l0;
509 unsigned ref_idx_l1;
510 bool not_referenced;
511 struct util_hash_table *frame_idx;
512 };
513
514 struct pipe_h265_sps
515 {
516 uint8_t chroma_format_idc;
517 uint8_t separate_colour_plane_flag;
518 uint32_t pic_width_in_luma_samples;
519 uint32_t pic_height_in_luma_samples;
520 uint8_t bit_depth_luma_minus8;
521 uint8_t bit_depth_chroma_minus8;
522 uint8_t log2_max_pic_order_cnt_lsb_minus4;
523 uint8_t sps_max_dec_pic_buffering_minus1;
524 uint8_t log2_min_luma_coding_block_size_minus3;
525 uint8_t log2_diff_max_min_luma_coding_block_size;
526 uint8_t log2_min_transform_block_size_minus2;
527 uint8_t log2_diff_max_min_transform_block_size;
528 uint8_t max_transform_hierarchy_depth_inter;
529 uint8_t max_transform_hierarchy_depth_intra;
530 uint8_t scaling_list_enabled_flag;
531 uint8_t ScalingList4x4[6][16];
532 uint8_t ScalingList8x8[6][64];
533 uint8_t ScalingList16x16[6][64];
534 uint8_t ScalingList32x32[2][64];
535 uint8_t ScalingListDCCoeff16x16[6];
536 uint8_t ScalingListDCCoeff32x32[2];
537 uint8_t amp_enabled_flag;
538 uint8_t sample_adaptive_offset_enabled_flag;
539 uint8_t pcm_enabled_flag;
540 uint8_t pcm_sample_bit_depth_luma_minus1;
541 uint8_t pcm_sample_bit_depth_chroma_minus1;
542 uint8_t log2_min_pcm_luma_coding_block_size_minus3;
543 uint8_t log2_diff_max_min_pcm_luma_coding_block_size;
544 uint8_t pcm_loop_filter_disabled_flag;
545 uint8_t num_short_term_ref_pic_sets;
546 uint8_t long_term_ref_pics_present_flag;
547 uint8_t num_long_term_ref_pics_sps;
548 uint8_t sps_temporal_mvp_enabled_flag;
549 uint8_t strong_intra_smoothing_enabled_flag;
550 };
551
552 struct pipe_h265_pps
553 {
554 struct pipe_h265_sps *sps;
555
556 uint8_t dependent_slice_segments_enabled_flag;
557 uint8_t output_flag_present_flag;
558 uint8_t num_extra_slice_header_bits;
559 uint8_t sign_data_hiding_enabled_flag;
560 uint8_t cabac_init_present_flag;
561 uint8_t num_ref_idx_l0_default_active_minus1;
562 uint8_t num_ref_idx_l1_default_active_minus1;
563 int8_t init_qp_minus26;
564 uint8_t constrained_intra_pred_flag;
565 uint8_t transform_skip_enabled_flag;
566 uint8_t cu_qp_delta_enabled_flag;
567 uint8_t diff_cu_qp_delta_depth;
568 int8_t pps_cb_qp_offset;
569 int8_t pps_cr_qp_offset;
570 uint8_t pps_slice_chroma_qp_offsets_present_flag;
571 uint8_t weighted_pred_flag;
572 uint8_t weighted_bipred_flag;
573 uint8_t transquant_bypass_enabled_flag;
574 uint8_t tiles_enabled_flag;
575 uint8_t entropy_coding_sync_enabled_flag;
576 uint8_t num_tile_columns_minus1;
577 uint8_t num_tile_rows_minus1;
578 uint8_t uniform_spacing_flag;
579 uint16_t column_width_minus1[20];
580 uint16_t row_height_minus1[22];
581 uint8_t loop_filter_across_tiles_enabled_flag;
582 uint8_t pps_loop_filter_across_slices_enabled_flag;
583 uint8_t deblocking_filter_control_present_flag;
584 uint8_t deblocking_filter_override_enabled_flag;
585 uint8_t pps_deblocking_filter_disabled_flag;
586 int8_t pps_beta_offset_div2;
587 int8_t pps_tc_offset_div2;
588 uint8_t lists_modification_present_flag;
589 uint8_t log2_parallel_merge_level_minus2;
590 uint8_t slice_segment_header_extension_present_flag;
591 };
592
593 struct pipe_h265_picture_desc
594 {
595 struct pipe_picture_desc base;
596
597 struct pipe_h265_pps *pps;
598
599 uint8_t IDRPicFlag;
600 uint8_t RAPPicFlag;
601 uint8_t CurrRpsIdx;
602 uint32_t NumPocTotalCurr;
603 uint32_t NumDeltaPocsOfRefRpsIdx;
604 uint32_t NumShortTermPictureSliceHeaderBits;
605 uint32_t NumLongTermPictureSliceHeaderBits;
606
607 int32_t CurrPicOrderCntVal;
608 struct pipe_video_buffer *ref[16];
609 int32_t PicOrderCntVal[16];
610 uint8_t IsLongTerm[16];
611 uint8_t NumPocStCurrBefore;
612 uint8_t NumPocStCurrAfter;
613 uint8_t NumPocLtCurr;
614 uint8_t RefPicSetStCurrBefore[8];
615 uint8_t RefPicSetStCurrAfter[8];
616 uint8_t RefPicSetLtCurr[8];
617 uint8_t RefPicList[2][15];
618 bool UseRefPicList;
619 };
620
621 struct pipe_mjpeg_picture_desc
622 {
623 struct pipe_picture_desc base;
624
625 struct
626 {
627 uint16_t picture_width;
628 uint16_t picture_height;
629
630 struct {
631 uint8_t component_id;
632 uint8_t h_sampling_factor;
633 uint8_t v_sampling_factor;
634 uint8_t quantiser_table_selector;
635 } components[255];
636
637 uint8_t num_components;
638 } picture_parameter;
639
640 struct
641 {
642 uint8_t load_quantiser_table[4];
643 uint8_t quantiser_table[4][64];
644 } quantization_table;
645
646 struct
647 {
648 uint8_t load_huffman_table[2];
649
650 struct {
651 uint8_t num_dc_codes[16];
652 uint8_t dc_values[12];
653 uint8_t num_ac_codes[16];
654 uint8_t ac_values[162];
655 uint8_t pad[2];
656 } table[2];
657 } huffman_table;
658
659 struct
660 {
661 unsigned slice_data_size;
662 unsigned slice_data_offset;
663 unsigned slice_data_flag;
664 unsigned slice_horizontal_position;
665 unsigned slice_vertical_position;
666
667 struct {
668 uint8_t component_selector;
669 uint8_t dc_table_selector;
670 uint8_t ac_table_selector;
671 } components[4];
672
673 uint8_t num_components;
674
675 uint16_t restart_interval;
676 unsigned num_mcus;
677 } slice_parameter;
678 };
679
680 struct vp9_segment_parameter
681 {
682 struct {
683 uint16_t segment_reference_enabled:1;
684 uint16_t segment_reference:2;
685 uint16_t segment_reference_skipped:1;
686 } segment_flags;
687
688 bool alt_quant_enabled;
689 int16_t alt_quant;
690
691 bool alt_lf_enabled;
692 int16_t alt_lf;
693
694 uint8_t filter_level[4][2];
695
696 int16_t luma_ac_quant_scale;
697 int16_t luma_dc_quant_scale;
698
699 int16_t chroma_ac_quant_scale;
700 int16_t chroma_dc_quant_scale;
701 };
702
703 struct pipe_vp9_picture_desc
704 {
705 struct pipe_picture_desc base;
706
707 struct pipe_video_buffer *ref[16];
708
709 struct {
710 uint16_t frame_width;
711 uint16_t frame_height;
712
713 struct {
714 uint32_t subsampling_x:1;
715 uint32_t subsampling_y:1;
716 uint32_t frame_type:1;
717 uint32_t show_frame:1;
718 uint32_t error_resilient_mode:1;
719 uint32_t intra_only:1;
720 uint32_t allow_high_precision_mv:1;
721 uint32_t mcomp_filter_type:3;
722 uint32_t frame_parallel_decoding_mode:1;
723 uint32_t reset_frame_context:2;
724 uint32_t refresh_frame_context:1;
725 uint32_t frame_context_idx:2;
726 uint32_t segmentation_enabled:1;
727 uint32_t segmentation_temporal_update:1;
728 uint32_t segmentation_update_map:1;
729 uint32_t last_ref_frame:3;
730 uint32_t last_ref_frame_sign_bias:1;
731 uint32_t golden_ref_frame:3;
732 uint32_t golden_ref_frame_sign_bias:1;
733 uint32_t alt_ref_frame:3;
734 uint32_t alt_ref_frame_sign_bias:1;
735 uint32_t lossless_flag:1;
736 } pic_fields;
737
738 uint8_t filter_level;
739 uint8_t sharpness_level;
740
741 uint8_t log2_tile_rows;
742 uint8_t log2_tile_columns;
743
744 uint8_t frame_header_length_in_bytes;
745
746 uint16_t first_partition_size;
747
748 uint8_t mb_segment_tree_probs[7];
749 uint8_t segment_pred_probs[3];
750
751 uint8_t profile;
752
753 uint8_t bit_depth;
754
755 bool mode_ref_delta_enabled;
756 bool mode_ref_delta_update;
757
758 uint8_t base_qindex;
759 int8_t y_dc_delta_q;
760 int8_t uv_ac_delta_q;
761 int8_t uv_dc_delta_q;
762 } picture_parameter;
763
764 struct {
765 uint32_t slice_data_size;
766 uint32_t slice_data_offset;
767
768 uint32_t slice_data_flag;
769
770 struct vp9_segment_parameter seg_param[8];
771 } slice_parameter;
772 };
773
774 #ifdef __cplusplus
775 }
776 #endif
777
778 #endif /* PIPE_VIDEO_STATE_H */