|
| 1 | +/* |
| 2 | + * Copyright (c) 2022 MTHREADS 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_avs.h |
| 27 | + * \brief The AVS decoding API |
| 28 | + * |
| 29 | + * This file contains the \ref api_dec_avs "AVS decoding API". |
| 30 | + */ |
| 31 | + |
| 32 | +#ifndef VA_DEC_AVS_H |
| 33 | +#define VA_DEC_AVS_H |
| 34 | + |
| 35 | +#include <stdint.h> |
| 36 | + |
| 37 | +#ifdef __cplusplus |
| 38 | +extern "C" { |
| 39 | +#endif |
| 40 | + |
| 41 | +/** |
| 42 | + * \defgroup api_dec_avs AVS decoding API |
| 43 | + * |
| 44 | + * This AVS decoding API supports Jizhun & Guangdian profiles. |
| 45 | + * |
| 46 | + * @{ |
| 47 | + */ |
| 48 | + |
| 49 | +typedef enum { |
| 50 | + VA_AVS_I_IMG = 0, |
| 51 | + VA_AVS_P_IMG = 1, |
| 52 | + VA_AVS_B_IMG = 2, |
| 53 | +} VAAVSPicType; |
| 54 | + |
| 55 | +typedef struct _VAPictureAVS { |
| 56 | + VASurfaceID surface_id; |
| 57 | + uint32_t flags; |
| 58 | + uint32_t poc; |
| 59 | + |
| 60 | + /** \brief Reserved bytes for future use, must be zero */ |
| 61 | + uint32_t va_reserved[VA_PADDING_LOW]; |
| 62 | +} VAPictureAVS; |
| 63 | + |
| 64 | +/* flags in VAPictureAVS could be OR of the following */ |
| 65 | +#define VA_PICTURE_AVS_INVALID 0x00000001 |
| 66 | +#define VA_PICTURE_AVS_TOP_FIELD 0x00000002 |
| 67 | +#define VA_PICTURE_AVS_BOTTOM_FIELD 0x00000004 |
| 68 | + |
| 69 | +/** |
| 70 | + * \brief AVS Decoding Picture Parameter Buffer Structure |
| 71 | + * |
| 72 | + * This structure conveys picture level parameters and should be sent once |
| 73 | + * per frame. |
| 74 | + */ |
| 75 | +typedef struct _VAPictureParameterBufferAVS { |
| 76 | + VAPictureAVS curr_pic; |
| 77 | + VAPictureAVS ref_list[2]; |
| 78 | + |
| 79 | + uint16_t width; // coded width |
| 80 | + uint16_t height; // coded height |
| 81 | + |
| 82 | + uint16_t picture_type : 2; // VAAVSPicType |
| 83 | + uint16_t progressive_seq_flag : 1; |
| 84 | + uint16_t progressive_frame_flag : 1; |
| 85 | + uint16_t picture_structure_flag : 1; // 0:field coding, 1:frame coding |
| 86 | + uint16_t fixed_pic_qp_flag : 1; |
| 87 | + uint16_t picture_qp : 6; |
| 88 | + uint16_t loop_filter_disable_flag : 1; |
| 89 | + uint16_t skip_mode_flag_flag : 1; |
| 90 | + uint16_t picture_reference_flag : 1; |
| 91 | + uint16_t no_forward_reference_flag : 1; |
| 92 | + |
| 93 | + int8_t alpha_c_offset; |
| 94 | + int8_t beta_offset; |
| 95 | + |
| 96 | + struct { |
| 97 | + uint16_t guangdian_flag : 1; |
| 98 | + uint16_t aec_flag : 1; |
| 99 | + uint16_t weight_quant_flag : 1; |
| 100 | + uint16_t pb_field_enhanced_flag : 1; |
| 101 | + uint16_t reserved : 12; |
| 102 | + int8_t chroma_quant_param_delta_cb; |
| 103 | + int8_t chroma_quant_param_delta_cr; |
| 104 | + uint8_t wqm_8x8[64]; |
| 105 | + } guangdian_fields; |
| 106 | + |
| 107 | + /** \brief Reserved bytes for future use, must be zero */ |
| 108 | + uint32_t va_reserved[VA_PADDING_MEDIUM]; |
| 109 | +} VAPictureParameterBufferAVS; |
| 110 | + |
| 111 | +/** |
| 112 | + * \brief AVS Slice Parameter Buffer Structure |
| 113 | + * |
| 114 | + * Slice data buffer of VASliceDataBufferType is used to send the bitstream data. |
| 115 | + * When send AVS slice data, start code and slice header should be included. |
| 116 | + */ |
| 117 | +typedef struct _VASliceParameterBufferAVS { |
| 118 | + uint32_t slice_data_size; /* number of bytes in the slice data buffer for this slice */ |
| 119 | + uint32_t slice_data_offset; /* the offset to the first byte of slice data */ |
| 120 | + uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */ |
| 121 | + uint32_t mb_data_bit_offset; /* offset to the first bit of MB from the first byte of slice data (slice_data_offset) */ |
| 122 | + |
| 123 | + uint32_t slice_vertical_pos : 16; /* first mb row of the slice */ |
| 124 | + uint32_t fixed_slice_qp_flag : 1; |
| 125 | + uint32_t slice_qp : 6; |
| 126 | + uint32_t slice_weight_pred_flag : 1; |
| 127 | + uint32_t mb_weight_pred_flag : 1; |
| 128 | + |
| 129 | + uint8_t luma_scale[4]; |
| 130 | + int8_t luma_shift[4]; |
| 131 | + uint8_t chroma_scale[4]; |
| 132 | + int8_t chroma_shift[4]; |
| 133 | + |
| 134 | + /** \brief Reserved bytes for future use, must be zero */ |
| 135 | + uint32_t va_reserved[VA_PADDING_LOW]; |
| 136 | +} VASliceParameterBufferAVS; |
| 137 | + |
| 138 | +/**@}*/ |
| 139 | + |
| 140 | +#ifdef __cplusplus |
| 141 | +} |
| 142 | +#endif |
| 143 | + |
| 144 | +#endif /* VA_DEC_AVS_H */ |
0 commit comments