Update V8 to version 4.7.44.
[chromium-blink-merge.git] / third_party / libva / va / va_enc_hevc.h
blob5cd614b81296bd3a935eef103a7ac2e9ef877d1a
1 /*
2 * Copyright (c) 2007-2014 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
14 * of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 /**
26 * \file va_enc_hevc.h
27 * \brief The HEVC encoding API
29 * This file contains the \ref api_enc_hevc "HEVC encoding API".
33 #ifndef VA_ENC_HEVC_H
34 #define VA_ENC_HEVC_H
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #include <stdint.h>
42 /**
43 * \defgroup api_enc_hevc HEVC encoding API
45 * @{
48 /**
49 * @name Picture flags
51 * Those flags flags are meant to signal when a picture marks the end
52 * of a sequence, a stream, or even both at once.
54 * @{
56 /**
57 * \brief Marks the last picture in the sequence.
59 * i.e. the driver appends \c end_of_seq() NAL unit to the encoded frame.
61 #define HEVC_LAST_PICTURE_EOSEQ 0x01
62 /**
63 * \brief Marks the last picture in the stream.
65 * i.e. the driver appends \c end_of_stream() NAL unit to the encoded frame.
67 #define HEVC_LAST_PICTURE_EOSTREAM 0x02
68 /**@}*/
70 /**
71 * \brief Packed header types specific to HEVC encoding.
73 * Types of packed headers generally used for HEVC encoding. Each
74 * associated packed header data buffer shall contain the start code
75 * prefix 0x000001 followed by the complete NAL unit, thus also
76 * including the \c nal_unit_type.
78 * Note: the start code prefix can contain an arbitrary number of leading
79 * zeros. The driver will skip them for emulation prevention bytes insertion,
80 * if necessary.
82 typedef enum {
83 /**
84 * \brief Packed Video Parameter Set (VPS).
86 * The corresponding packed header data buffer shall contain the
87 * complete video_parameter_set_rbsp() syntax element.
89 * Note: packed \c nal_unit_type shall be equal to 32.
91 VAEncPackedHeaderHEVC_VPS = VAEncPackedHeaderSequence,
92 /**
93 * \brief Packed Sequence Parameter Set (SPS).
95 * The corresponding packed header data buffer shall contain the
96 * complete seq_parameter_set_rbsp() syntax element.
98 * Note: packed \c nal_unit_type shall be equal to 33.
100 VAEncPackedHeaderHEVC_SPS = VAEncPackedHeaderSequence,
102 * \brief Packed Picture Parameter Set (PPS).
104 * The corresponding packed header data buffer shall contain the
105 * complete pic_parameter_set_rbsp() syntax element.
107 * Note: packed \c nal_unit_type shall be equal to 34.
109 VAEncPackedHeaderHEVC_PPS = VAEncPackedHeaderPicture,
111 * \brief Packed slice header.
113 * The corresponding packed header data buffer shall contain the
114 * \c slice_header() syntax element only, along with any start
115 * code prefix and NAL unit type preceeding it. i.e. this means
116 * that the buffer does not contain any of the \c slice_data() or
117 * the \c rbsp_slice_trailing_bits().
119 * Note: packed \c nal_unit_type shall be equal to 0 to 9 (non-IRAP
120 * picture), or 16 to 21 (IRAP picture).
122 VAEncPackedHeaderHEVC_Slice = VAEncPackedHeaderSlice,
124 * \brief Packed Supplemental Enhancement Information (SEI).
126 * The corresponding packed header data buffer shall contain the
127 * complete sei_rbsp() syntax element, thus including several
128 * sei_message() elements if necessary.
130 * Note: packed \c nal_unit_type shall be equal to 39 or 40.
132 VAEncPackedHeaderHEVC_SEI = (VAEncPackedHeaderMiscMask | 1),
133 } VAEncPackedHeaderTypeHEVC;
136 * \brief Sequence parameter for HEVC encoding in main & main 10
137 * profiles.
139 * This structure holds information for \c seq_parameter_set_data() as
140 * defined by the HEVC specification.
142 * If packed sequence headers mode is used, i.e. if the encoding
143 * pipeline was configured with the #VA_ENC_PACKED_HEADER_SEQUENCE
144 * flag, then the driver expects two more buffers to be provided to
145 * the same \c vaRenderPicture() as this buffer:
146 * - a #VAEncPackedHeaderParameterBuffer with type set to
147 * VAEncPackedHeaderType::VAEncPackedHeaderSequence ;
148 * - a #VAEncPackedHeaderDataBuffer which holds the actual packed
149 * header data.
151 * If \c seq_scaling_matrix_present_flag is set to \c 1, then a
152 * #VAQMatrixBufferHEVC buffer shall also be provided within the same
153 * \c vaRenderPicture() call as this sequence parameter buffer.
155 typedef struct _VAEncSequenceParameterBufferHEVC {
156 /** \brief Same as the HEVC bitstream syntax element.
157 * value range [1..2].
159 uint8_t general_profile_idc;
160 /** \brief Same as the HEVC bitstream syntax element.
161 * general_level_idc shall be set equal to a value of 30 times the level
162 * numbers allowed [1, 2, 2.1, 3, 3.1, 4, 4.1, 5, 5.1, 5.2, 6, 6.1, 6.2]
164 uint8_t general_level_idc;
165 /** \brief Same as the HEVC bitstream syntax element.
166 * Only value 0 is allowed for level value below 4, exclusive.
168 uint8_t general_tier_flag;
169 /** \brief Period between I frames. */
170 uint32_t intra_period;
171 /** \brief Period between IDR frames. */
172 uint32_t intra_idr_period;
173 /** \brief Period between I/P frames. */
174 uint32_t ip_period;
176 * \brief Initial bitrate set for this sequence in CBR or VBR modes.
178 * This field represents the initial bitrate value for this
179 * sequence if CBR or VBR mode is used, i.e. if the encoder
180 * pipeline was created with a #VAConfigAttribRateControl
181 * attribute set to either \ref VA_RC_CBR or \ref VA_RC_VBR.
183 * The bitrate can be modified later on through
184 * #VAEncMiscParameterRateControl buffers.
186 uint32_t bits_per_second;
187 /** \brief Picture width in pixel samples.
188 * Its value must be multiple of min CU size.
190 uint16_t pic_width_in_luma_samples;
191 /** \brief Picture height in pixel samples.
192 * Its value must be multiple of min CU size.
194 uint16_t pic_height_in_luma_samples;
196 union {
197 struct {
198 /** \brief Same as the HEVC bitstream syntax element. */
199 uint32_t chroma_format_idc : 2;
200 /** \brief Same as the HEVC bitstream syntax element. */
201 uint32_t separate_colour_plane_flag : 1;
202 /** \brief Same as the HEVC bitstream syntax element. */
203 uint32_t bit_depth_luma_minus8 : 3;
204 /** \brief Same as the HEVC bitstream syntax element. */
205 uint32_t bit_depth_chroma_minus8 : 3;
206 /** \brief Same as the HEVC bitstream syntax element. */
207 uint32_t scaling_list_enabled_flag : 1;
208 /** \brief Same as the HEVC bitstream syntax element. */
209 uint32_t strong_intra_smoothing_enabled_flag : 1;
210 /** \brief Same as the HEVC bitstream syntax element. */
211 uint32_t amp_enabled_flag : 1;
212 /** \brief Same as the HEVC bitstream syntax element. */
213 uint32_t sample_adaptive_offset_enabled_flag : 1;
214 /** \brief Same as the HEVC bitstream syntax element. */
215 uint32_t pcm_enabled_flag : 1;
216 /** \brief Same as the HEVC bitstream syntax element. */
217 uint32_t pcm_loop_filter_disabled_flag : 1;
218 /** \brief Same as the HEVC bitstream syntax element. */
219 uint32_t sps_temporal_mvp_enabled_flag : 1;
221 uint32_t reserved_bits : 16;
222 } bits;
223 uint32_t value;
224 } seq_fields;
226 /** \brief Same as the HEVC bitstream syntax element.
227 * value range [0..3]
229 uint8_t log2_min_luma_coding_block_size_minus3;
231 /** \brief Same as the HEVC bitstream syntax element.
233 uint8_t log2_diff_max_min_luma_coding_block_size;
235 /** \brief Same as the HEVC bitstream syntax element.
236 * value range [0..3]
238 uint8_t log2_min_transform_block_size_minus2;
240 /** \brief Same as the HEVC bitstream syntax element.
242 uint8_t log2_diff_max_min_transform_block_size;
244 /** \brief Same as the HEVC bitstream syntax element.
245 * value range [2]
247 uint8_t max_transform_hierarchy_depth_inter;
249 /** \brief Same as the HEVC bitstream syntax element.
250 * value range [2]
252 uint8_t max_transform_hierarchy_depth_intra;
254 /** \brief Same as the HEVC bitstream syntax element. */
255 uint32_t pcm_sample_bit_depth_luma_minus1;
257 /** \brief Same as the HEVC bitstream syntax element. */
258 uint32_t pcm_sample_bit_depth_chroma_minus1;
260 /** \brief Same as the HEVC bitstream syntax element. */
261 uint32_t log2_min_pcm_luma_coding_block_size_minus3;
263 /** \brief Derived from the HEVC bitstream syntax element.
264 * log2_min_pcm_luma_coding_block_size_minus3 +
265 * log2_diff_max_min_pcm_luma_coding_block_size
267 uint32_t log2_max_pcm_luma_coding_block_size_minus3;
269 /** @name VUI parameters (optional) */
270 /**@{*/
271 /** \brief Same as the HEVC bitstream syntax element. */
272 uint8_t vui_parameters_present_flag;
273 union {
274 struct {
275 /** \brief Same as the HEVC bitstream syntax element. */
276 uint32_t aspect_ratio_info_present_flag : 1;
277 /** \brief Same as the HEVC bitstream syntax element. */
278 uint32_t neutral_chroma_indication_flag : 1;
279 /** \brief Same as the HEVC bitstream syntax element. */
280 uint32_t field_seq_flag : 1;
281 /** \brief Same as the HEVC bitstream syntax element. */
282 uint32_t vui_timing_info_present_flag : 1;
283 /** \brief Same as the HEVC bitstream syntax element. */
284 uint32_t bitstream_restriction_flag : 1;
285 /** \brief Same as the HEVC bitstream syntax element. */
286 uint32_t tiles_fixed_structure_flag : 1;
287 /** \brief Same as the HEVC bitstream syntax element. */
288 uint32_t motion_vectors_over_pic_boundaries_flag : 1;
289 /** \brief Same as the HEVC bitstream syntax element. */
290 uint32_t restricted_ref_pic_lists_flag : 1;
291 /** \brief Range: 0 to 16, inclusive. */
292 uint32_t log2_max_mv_length_horizontal : 5;
293 /** \brief Range: 0 to 16, inclusive. */
294 uint32_t log2_max_mv_length_vertical : 5;
295 } bits;
296 uint32_t value;
297 } vui_fields;
298 /** \brief Same as the HEVC bitstream syntax element. */
299 uint8_t aspect_ratio_idc;
300 /** \brief Same as the HEVC bitstream syntax element. */
301 uint32_t sar_width;
302 /** \brief Same as the HEVC bitstream syntax element. */
303 uint32_t sar_height;
304 /** \brief Same as the HEVC bitstream syntax element. */
305 uint32_t vui_num_units_in_tick;
306 /** \brief Same as the HEVC bitstream syntax element. */
307 uint32_t vui_time_scale;
308 /** \brief Same as the HEVC bitstream syntax element. */
309 uint16_t min_spatial_segmentation_idc;
310 /** \brief Same as the HEVC bitstream syntax element. */
311 uint8_t max_bytes_per_pic_denom;
312 /** \brief Same as the HEVC bitstream syntax element. */
313 uint8_t max_bits_per_min_cu_denom;
314 /**@}*/
315 } VAEncSequenceParameterBufferHEVC;
317 /****************************
318 * HEVC data structures
319 ****************************/
321 * \brief Picture parameter for HEVC encoding in main & main 10
322 * profiles.
324 * This structure holds information for \c pic_parameter_set_rbsp() as
325 * defined by the HEVC specification.
327 * If packed picture headers mode is used, i.e. if the encoding
328 * pipeline was configured with the #VA_ENC_PACKED_HEADER_PICTURE
329 * flag, then the driver expects two more buffers to be provided to
330 * the same \c vaRenderPicture() as this buffer:
331 * - a #VAEncPackedHeaderParameterBuffer with type set to
332 * VAEncPackedHeaderType::VAEncPackedHeaderPicture ;
333 * - a #VAEncPackedHeaderDataBuffer which holds the actual packed
334 * header data.
336 * If \c pic_scaling_matrix_present_flag is set to \c 1, then a
337 * #VAQMatrixBufferHEVC buffer shall also be provided within the same
338 * \c vaRenderPicture() call as this picture parameter buffer.
340 typedef struct _VAEncPictureParameterBufferHEVC {
342 * \brief Information about the picture to be encoded.
344 * See #VAPictureHEVC for further description of each field.
345 * Note that decoded_curr_pic.picture_id represents the reconstructed
346 * (decoded) picture. User provides a scratch VA surface ID here.
347 * Long term reference and RPS related fields should be set to 0
348 * and ignored.
350 VAPictureHEVC decoded_curr_pic;
352 * \brief Decoded Picture Buffer (DPB).
354 * This array represents the list of reconstructed (decoded)
355 * frames used as reference. It is important to keep track of
356 * reconstructed frames so that they can be used later on as
357 * reference for P or B-frames encoding.
359 VAPictureHEVC reference_frames[15];
361 * \brief Output encoded bitstream.
363 * \ref coded_buf has type #VAEncCodedBufferType. It should be
364 * large enough to hold the compressed NAL slice and possibly VPS, SPS
365 * and PPS NAL units, and other NAL units such as SEI.
367 VABufferID coded_buf;
369 /** \brief collocated reference picture buffer index of ReferenceFrames[].
370 * Please note it is different from HEVC syntac element collocated_ref_idx.
371 * When the HEVC syntax element slice_temporal_mvp_enable_flag takes value 0,
372 * collocated_ref_pic_index should take value 0xFF. .
373 * Range: [0..14, 0xFF]
375 uint8_t collocated_ref_pic_index;
378 * \brief OR'd flags describing whether the picture is the last one or not.
380 * This fields holds 0 if the picture to be encoded is not the last
381 * one in the stream or sequence. Otherwise, it is a combination of
382 * \ref HEVC_LAST_PICTURE_EOSEQ or \ref HEVC_LAST_PICTURE_EOSTREAM.
384 uint8_t last_picture;
386 /** \brief \c init_qp_minus26 + 26. */
387 uint8_t pic_init_qp;
389 /** \brief Corresponds to HEVC syntax element of the same name. */
390 uint8_t diff_cu_qp_delta_depth;
392 /** \brief Corresponds to HEVC syntax element of the same name. */
393 int8_t pps_cb_qp_offset;
395 /** \brief Corresponds to HEVC syntax element of the same name. */
396 int8_t pps_cr_qp_offset;
398 /** \brief Corresponds to HEVC syntax element of the same name. */
399 uint8_t num_tile_columns_minus1;
401 /** \brief Corresponds to HEVC syntax element of the same name. */
402 uint8_t num_tile_rows_minus1;
404 /** \brief Corresponds to HEVC syntax element of the same name. */
405 uint8_t column_width_minus1[19];
407 /** \brief Corresponds to HEVC syntax element of the same name. */
408 uint8_t row_height_minus1[21];
410 /** \brief Corresponds to HEVC syntax element of the same name. */
411 uint8_t log2_parallel_merge_level_minus2;
413 /** \brief Application may set the CTU bit size limit based on
414 * spec requirement (A.3.2), or other value for special purpose.
415 * If the value is set 0, no bit size limit is checked.
417 uint8_t ctu_max_bitsize_allowed;
419 /** \brief Maximum reference index for reference picture list 0.
420 * value range: [0..14].
422 uint8_t num_ref_idx_l0_default_active_minus1;
424 /** \brief Maximum reference index for reference picture list 1.
425 * value range: [0..14].
427 uint8_t num_ref_idx_l1_default_active_minus1;
429 /** \brief PPS header
430 * Used by GPU to generate new slice headers in slice size control.
431 * value range: [0..63].
433 uint8_t slice_pic_parameter_set_id;
435 /** \brief NAL unit type
436 * Used by GPU to generate new slice headers in slice size control.
437 * value range: [0..63].
439 uint8_t nal_unit_type;
441 union {
442 struct {
443 /** \brief Is picture an IDR picture? */
444 uint32_t idr_pic_flag : 1;
445 /** \brief Picture type.
446 * I - 1;
447 * P - 2;
448 * B - 3;
449 * B1 - 4;
450 * B2 - 5;
451 * B1 and B2 are frame types for hierachical B, explanation
452 * can refer to num_b_in_gop[].
454 uint32_t coding_type : 3;
455 /** \brief Is picture a reference picture? */
456 uint32_t reference_pic_flag : 1;
457 /** \brief Corresponds to HEVC syntax element of the same name. */
458 uint32_t dependent_slice_segments_enabled_flag : 1;
459 /** \brief Corresponds to HEVC syntax element of the same name. */
460 uint32_t sign_data_hiding_enabled_flag : 1;
461 /** \brief Corresponds to HEVC syntax element of the same name. */
462 uint32_t constrained_intra_pred_flag : 1;
463 /** \brief Corresponds to HEVC syntax element of the same name. */
464 uint32_t transform_skip_enabled_flag : 1;
465 /** \brief Corresponds to HEVC syntax element of the same name. */
466 uint32_t cu_qp_delta_enabled_flag : 1;
467 /** \brief Corresponds to HEVC syntax element of the same name. */
468 uint32_t weighted_pred_flag : 1;
469 /** \brief Corresponds to HEVC syntax element of the same name. */
470 uint32_t weighted_bipred_flag : 1;
471 /** \brief Corresponds to HEVC syntax element of the same name. */
472 uint32_t transquant_bypass_enabled_flag : 1;
473 /** \brief Corresponds to HEVC syntax element of the same name. */
474 uint32_t tiles_enabled_flag : 1;
475 /** \brief Corresponds to HEVC syntax element of the same name. */
476 uint32_t entropy_coding_sync_enabled_flag : 1;
477 /** \brief Corresponds to HEVC syntax element of the same name. */
478 uint32_t loop_filter_across_tiles_enabled_flag : 1;
479 /** \brief Corresponds to HEVC syntax element of the same name. */
480 uint32_t pps_loop_filter_across_slices_enabled_flag : 1;
481 /** \brief A combination of HEVC syntax element of
482 * sps_scaling_list_data_present_flag and
483 * pps_scaling_list_data_present_flag
484 * when scaling_list_enable_flag is 0, it must be 0.
486 uint32_t scaling_list_data_present_flag : 1;
487 /** \brief indicate the current picture contains significant
488 * screen contents (text, characters, etc.) or animated image.
489 * GPU may want to treat them differently from normal video.
490 * For example, encoder may choose a small transform unit size
491 * and may use transform skip mode.
493 uint32_t screen_content_flag : 1;
495 * When either weighted_pred_flag or weighted_bipred_flag is
496 * turned on, the flag enable_gpu_weighted_prediction requests
497 * GPU to determine weighted prediction factors. In this case,
498 * the following parameters in slice control data structure
499 * shall be ignored:
500 * luma_log2_weight_denom, delta_chroma_log2_weight_denom,
501 * luma_offset_l0[15], luma_offset_l1[15],
502 * delta_luma_weight_l0[15], delta_luma_weight_l1[15],
503 * chroma_offset_l0[15][2], chroma_offset_l1[15][2],
504 * and delta_chroma_weight_l0[15][2], delta_chroma_weight_l1[15][2].
506 uint32_t enable_gpu_weighted_prediction : 1;
507 /** \brief HEVC syntax element in slice segment header
508 * GPU uses it to generate new slice headers in slice size control.
510 uint32_t no_output_of_prior_pics_flag : 1;
511 uint32_t reserved : 11;
512 } bits;
513 uint32_t value;
514 } pic_fields;
515 } VAEncPictureParameterBufferHEVC;
518 * \brief Slice parameter for HEVC encoding in main & main 10 profiles.
520 * This structure holds information for \c
521 * slice_segment_layer_rbsp() as defined by the HEVC
522 * specification.
524 * If packed slice headers mode is used, i.e. if the encoding
525 * pipeline was configured with the #VA_ENC_PACKED_HEADER_SLICE
526 * flag, then the driver expects two more buffers to be provided to
527 * the same \c vaRenderPicture() as this buffer:
528 * - a #VAEncPackedHeaderParameterBuffer with type set to
529 * VAEncPackedHeaderType::VAEncPackedHeaderSlice ;
530 * - a #VAEncPackedHeaderDataBuffer which holds the actual packed
531 * header data.
534 typedef struct _VAEncSliceParameterBufferHEVC {
535 /** \brief Starting CTU address for this slice. */
536 uint32_t slice_segment_address;
537 /** \brief Number of CTUs in this slice. */
538 uint32_t num_ctu_in_slice;
540 /** \brief Slice type.
541 * Corresponds to HEVC syntax element of the same name.
543 uint8_t slice_type;
544 /** \brief Same as the HEVC bitstream syntax element. */
545 uint8_t slice_pic_parameter_set_id;
547 /** \brief Maximum reference index for reference picture list 0.
548 * Range: 0 to 14, inclusive.
550 uint8_t num_ref_idx_l0_active_minus1;
551 /** \brief Maximum reference index for reference picture list 1.
552 * Range: 0 to 14, inclusive.
554 uint8_t num_ref_idx_l1_active_minus1;
555 /** \brief Reference picture list 0 (for P slices). */
556 VAPictureHEVC ref_pic_list0[15];
557 /** \brief Reference picture list 1 (for B slices). */
558 VAPictureHEVC ref_pic_list1[15];
559 /**@}*/
561 /** @name pred_weight_table() */
562 /**@{*/
563 /** \brief Same as the HEVC bitstream syntax element. */
564 uint8_t luma_log2_weight_denom;
565 /** \brief Same as the HEVC bitstream syntax element. */
566 int8_t delta_chroma_log2_weight_denom;
567 /** \brief Same as the HEVC bitstream syntax element. */
568 int8_t delta_luma_weight_l0[15];
569 /** \brief Same as the HEVC bitstream syntax element. */
570 int8_t luma_offset_l0[15];
571 /** \brief Same as the HEVC bitstream syntax element. */
572 int8_t delta_chroma_weight_l0[15][2];
573 /** \brief Same as the HEVC spec variable ChromaOffsetL0[]. */
574 int8_t chroma_offset_l0[15][2];
575 /** \brief Same as the HEVC bitstream syntax element. */
576 int8_t delta_luma_weight_l1[15];
577 /** \brief Same as the HEVC bitstream syntax element. */
578 int8_t luma_offset_l1[15];
579 /** \brief Same as the HEVC bitstream syntax element. */
580 int8_t delta_chroma_weight_l1[15][2];
581 /** \brief Same as the HEVC spec variable ChromaOffsetL1[]. */
582 int8_t chroma_offset_l1[15][2];
583 /**@}*/
585 /** \brief Corresponds to HEVC spec variable MaxNumMergeCand.
586 * Range: [1..5].
588 uint8_t max_num_merge_cand;
590 /** \brief Same as the HEVC bitstream syntax element. */
591 int8_t slice_qp_delta;
593 /** \brief Same as the HEVC bitstream syntax element. */
594 int8_t slice_cb_qp_offset;
596 /** \brief Same as the HEVC bitstream syntax element. */
597 int8_t slice_cr_qp_offset;
599 /** \brief Same as the HEVC bitstream syntax element. */
600 int8_t slice_beta_offset_div2;
602 /** \brief Same as the HEVC bitstream syntax element. */
603 int8_t slice_tc_offset_div2;
605 union {
606 struct {
607 /** \brief Indicates if current slice is the last one in picture */
608 uint32_t last_slice_of_pic_flag : 1;
609 /** \brief Corresponds to HEVC syntax element of the same name */
610 uint32_t dependent_slice_segment_flag : 1;
611 /** \brief Corresponds to HEVC syntax element of the same name */
612 uint32_t colour_plane_id : 2;
613 /** \brief Corresponds to HEVC syntax element of the same name. */
614 uint32_t slice_temporal_mvp_enabled_flag : 1;
615 /** \brief Corresponds to HEVC syntax element of the same name. */
616 uint32_t slice_sao_luma_flag : 1;
617 /** \brief Corresponds to HEVC syntax element of the same name. */
618 uint32_t slice_sao_chroma_flag : 1;
619 /** \brief Corresponds to HEVC syntax element of the same name.
620 * if this flag is set to 0, num_ref_idx_l0_active_minus1 should be
621 * equal to num_ref_idx_l0_default_active_minus1
622 * as well as for that for l1.
624 uint32_t num_ref_idx_active_override_flag : 1;
625 /** \brief Corresponds to HEVC syntax element of the same name. */
626 uint32_t mvd_l1_zero_flag : 1;
627 /** \brief Corresponds to HEVC syntax element of the same name. */
628 uint32_t cabac_init_flag : 1;
629 /** \brief Corresponds to HEVC syntax element of the same name. */
630 uint32_t slice_deblocking_filter_disabled_flag : 2;
631 /** \brief Corresponds to HEVC syntax element of the same name. */
632 uint32_t slice_loop_filter_across_slices_enabled_flag : 1;
633 /** \brief Corresponds to HEVC syntax element of the same name. */
634 uint32_t collocated_from_l0_flag : 1;
635 } bits;
636 uint32_t value;
637 } slice_fields;
638 /**@}*/
639 } VAEncSliceParameterBufferHEVC;
642 * \brief HEVC Quantization Matrix Buffer Structure
644 * This structure is sent once per frame,
645 * and only when scaling_list_enabled_flag = 1 and scaling_list_data_present_flag = 1.
646 * Only when scaling_list_data_present_flag = 1, app still
647 * needs to send in this structure. When scaling_list_enabled_flag = 1 and
648 * scaling_list_data_present_flag = 0, driver is responsible to generate
649 * the default scaling list values.
651 * Matrix entries are in raster scan order which follows HEVC spec.
653 typedef struct _VAQMatrixBufferHEVC
656 * \brief scaling lists,
657 * corresponds to same HEVC spec syntax element
658 * ScalingList[ i ][ MatrixID ][ j ].
660 * \brief 4x4 scaling,
662 uint8_t scaling_lists_4x4[3][2][16];
664 * \brief 8x8 scaling,
666 uint8_t scaling_lists_8x8[3][2][64];
668 * \brief 16x16 scaling,
669 * correspongs i = 2, MatrixID is in the range of 0 to 5,
670 * inclusive. And j is in the range of 0 to 63, inclusive.
672 uint8_t scaling_lists_16x16[3][2][64];
674 * \brief 32x32 scaling,
675 * correspongs i = 3, MatrixID is in the range of 0 to 1,
676 * inclusive. And j is in the range of 0 to 63, inclusive.
678 uint8_t scaling_lists_32x32[2][64];
680 * \brief DC values of the 16x16 scaling lists,
681 * corresponds to HEVC spec syntax
682 * scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8
683 * with sizeID = 2 and matrixID in the range of 0 to 5, inclusive.
685 uint8_t scaling_list_dc_16x16[3][2];
687 * \brief DC values of the 32x32 scaling lists,
688 * corresponds to HEVC spec syntax
689 * scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8
690 * with sizeID = 3 and matrixID in the range of 0 to 1, inclusive.
692 uint8_t scaling_list_dc_32x32[2];
693 } VAQMatrixBufferHEVC;
695 /**@}*/
697 #ifdef __cplusplus
699 #endif
701 #endif /* VA_ENC_HEVC_H */