| 1 |
/* |
| 2 |
* Copyright (c) 2014 Intel Corporation. All Rights Reserved. |
| 3 |
* |
| 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: |
| 11 |
* |
| 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. |
| 15 |
* |
| 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. |
| 23 |
*/ |
| 24 |
|
| 25 |
/** |
| 26 |
* \file va_dec_hevc.h |
| 27 |
* \brief The HEVC decoding API |
| 28 |
* |
| 29 |
* This file contains the \ref api_dec_hevc "HEVC decoding API". |
| 30 |
*/ |
| 31 |
|
| 32 |
#ifndef VA_DEC_HEVC_H |
| 33 |
#define VA_DEC_HEVC_H |
| 34 |
|
| 35 |
#include <stdint.h> |
| 36 |
|
| 37 |
#ifdef __cplusplus |
| 38 |
extern "C" { |
| 39 |
#endif |
| 40 |
|
| 41 |
/** |
| 42 |
* \defgroup api_dec_hevc HEVC decoding API |
| 43 |
* |
| 44 |
* This HEVC decoding API supports Main and Main Still Picture profiles. |
| 45 |
* And it supports both short slice format and long slice format. |
| 46 |
* |
| 47 |
* @{ |
| 48 |
*/ |
| 49 |
|
| 50 |
/** |
| 51 |
* \brief HEVC Decoding Picture Parameter Buffer Structure |
| 52 |
* |
| 53 |
* This structure conveys picture level parameters and should be sent once |
| 54 |
* per frame. |
| 55 |
* |
| 56 |
*/ |
| 57 |
typedef struct _VAPictureParameterBufferHEVC { |
| 58 |
/** \brief buffer description of decoded current picture |
| 59 |
* only VA_PICTURE_HEVC_FIELD_PIC and VA_PICTURE_HEVC_BOTTOM_FIELD |
| 60 |
* of "flags" fields are meaningful. |
| 61 |
*/ |
| 62 |
VAPictureHEVC CurrPic; |
| 63 |
/** \brief buffer description of reference frames in DPB */ |
| 64 |
VAPictureHEVC ReferenceFrames[15]; |
| 65 |
/** \brief picture width, shall be integer multiple of minimum CB size. */ |
| 66 |
uint16_t pic_width_in_luma_samples; |
| 67 |
/** \brief picture height, shall be integer multiple of minimum CB size. */ |
| 68 |
uint16_t pic_height_in_luma_samples; |
| 69 |
|
| 70 |
|
| 71 |
union { |
| 72 |
struct { |
| 73 |
/** following flags have same syntax and semantic as those in HEVC spec */ |
| 74 |
uint32_t chroma_format_idc : 2; |
| 75 |
uint32_t separate_colour_plane_flag : 1; |
| 76 |
uint32_t pcm_enabled_flag : 1; |
| 77 |
uint32_t scaling_list_enabled_flag : 1; |
| 78 |
uint32_t transform_skip_enabled_flag : 1; |
| 79 |
uint32_t amp_enabled_flag : 1; |
| 80 |
uint32_t strong_intra_smoothing_enabled_flag : 1; |
| 81 |
uint32_t sign_data_hiding_enabled_flag : 1; |
| 82 |
uint32_t constrained_intra_pred_flag : 1; |
| 83 |
uint32_t cu_qp_delta_enabled_flag : 1; |
| 84 |
uint32_t weighted_pred_flag : 1; |
| 85 |
uint32_t weighted_bipred_flag : 1; |
| 86 |
uint32_t transquant_bypass_enabled_flag : 1; |
| 87 |
uint32_t tiles_enabled_flag : 1; |
| 88 |
uint32_t entropy_coding_sync_enabled_flag : 1; |
| 89 |
uint32_t pps_loop_filter_across_slices_enabled_flag : 1; |
| 90 |
uint32_t loop_filter_across_tiles_enabled_flag : 1; |
| 91 |
uint32_t pcm_loop_filter_disabled_flag : 1; |
| 92 |
/** set based on sps_max_num_reorder_pics of current temporal layer. */ |
| 93 |
uint32_t NoPicReorderingFlag : 1; |
| 94 |
/** picture has no B slices */ |
| 95 |
uint32_t NoBiPredFlag : 1; |
| 96 |
|
| 97 |
uint32_t ReservedBits : 11; |
| 98 |
} bits; |
| 99 |
uint32_t value; |
| 100 |
} pic_fields; |
| 101 |
|
| 102 |
/** following parameters have same syntax with those in HEVC spec */ |
| 103 |
/** \brief DPB size for current temporal layer */ |
| 104 |
uint8_t sps_max_dec_pic_buffering_minus1; |
| 105 |
uint8_t bit_depth_luma_minus8; |
| 106 |
uint8_t bit_depth_chroma_minus8; |
| 107 |
uint8_t pcm_sample_bit_depth_luma_minus1; |
| 108 |
uint8_t pcm_sample_bit_depth_chroma_minus1; |
| 109 |
uint8_t log2_min_luma_coding_block_size_minus3; |
| 110 |
uint8_t log2_diff_max_min_luma_coding_block_size; |
| 111 |
uint8_t log2_min_transform_block_size_minus2; |
| 112 |
uint8_t log2_diff_max_min_transform_block_size; |
| 113 |
uint8_t log2_min_pcm_luma_coding_block_size_minus3; |
| 114 |
uint8_t log2_diff_max_min_pcm_luma_coding_block_size; |
| 115 |
uint8_t max_transform_hierarchy_depth_intra; |
| 116 |
uint8_t max_transform_hierarchy_depth_inter; |
| 117 |
int8_t init_qp_minus26; |
| 118 |
uint8_t diff_cu_qp_delta_depth; |
| 119 |
int8_t pps_cb_qp_offset; |
| 120 |
int8_t pps_cr_qp_offset; |
| 121 |
uint8_t log2_parallel_merge_level_minus2; |
| 122 |
uint8_t num_tile_columns_minus1; |
| 123 |
uint8_t num_tile_rows_minus1; |
| 124 |
/** |
| 125 |
* when uniform_spacing_flag equals 1, application should populate |
| 126 |
* column_width_minus[], and row_height_minus1[] with approperiate values. |
| 127 |
*/ |
| 128 |
uint16_t column_width_minus1[19]; |
| 129 |
uint16_t row_height_minus1[21]; |
| 130 |
|
| 131 |
/** |
| 132 |
* The Following Parameters are needed for Short Slice Format Only. |
| 133 |
* Only format decoding can ignore them. |
| 134 |
*/ |
| 135 |
|
| 136 |
/** |
| 137 |
* \brief Parameters needed for parsing slice segment headers |
| 138 |
*/ |
| 139 |
union { |
| 140 |
struct { |
| 141 |
/** following parameters have same syntax with those in HEVC spec */ |
| 142 |
uint32_t lists_modification_present_flag : 1; |
| 143 |
uint32_t long_term_ref_pics_present_flag : 1; |
| 144 |
uint32_t sps_temporal_mvp_enabled_flag : 1; |
| 145 |
uint32_t cabac_init_present_flag : 1; |
| 146 |
uint32_t output_flag_present_flag : 1; |
| 147 |
uint32_t dependent_slice_segments_enabled_flag : 1; |
| 148 |
uint32_t pps_slice_chroma_qp_offsets_present_flag : 1; |
| 149 |
uint32_t sample_adaptive_offset_enabled_flag : 1; |
| 150 |
uint32_t deblocking_filter_override_enabled_flag : 1; |
| 151 |
uint32_t pps_disable_deblocking_filter_flag : 1; |
| 152 |
uint32_t slice_segment_header_extension_present_flag : 1; |
| 153 |
|
| 154 |
/** current picture with NUT between 16 and 21 inclusive */ |
| 155 |
uint32_t RapPicFlag : 1; |
| 156 |
/** current picture with NUT between 19 and 20 inclusive */ |
| 157 |
uint32_t IdrPicFlag : 1; |
| 158 |
/** current picture has only intra slices */ |
| 159 |
uint32_t IntraPicFlag : 1; |
| 160 |
|
| 161 |
uint32_t ReservedBits : 18; |
| 162 |
} bits; |
| 163 |
uint32_t value; |
| 164 |
} slice_parsing_fields; |
| 165 |
|
| 166 |
/** following parameters have same syntax with those in HEVC spec */ |
| 167 |
uint8_t log2_max_pic_order_cnt_lsb_minus4; |
| 168 |
uint8_t num_short_term_ref_pic_sets; |
| 169 |
uint8_t num_long_term_ref_pic_sps; |
| 170 |
uint8_t num_ref_idx_l0_default_active_minus1; |
| 171 |
uint8_t num_ref_idx_l1_default_active_minus1; |
| 172 |
int8_t pps_beta_offset_div2; |
| 173 |
int8_t pps_tc_offset_div2; |
| 174 |
uint8_t num_extra_slice_header_bits; |
| 175 |
|
| 176 |
/** |
| 177 |
* \brief number of bits that structure |
| 178 |
* short_term_ref_pic_set( num_short_term_ref_pic_sets ) takes in slice |
| 179 |
* segment header when short_term_ref_pic_set_sps_flag equals 0. |
| 180 |
* if short_term_ref_pic_set_sps_flag equals 1, the value should be 0. |
| 181 |
* the bit count is calculated after emulation prevention bytes are removed |
| 182 |
* from bit streams. |
| 183 |
* This variable is used for accelorater to skip parsing the |
| 184 |
* short_term_ref_pic_set( num_short_term_ref_pic_sets ) structure. |
| 185 |
*/ |
| 186 |
uint32_t st_rps_bits; |
| 187 |
|
| 188 |
/** \brief Reserved bytes for future use, must be zero */ |
| 189 |
uint32_t va_reserved[VA_PADDING_MEDIUM]; |
| 190 |
} VAPictureParameterBufferHEVC; |
| 191 |
|
| 192 |
/** |
| 193 |
* \brief HEVC Decoding Picture Parameter Buffer Structure for Range Extension |
| 194 |
* |
| 195 |
* This structure conveys picture level HEVC Range Extension parameters |
| 196 |
* and should be sent once per frame. This data structure should be sent |
| 197 |
* together with VAPictureParameterBufferHEVC in a single buffer of |
| 198 |
* \ref VAPictureParameterBufferHEVCExtension since each frame |
| 199 |
* of HEVC range extension contains both picture level parameters and picture |
| 200 |
* level range extension parameters. They should be parsed together. The buffer |
| 201 |
* type is same as \ref VAPictureParameterBufferHEVC. |
| 202 |
* |
| 203 |
*/ |
| 204 |
typedef struct _VAPictureParameterBufferHEVCRext { |
| 205 |
union { |
| 206 |
struct { |
| 207 |
/** \brief HEVC range extension flags |
| 208 |
* The following flags bears the same syntax and semantics as |
| 209 |
* those defined in HEVC bit stream spec. |
| 210 |
*/ |
| 211 |
uint32_t transform_skip_rotation_enabled_flag : 1; |
| 212 |
uint32_t transform_skip_context_enabled_flag : 1; |
| 213 |
uint32_t implicit_rdpcm_enabled_flag : 1; |
| 214 |
uint32_t explicit_rdpcm_enabled_flag : 1; |
| 215 |
uint32_t extended_precision_processing_flag : 1; |
| 216 |
uint32_t intra_smoothing_disabled_flag : 1; |
| 217 |
uint32_t high_precision_offsets_enabled_flag : 1; |
| 218 |
uint32_t persistent_rice_adaptation_enabled_flag : 1; |
| 219 |
uint32_t cabac_bypass_alignment_enabled_flag : 1; |
| 220 |
uint32_t cross_component_prediction_enabled_flag : 1; |
| 221 |
uint32_t chroma_qp_offset_list_enabled_flag : 1; |
| 222 |
|
| 223 |
/** \brief Reserved bytes for future use, must be zero */ |
| 224 |
uint32_t reserved : 21; |
| 225 |
} bits; |
| 226 |
uint32_t value; |
| 227 |
} range_extension_pic_fields; |
| 228 |
|
| 229 |
/** \brief HEVC range extension flags |
| 230 |
* The following flags bears the same syntax and semantics as |
| 231 |
* those defined in HEVC bit stream spec. |
| 232 |
*/ |
| 233 |
uint8_t diff_cu_chroma_qp_offset_depth; |
| 234 |
uint8_t chroma_qp_offset_list_len_minus1; |
| 235 |
uint8_t log2_sao_offset_scale_luma; |
| 236 |
uint8_t log2_sao_offset_scale_chroma; |
| 237 |
uint8_t log2_max_transform_skip_block_size_minus2; |
| 238 |
int8_t cb_qp_offset_list[6]; |
| 239 |
int8_t cr_qp_offset_list[6]; |
| 240 |
} VAPictureParameterBufferHEVCRext; |
| 241 |
|
| 242 |
/** |
| 243 |
*\brief HEVC Decoding Picture Parameter Buffer Structure for |
| 244 |
*Screen Content extension |
| 245 |
* |
| 246 |
*This structure conveys picture level HEVC Scc parameters |
| 247 |
*and should be sent once per frame. This data structure should be sent |
| 248 |
*together with VAPictureParameterBufferHEVC and VAPictureParameterBufferHEVCRext |
| 249 |
*in a single buffer of \ref VAPictureParameterBufferHEVCExtension since each |
| 250 |
*frame of HEVC SCC contains picture level parameters, picture level range |
| 251 |
*extension parameters and picture level Scc parameters. They should be parsed |
| 252 |
*together and the buffer type is same as \ref VAPictureParameterBufferHEVC. |
| 253 |
* |
| 254 |
*/ |
| 255 |
typedef struct _VAPictureParameterBufferHEVCScc { |
| 256 |
union { |
| 257 |
struct { |
| 258 |
/** \brief HEVC Scc extension flags |
| 259 |
* The following flags bears the same syntax and semantics as |
| 260 |
* those defined in HEVC bit stream spec. |
| 261 |
*/ |
| 262 |
/* indicates if intra block copy (IBC) is enabled or not. */ |
| 263 |
uint32_t pps_curr_pic_ref_enabled_flag : 1; |
| 264 |
/* indicates if Palette Mode is enabled or not. */ |
| 265 |
uint32_t palette_mode_enabled_flag : 1; |
| 266 |
/* controls the presence and inference of the use_integer_mv_flag syntax |
| 267 |
* in slice segment header that specifies the resolution of motion |
| 268 |
* vectors for inter prediction. |
| 269 |
*/ |
| 270 |
uint32_t motion_vector_resolution_control_idc : 2; |
| 271 |
/* specifies that the intra boundary filtering process is |
| 272 |
* disabled or not for intra prediction. |
| 273 |
*/ |
| 274 |
uint32_t intra_boundary_filtering_disabled_flag : 1; |
| 275 |
/* specifies that an adaptive colour transform may be applied |
| 276 |
* to the residual in the decoding process. |
| 277 |
*/ |
| 278 |
uint32_t residual_adaptive_colour_transform_enabled_flag : 1; |
| 279 |
|
| 280 |
/* specifies that slice_act_y_qp_offset, slice_act_cb_qp_offset, |
| 281 |
* slice_act_cr_qp_offset are present in the slice header |
| 282 |
*/ |
| 283 |
uint32_t pps_slice_act_qp_offsets_present_flag : 1; |
| 284 |
|
| 285 |
/** \brief Reserved bytes for future use, must be zero */ |
| 286 |
uint32_t reserved : 25; |
| 287 |
} bits; |
| 288 |
uint32_t value; |
| 289 |
} screen_content_pic_fields; |
| 290 |
|
| 291 |
/* specifies the maximum allowed palette size. */ |
| 292 |
uint8_t palette_max_size; |
| 293 |
/* Correspond to HEVC syntax elements of the same names. |
| 294 |
* It specifies the difference between the maximum allowed palette |
| 295 |
* predictor size and the maximum allowed palette size. |
| 296 |
* App needs to enforce that the variable PaletteMaxPredictorSize, |
| 297 |
* which is derived as follows: |
| 298 |
* PaletteMaxPredictorSize = palette_max_size + delta_palette_max_predictor_size |
| 299 |
* should have a value range of [0..128]. |
| 300 |
*/ |
| 301 |
uint8_t delta_palette_max_predictor_size; |
| 302 |
/** \brief Size of initial palette predictor. |
| 303 |
* It is derived from pps_num_palette_predictor_initializer or |
| 304 |
* sps_num_palette_predictor_initializer_minus1. |
| 305 |
* Details in HEVC SCC spec section 9.3.2.3. |
| 306 |
*/ |
| 307 |
uint8_t predictor_palette_size; |
| 308 |
/** \brief Palette predictor initializer. |
| 309 |
* It is derived from pps_palette_predictor_initializers[][] |
| 310 |
* or sps_palette_predictor_initializers[][]. |
| 311 |
* Details in HEVC SCC spec section 9.3.2.3. |
| 312 |
*/ |
| 313 |
uint16_t predictor_palette_entries[3][128]; |
| 314 |
/* are used to determine the offsets that are applied to the |
| 315 |
* quantization parameter values for the luma, Cb and Cr |
| 316 |
* components, respectively. |
| 317 |
*/ |
| 318 |
int8_t pps_act_y_qp_offset_plus5; |
| 319 |
int8_t pps_act_cb_qp_offset_plus5; |
| 320 |
int8_t pps_act_cr_qp_offset_plus3; |
| 321 |
} VAPictureParameterBufferHEVCScc; |
| 322 |
|
| 323 |
/** |
| 324 |
* \brief HEVC Decoding Picture Parameter Buffer Structure including Extensions |
| 325 |
* |
| 326 |
* This structure conveys picture level HEVC parameters including basic version 1 |
| 327 |
* and range extension and screen content extension. |
| 328 |
* The data buffer should be sent once per frame. |
| 329 |
* |
| 330 |
*/ |
| 331 |
typedef struct _VAPictureParameterBufferHEVCExtension { |
| 332 |
/** \brief basic HEVC picture parameters data structure |
| 333 |
*/ |
| 334 |
VAPictureParameterBufferHEVC base; |
| 335 |
|
| 336 |
/** \brief HEVC range extension picture parameters data structure |
| 337 |
*/ |
| 338 |
VAPictureParameterBufferHEVCRext rext; |
| 339 |
|
| 340 |
/** \brief HEVC screen content picture parameters data structure |
| 341 |
*/ |
| 342 |
VAPictureParameterBufferHEVCScc scc; |
| 343 |
} VAPictureParameterBufferHEVCExtension; |
| 344 |
|
| 345 |
/** |
| 346 |
* \brief HEVC Slice Parameter Buffer Structure For Long Format |
| 347 |
* |
| 348 |
* VASliceParameterBufferHEVC structure should be accompanied by a |
| 349 |
* slice data buffer, which holds the whole raw slice NAL unit bit streams |
| 350 |
* including start code prefix and emulation prevention bytes not removed. |
| 351 |
* |
| 352 |
* This structure conveys parameters related to slice segment header and should |
| 353 |
* be sent once per slice. |
| 354 |
* |
| 355 |
* For short format, this data structure is not sent by application. |
| 356 |
* |
| 357 |
*/ |
| 358 |
typedef struct _VASliceParameterBufferHEVC { |
| 359 |
/** @name Codec-independent Slice Parameter Buffer base. */ |
| 360 |
|
| 361 |
/**@{*/ |
| 362 |
|
| 363 |
/** \brief Number of bytes in the slice data buffer for this slice |
| 364 |
* counting from and including NAL unit header. |
| 365 |
*/ |
| 366 |
uint32_t slice_data_size; |
| 367 |
/** \brief The offset to the NAL unit header for this slice */ |
| 368 |
uint32_t slice_data_offset; |
| 369 |
/** \brief Slice data buffer flags. See \c VA_SLICE_DATA_FLAG_XXX. */ |
| 370 |
uint32_t slice_data_flag; |
| 371 |
/** |
| 372 |
* \brief Byte offset from NAL unit header to the begining of slice_data(). |
| 373 |
* |
| 374 |
* This byte offset is relative to and includes the NAL unit header |
| 375 |
* and represents the number of bytes parsed in the slice_header() |
| 376 |
* after the removal of any emulation prevention bytes in |
| 377 |
* there. However, the slice data buffer passed to the hardware is |
| 378 |
* the original bitstream, thus including any emulation prevention |
| 379 |
* bytes. |
| 380 |
*/ |
| 381 |
uint32_t slice_data_byte_offset; |
| 382 |
/** HEVC syntax element. */ |
| 383 |
uint32_t slice_segment_address; |
| 384 |
/** \brief index into ReferenceFrames[] |
| 385 |
* RefPicList[0][] corresponds to RefPicList0[] of HEVC variable. |
| 386 |
* RefPicList[1][] corresponds to RefPicList1[] of HEVC variable. |
| 387 |
* value range [0..14, 0xFF], where 0xFF indicates invalid entry. |
| 388 |
*/ |
| 389 |
uint8_t RefPicList[2][15]; |
| 390 |
union { |
| 391 |
uint32_t value; |
| 392 |
struct { |
| 393 |
/** current slice is last slice of picture. */ |
| 394 |
uint32_t LastSliceOfPic : 1; |
| 395 |
/** HEVC syntax element. */ |
| 396 |
uint32_t dependent_slice_segment_flag : 1; |
| 397 |
/** HEVC syntax element. */ |
| 398 |
uint32_t slice_type : 2; |
| 399 |
/** HEVC syntax element. */ |
| 400 |
uint32_t color_plane_id : 2; |
| 401 |
/** HEVC syntax element. */ |
| 402 |
uint32_t slice_sao_luma_flag : 1; |
| 403 |
/** HEVC syntax element. */ |
| 404 |
uint32_t slice_sao_chroma_flag : 1; |
| 405 |
/** HEVC syntax element. */ |
| 406 |
uint32_t mvd_l1_zero_flag : 1; |
| 407 |
/** HEVC syntax element. */ |
| 408 |
uint32_t cabac_init_flag : 1; |
| 409 |
/** HEVC syntax element. */ |
| 410 |
uint32_t slice_temporal_mvp_enabled_flag : 1; |
| 411 |
/** HEVC syntax element. */ |
| 412 |
uint32_t slice_deblocking_filter_disabled_flag : 1; |
| 413 |
/** HEVC syntax element. */ |
| 414 |
uint32_t collocated_from_l0_flag : 1; |
| 415 |
/** HEVC syntax element. */ |
| 416 |
uint32_t slice_loop_filter_across_slices_enabled_flag : 1; |
| 417 |
uint32_t reserved : 18; |
| 418 |
} fields; |
| 419 |
} LongSliceFlags; |
| 420 |
|
| 421 |
/** HEVC syntax element. Collocated Reference Picture Index. |
| 422 |
* index to RefPicList[0][] or RefPicList[1][]. |
| 423 |
* when slice_temporal_mvp_enabled_flag equals 0, it should take value 0xFF. |
| 424 |
* value range [0..14, 0xFF]. |
| 425 |
*/ |
| 426 |
uint8_t collocated_ref_idx; |
| 427 |
/** HEVC syntax element. |
| 428 |
* if num_ref_idx_active_override_flag equals 0, host decoder should |
| 429 |
* set its value to num_ref_idx_l0_default_active_minus1. |
| 430 |
*/ |
| 431 |
uint8_t num_ref_idx_l0_active_minus1; |
| 432 |
/** HEVC syntax element. |
| 433 |
* if num_ref_idx_active_override_flag equals 0, host decoder should |
| 434 |
* set its value to num_ref_idx_l1_default_active_minus1. |
| 435 |
*/ |
| 436 |
uint8_t num_ref_idx_l1_active_minus1; |
| 437 |
/** HEVC syntax element. */ |
| 438 |
int8_t slice_qp_delta; |
| 439 |
/** HEVC syntax element. */ |
| 440 |
int8_t slice_cb_qp_offset; |
| 441 |
/** HEVC syntax element. */ |
| 442 |
int8_t slice_cr_qp_offset; |
| 443 |
/** HEVC syntax element. */ |
| 444 |
int8_t slice_beta_offset_div2; |
| 445 |
/** HEVC syntax element. */ |
| 446 |
int8_t slice_tc_offset_div2; |
| 447 |
/** HEVC syntax element. */ |
| 448 |
uint8_t luma_log2_weight_denom; |
| 449 |
/** HEVC syntax element. */ |
| 450 |
int8_t delta_chroma_log2_weight_denom; |
| 451 |
/** HEVC syntax element. */ |
| 452 |
int8_t delta_luma_weight_l0[15]; |
| 453 |
/** HEVC syntax element. */ |
| 454 |
int8_t luma_offset_l0[15]; |
| 455 |
/** HEVC syntax element. */ |
| 456 |
int8_t delta_chroma_weight_l0[15][2]; |
| 457 |
/** corresponds to HEVC spec variable of the same name. */ |
| 458 |
int8_t ChromaOffsetL0[15][2]; |
| 459 |
/** HEVC syntax element. */ |
| 460 |
int8_t delta_luma_weight_l1[15]; |
| 461 |
/** HEVC syntax element. */ |
| 462 |
int8_t luma_offset_l1[15]; |
| 463 |
/** HEVC syntax element. */ |
| 464 |
int8_t delta_chroma_weight_l1[15][2]; |
| 465 |
/** corresponds to HEVC spec variable of the same name. */ |
| 466 |
int8_t ChromaOffsetL1[15][2]; |
| 467 |
/** HEVC syntax element. */ |
| 468 |
uint8_t five_minus_max_num_merge_cand; |
| 469 |
/** HEVC syntax element. */ |
| 470 |
uint16_t num_entry_point_offsets; |
| 471 |
/** HEVC syntax element. */ |
| 472 |
uint16_t entry_offset_to_subset_array; |
| 473 |
/** \brief Number of emulation prevention bytes in slice header. */ |
| 474 |
uint16_t slice_data_num_emu_prevn_bytes; |
| 475 |
/**@}*/ |
| 476 |
|
| 477 |
/** \brief Reserved bytes for future use, must be zero */ |
| 478 |
uint32_t va_reserved[VA_PADDING_LOW - 2]; |
| 479 |
} VASliceParameterBufferHEVC; |
| 480 |
|
| 481 |
/** |
| 482 |
* \brief HEVC Extented Slice Parameter Buffer Structure For Long Format |
| 483 |
* |
| 484 |
* This data structure contains extension profiles (range extension and screen content). |
| 485 |
* |
| 486 |
* VASliceParameterBufferHEVCRext structure should be accompanied by a |
| 487 |
* slice data buffer, which holds the whole raw slice NAL unit bit streams |
| 488 |
* including start code prefix and emulation prevention bytes not removed. |
| 489 |
* |
| 490 |
* This structure conveys parameters related to slice segment header and should |
| 491 |
* be sent once per slice with VASliceParameterBufferHEVC in a single buffer of |
| 492 |
* \ref VASliceParameterBufferHEVCExtension and the buffer type is same as \ref |
| 493 |
* VASliceParameterBufferHEVC. |
| 494 |
* |
| 495 |
* For short format, this data structure is not sent by application. |
| 496 |
* |
| 497 |
*/ |
| 498 |
typedef struct _VASliceParameterBufferHEVCRext { |
| 499 |
/* below four parameters are used to replace data types of the |
| 500 |
* corresponding parameters of those in \# VASliceParameterBufferHEVC. |
| 501 |
*/ |
| 502 |
int16_t luma_offset_l0[15]; |
| 503 |
int16_t ChromaOffsetL0[15][2]; |
| 504 |
int16_t luma_offset_l1[15]; |
| 505 |
int16_t ChromaOffsetL1[15][2]; |
| 506 |
|
| 507 |
union { |
| 508 |
struct { |
| 509 |
uint32_t cu_chroma_qp_offset_enabled_flag : 1; |
| 510 |
uint32_t use_integer_mv_flag : 1; |
| 511 |
/** \brief Reserved bytes for future use, must be zero */ |
| 512 |
uint32_t reserved : 30; |
| 513 |
} bits; |
| 514 |
uint32_t value; |
| 515 |
} slice_ext_flags; |
| 516 |
|
| 517 |
/** \brief Screen Content Extension parameters. |
| 518 |
* data range [-12..12] |
| 519 |
*/ |
| 520 |
int8_t slice_act_y_qp_offset; |
| 521 |
int8_t slice_act_cb_qp_offset; |
| 522 |
int8_t slice_act_cr_qp_offset; |
| 523 |
} VASliceParameterBufferHEVCRext; |
| 524 |
|
| 525 |
/** |
| 526 |
* \brief HEVC Decoding Slice Parameter Buffer Structure For Long Format including Extensions |
| 527 |
* |
| 528 |
* This data structure contains both baseline HEVC profiles (main, main10) |
| 529 |
* and extension profiles (range extension and screen content). |
| 530 |
* |
| 531 |
* VASliceParameterBufferHEVCExtension structure should be accompanied by a |
| 532 |
* slice data buffer, which holds the whole raw slice NAL unit bit streams |
| 533 |
* including start code prefix and emulation prevention bytes not removed. |
| 534 |
* |
| 535 |
* This structure conveys parameters related to slice segment header and should |
| 536 |
* be sent once per slice. For HEVC range extension and HEVC Scc decoding, |
| 537 |
* application should parse both basic slice parameters and extented slice |
| 538 |
* parameters into this buffer structure and sent it. |
| 539 |
* |
| 540 |
* For short format, this data structure is not sent by application. |
| 541 |
* |
| 542 |
*/ |
| 543 |
typedef struct _VASliceParameterBufferHEVCExtension { |
| 544 |
/** \brief baseline HEVC slice parameters data structure */ |
| 545 |
VASliceParameterBufferHEVC base; |
| 546 |
|
| 547 |
/** \brief extented HEVC slice parameters data structure */ |
| 548 |
VASliceParameterBufferHEVCRext rext; |
| 549 |
} VASliceParameterBufferHEVCExtension; |
| 550 |
|
| 551 |
/** |
| 552 |
* \brief HEVC Inverse Quantization Matrix Buffer Structure |
| 553 |
* |
| 554 |
* This structure is sent once per frame, |
| 555 |
* and only when scaling_list_enabled_flag = 1. |
| 556 |
* When sps_scaling_list_data_present_flag = 0, app still |
| 557 |
* needs to send in this structure with default matrix values. |
| 558 |
* |
| 559 |
* Matrix entries are in raster scan order which follows HEVC spec. |
| 560 |
*/ |
| 561 |
typedef struct _VAIQMatrixBufferHEVC { |
| 562 |
/** |
| 563 |
* \brief scaling lists, |
| 564 |
* corresponds to same HEVC spec syntax element |
| 565 |
* ScalingList[ i ][ MatrixID ][ j ]. |
| 566 |
* |
| 567 |
* \brief 4x4 scaling, |
| 568 |
* correspongs i = 0, MatrixID is in the range of 0 to 5, |
| 569 |
* inclusive. And j is in the range of 0 to 15, inclusive. |
| 570 |
*/ |
| 571 |
uint8_t ScalingList4x4[6][16]; |
| 572 |
/** |
| 573 |
* \brief 8x8 scaling, |
| 574 |
* correspongs i = 1, MatrixID is in the range of 0 to 5, |
| 575 |
* inclusive. And j is in the range of 0 to 63, inclusive. |
| 576 |
*/ |
| 577 |
uint8_t ScalingList8x8[6][64]; |
| 578 |
/** |
| 579 |
* \brief 16x16 scaling, |
| 580 |
* correspongs i = 2, MatrixID is in the range of 0 to 5, |
| 581 |
* inclusive. And j is in the range of 0 to 63, inclusive. |
| 582 |
*/ |
| 583 |
uint8_t ScalingList16x16[6][64]; |
| 584 |
/** |
| 585 |
* \brief 32x32 scaling, |
| 586 |
* correspongs i = 3, MatrixID is in the range of 0 to 1, |
| 587 |
* inclusive. And j is in the range of 0 to 63, inclusive. |
| 588 |
*/ |
| 589 |
uint8_t ScalingList32x32[2][64]; |
| 590 |
/** |
| 591 |
* \brief DC values of the 16x16 scaling lists, |
| 592 |
* corresponds to HEVC spec syntax |
| 593 |
* scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8 |
| 594 |
* with sizeID = 2 and matrixID in the range of 0 to 5, inclusive. |
| 595 |
*/ |
| 596 |
uint8_t ScalingListDC16x16[6]; |
| 597 |
/** |
| 598 |
* \brief DC values of the 32x32 scaling lists, |
| 599 |
* corresponds to HEVC spec syntax |
| 600 |
* scaling_list_dc_coef_minus8[ sizeID - 2 ][ matrixID ] + 8 |
| 601 |
* with sizeID = 3 and matrixID in the range of 0 to 1, inclusive. |
| 602 |
*/ |
| 603 |
uint8_t ScalingListDC32x32[2]; |
| 604 |
|
| 605 |
/** \brief Reserved bytes for future use, must be zero */ |
| 606 |
uint32_t va_reserved[VA_PADDING_LOW]; |
| 607 |
} VAIQMatrixBufferHEVC; |
| 608 |
|
| 609 |
|
| 610 |
/**@}*/ |
| 611 |
|
| 612 |
#ifdef __cplusplus |
| 613 |
} |
| 614 |
#endif |
| 615 |
|
| 616 |
#endif /* VA_DEC_HEVC_H */ |