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_ENUMS_H 29 #define PIPE_VIDEO_ENUMS_H 30 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 enum pipe_video_format 36 { 37 PIPE_VIDEO_FORMAT_UNKNOWN = 0, 38 PIPE_VIDEO_FORMAT_MPEG12, /**< MPEG1, MPEG2 */ 39 PIPE_VIDEO_FORMAT_MPEG4, /**< DIVX, XVID */ 40 PIPE_VIDEO_FORMAT_VC1, /**< WMV */ 41 PIPE_VIDEO_FORMAT_MPEG4_AVC,/**< H.264 */ 42 PIPE_VIDEO_FORMAT_HEVC, /**< H.265 */ 43 PIPE_VIDEO_FORMAT_JPEG, /**< JPEG */ 44 PIPE_VIDEO_FORMAT_VP9, /**< VP9 */ 45 PIPE_VIDEO_FORMAT_AV1 /**< AV1 */ 46 }; 47 48 enum pipe_video_profile 49 { 50 PIPE_VIDEO_PROFILE_UNKNOWN, 51 PIPE_VIDEO_PROFILE_MPEG1, 52 PIPE_VIDEO_PROFILE_MPEG2_SIMPLE, 53 PIPE_VIDEO_PROFILE_MPEG2_MAIN, 54 PIPE_VIDEO_PROFILE_MPEG4_SIMPLE, 55 PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE, 56 PIPE_VIDEO_PROFILE_VC1_SIMPLE, 57 PIPE_VIDEO_PROFILE_VC1_MAIN, 58 PIPE_VIDEO_PROFILE_VC1_ADVANCED, 59 PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE, 60 PIPE_VIDEO_PROFILE_MPEG4_AVC_CONSTRAINED_BASELINE, 61 PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN, 62 PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED, 63 PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH, 64 PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH10, 65 PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH422, 66 PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH444, 67 PIPE_VIDEO_PROFILE_HEVC_MAIN, 68 PIPE_VIDEO_PROFILE_HEVC_MAIN_10, 69 PIPE_VIDEO_PROFILE_HEVC_MAIN_STILL, 70 PIPE_VIDEO_PROFILE_HEVC_MAIN_12, 71 PIPE_VIDEO_PROFILE_HEVC_MAIN_444, 72 PIPE_VIDEO_PROFILE_JPEG_BASELINE, 73 PIPE_VIDEO_PROFILE_VP9_PROFILE0, 74 PIPE_VIDEO_PROFILE_VP9_PROFILE2, 75 PIPE_VIDEO_PROFILE_AV1_MAIN, 76 PIPE_VIDEO_PROFILE_MAX 77 }; 78 79 /* Video caps, can be different for each codec/profile */ 80 enum pipe_video_cap 81 { 82 PIPE_VIDEO_CAP_SUPPORTED = 0, 83 PIPE_VIDEO_CAP_NPOT_TEXTURES = 1, 84 PIPE_VIDEO_CAP_MAX_WIDTH = 2, 85 PIPE_VIDEO_CAP_MAX_HEIGHT = 3, 86 PIPE_VIDEO_CAP_PREFERED_FORMAT = 4, 87 PIPE_VIDEO_CAP_PREFERS_INTERLACED = 5, 88 PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE = 6, 89 PIPE_VIDEO_CAP_SUPPORTS_INTERLACED = 7, 90 PIPE_VIDEO_CAP_MAX_LEVEL = 8, 91 PIPE_VIDEO_CAP_STACKED_FRAMES = 9, 92 PIPE_VIDEO_CAP_MAX_MACROBLOCKS = 10, 93 PIPE_VIDEO_CAP_MAX_TEMPORAL_LAYERS = 11, 94 PIPE_VIDEO_CAP_EFC_SUPPORTED = 12, 95 PIPE_VIDEO_CAP_ENC_MAX_SLICES_PER_FRAME = 13, 96 PIPE_VIDEO_CAP_ENC_SLICES_STRUCTURE = 14, 97 PIPE_VIDEO_CAP_ENC_MAX_REFERENCES_PER_FRAME = 15, 98 PIPE_VIDEO_CAP_VPP_ORIENTATION_MODES = 16, 99 PIPE_VIDEO_CAP_VPP_BLEND_MODES = 17, 100 PIPE_VIDEO_CAP_VPP_MAX_INPUT_WIDTH = 18, 101 PIPE_VIDEO_CAP_VPP_MAX_INPUT_HEIGHT = 19, 102 PIPE_VIDEO_CAP_VPP_MIN_INPUT_WIDTH = 20, 103 PIPE_VIDEO_CAP_VPP_MIN_INPUT_HEIGHT = 21, 104 PIPE_VIDEO_CAP_VPP_MAX_OUTPUT_WIDTH = 22, 105 PIPE_VIDEO_CAP_VPP_MAX_OUTPUT_HEIGHT = 23, 106 PIPE_VIDEO_CAP_VPP_MIN_OUTPUT_WIDTH = 24, 107 PIPE_VIDEO_CAP_VPP_MIN_OUTPUT_HEIGHT = 25, 108 PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL = 26, 109 /* If true, when mapping planar textures like NV12 or P016 the mapped buffer contains 110 all the planes contiguously. This allows for use with some frontends functions that 111 require this like vaDeriveImage */ 112 PIPE_VIDEO_CAP_SUPPORTS_CONTIGUOUS_PLANES_MAP = 27, 113 PIPE_VIDEO_CAP_ENC_SUPPORTS_MAX_FRAME_SIZE = 28, 114 PIPE_VIDEO_CAP_ENC_HEVC_BLOCK_SIZES = 29, 115 PIPE_VIDEO_CAP_ENC_HEVC_FEATURE_FLAGS = 30, 116 PIPE_VIDEO_CAP_ENC_HEVC_PREDICTION_DIRECTION = 31, 117 /* 118 If reported by the driver, then pipe_video_codec.flush(...) 119 needs to be called after pipe_video_codec.end_frame(...) 120 to kick off the work in the device 121 */ 122 PIPE_VIDEO_CAP_REQUIRES_FLUSH_ON_END_FRAME = 32, 123 124 /* 125 If reported by the driver, then multiple p_video_codec encode 126 operations can be asynchronously enqueued (and also flushed) 127 with different feedback values in the device before get_feedback 128 is called on them to synchronize. The device can block on begin_frame 129 when it has reached its maximum async depth capacity 130 */ 131 PIPE_VIDEO_CAP_ENC_SUPPORTS_ASYNC_OPERATION = 33, 132 PIPE_VIDEO_CAP_MIN_WIDTH = 34, 133 PIPE_VIDEO_CAP_MIN_HEIGHT = 35, 134 PIPE_VIDEO_CAP_ENC_RATE_CONTROL_QVBR = 36, 135 /* 136 AV1 encoding features list 137 */ 138 PIPE_VIDEO_CAP_ENC_AV1_FEATURE = 37, 139 PIPE_VIDEO_CAP_ENC_AV1_FEATURE_EXT1 = 38, 140 PIPE_VIDEO_CAP_ENC_AV1_FEATURE_EXT2 = 39, 141 PIPE_VIDEO_CAP_ENC_SUPPORTS_TILE = 40, 142 PIPE_VIDEO_CAP_ENC_MAX_TILE_ROWS = 41, 143 PIPE_VIDEO_CAP_ENC_MAX_TILE_COLS = 42, 144 PIPE_VIDEO_CAP_ENC_INTRA_REFRESH = 43, 145 PIPE_VIDEO_CAP_ENC_SUPPORTS_FEEDBACK_METADATA = 44, 146 /* 147 * uses pipe_video_h264_enc_dbk_filter_mode_flags and sets the 148 * supported modes to set in disable_deblocking_filter_idc 149 */ 150 PIPE_VIDEO_CAP_ENC_H264_DISABLE_DBK_FILTER_MODES_SUPPORTED = 45, 151 /* max number of intra refresh cycles before the beginning of a new 152 * intra-refresh wave (e.g pipe_enc_intra_refresh.offset is 0 again) 153 */ 154 PIPE_VIDEO_CAP_ENC_INTRA_REFRESH_MAX_DURATION = 46, 155 PIPE_VIDEO_CAP_ENC_H264_SUPPORTS_CABAC_ENCODE = 47, 156 /* 157 crop and partial decode support 158 */ 159 PIPE_VIDEO_CAP_ROI_CROP_DEC = 48, 160 /* 161 * Encoding Region Of Interest feature 162 */ 163 PIPE_VIDEO_CAP_ENC_ROI = 49, 164 }; 165 166 enum pipe_video_h264_enc_dbk_filter_mode_flags 167 { 168 PIPE_VIDEO_H264_ENC_DBK_MODE_NONE = 0, 169 PIPE_VIDEO_H264_ENC_DBK_MODE_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = 0x1, 170 PIPE_VIDEO_H264_ENC_DBK_MODE_DISABLE_ALL_SLICE_BLOCK_EDGES = 0x2, 171 PIPE_VIDEO_H264_ENC_DBK_MODE_DISABLE_SLICE_BOUNDARIES_BLOCKS = 0x4, 172 PIPE_VIDEO_H264_ENC_DBK_MODE_USE_TWO_STAGE_DEBLOCKING = 0x8, 173 PIPE_VIDEO_H264_ENC_DBK_MODE_DISABLE_CHROMA_BLOCK_EDGES = 0x10, 174 PIPE_VIDEO_H264_ENC_DBK_MODE_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = 0x20, 175 PIPE_VIDEO_H264_ENC_DBK_MODE_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = 0x40, 176 }; 177 178 enum pipe_video_feedback_encode_result_flags 179 { 180 /* Requires PIPE_VIDEO_FEEDBACK_METADATA_TYPE_ENCODE_RESULT */ 181 PIPE_VIDEO_FEEDBACK_METADATA_ENCODE_FLAG_OK = 0x0, 182 PIPE_VIDEO_FEEDBACK_METADATA_ENCODE_FLAG_FAILED = 0x1, 183 /* Requires PIPE_VIDEO_FEEDBACK_METADATA_TYPE_MAX_FRAME_SIZE_OVERFLOW */ 184 PIPE_VIDEO_FEEDBACK_METADATA_ENCODE_FLAG_MAX_FRAME_SIZE_OVERFLOW = 0x2, 185 }; 186 187 enum codec_unit_location_flags 188 { 189 PIPE_VIDEO_CODEC_UNIT_LOCATION_FLAG_NONE = 0x0, 190 /* Requires PIPE_VIDEO_FEEDBACK_METADATA_TYPE_MAX_SLICE_SIZE_OVERFLOW */ 191 PIPE_VIDEO_CODEC_UNIT_LOCATION_FLAG_MAX_SLICE_SIZE_OVERFLOW = 0x1, 192 }; 193 194 /* To be used with PIPE_VIDEO_CAP_ENC_SUPPORTS_FEEDBACK_METADATA 195 * for checking gallium driver support and to indicate the 196 * different metadata types in an encode operation 197 */ 198 enum pipe_video_feedback_metadata_type 199 { 200 PIPE_VIDEO_FEEDBACK_METADATA_TYPE_BITSTREAM_SIZE = 0x0, 201 PIPE_VIDEO_FEEDBACK_METADATA_TYPE_ENCODE_RESULT = 0x1, 202 PIPE_VIDEO_FEEDBACK_METADATA_TYPE_CODEC_UNIT_LOCATION = 0x2, 203 PIPE_VIDEO_FEEDBACK_METADATA_TYPE_MAX_FRAME_SIZE_OVERFLOW = 0x4, 204 PIPE_VIDEO_FEEDBACK_METADATA_TYPE_MAX_SLICE_SIZE_OVERFLOW = 0x8, 205 PIPE_VIDEO_FEEDBACK_METADATA_TYPE_AVERAGE_FRAME_QP = 0x10, 206 }; 207 208 enum pipe_video_av1_enc_filter_mode 209 { 210 PIPE_VIDEO_CAP_ENC_AV1_INTERPOLATION_FILTER_EIGHT_TAP = (1 << 0), 211 PIPE_VIDEO_CAP_ENC_AV1_INTERPOLATION_FILTER_EIGHT_TAP_SMOOTH = (1 << 1), 212 PIPE_VIDEO_CAP_ENC_AV1_INTERPOLATION_FILTER_EIGHT_TAP_SHARP = (1 << 2), 213 PIPE_VIDEO_CAP_ENC_AV1_INTERPOLATION_FILTER_BILINEAR = (1 << 3), 214 PIPE_VIDEO_CAP_ENC_AV1_INTERPOLATION_FILTER_SWITCHABLE = (1 << 4), 215 216 }; 217 218 enum pipe_video_av1_enc_tx_mode 219 { 220 PIPE_VIDEO_CAP_ENC_AV1_TX_MODE_ONLY_4X4 = (1 << 0), 221 PIPE_VIDEO_CAP_ENC_AV1_TX_MODE_LARGEST = (1 << 1), 222 PIPE_VIDEO_CAP_ENC_AV1_TX_MODE_SELECT = (1 << 2), 223 }; 224 225 /* To be used with PIPE_VIDEO_CAP_VPP_ORIENTATION_MODES and for VPP state*/ 226 enum pipe_video_vpp_orientation 227 { 228 PIPE_VIDEO_VPP_ORIENTATION_DEFAULT = 0x0, 229 PIPE_VIDEO_VPP_ROTATION_90 = 0x01, 230 PIPE_VIDEO_VPP_ROTATION_180 = 0x02, 231 PIPE_VIDEO_VPP_ROTATION_270 = 0x04, 232 PIPE_VIDEO_VPP_FLIP_HORIZONTAL = 0x08, 233 PIPE_VIDEO_VPP_FLIP_VERTICAL = 0x10, 234 }; 235 236 /* To be used with PIPE_VIDEO_CAP_VPP_BLEND_MODES and for VPP state*/ 237 enum pipe_video_vpp_blend_mode 238 { 239 PIPE_VIDEO_VPP_BLEND_MODE_NONE = 0x0, 240 PIPE_VIDEO_VPP_BLEND_MODE_GLOBAL_ALPHA = 0x1, 241 }; 242 243 /* To be used for VPP state*/ 244 enum pipe_video_vpp_color_standard_type 245 { 246 PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_NONE = 0x0, 247 PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT601 = 0x1, 248 PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT709 = 0x2, 249 PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT2020 = 0xC, 250 PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_COUNT, 251 }; 252 253 /* To be used for VPP state*/ 254 enum pipe_video_vpp_color_range 255 { 256 PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_NONE = 0x00, 257 PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED = 0x01, 258 PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL = 0x02, 259 }; 260 261 /* To be used for VPP state*/ 262 enum pipe_video_vpp_chroma_siting 263 { 264 PIPE_VIDEO_VPP_CHROMA_SITING_NONE = 0x00, 265 PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_TOP = 0x01, 266 PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_CENTER = 0x02, 267 PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_BOTTOM = 0x04, 268 PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_LEFT = 0x10, 269 PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_CENTER = 0x20, 270 }; 271 272 273 /* To be used with cap PIPE_VIDEO_CAP_ENC_SLICES_STRUCTURE*/ 274 /** 275 * pipe_video_cap_slice_structure 276 * 277 * This attribute determines slice structures supported by the 278 * driver for encoding. This attribute is a hint to the user so 279 * that he can choose a suitable surface size and how to arrange 280 * the encoding process of multiple slices per frame. 281 * 282 * More specifically, for H.264 encoding, this attribute 283 * determines the range of accepted values to 284 * h264_slice_descriptor::macroblock_address and 285 * h264_slice_descriptor::num_macroblocks. 286 */ 287 enum pipe_video_cap_slice_structure 288 { 289 /* Driver does not supports multiple slice per frame.*/ 290 PIPE_VIDEO_CAP_SLICE_STRUCTURE_NONE = 0x00000000, 291 /* Driver supports a power-of-two number of rows per slice.*/ 292 PIPE_VIDEO_CAP_SLICE_STRUCTURE_POWER_OF_TWO_ROWS = 0x00000001, 293 /* Driver supports an arbitrary number of macroblocks per slice.*/ 294 PIPE_VIDEO_CAP_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS = 0x00000002, 295 /* Driver support 1 row per slice*/ 296 PIPE_VIDEO_CAP_SLICE_STRUCTURE_EQUAL_ROWS = 0x00000004, 297 /* Driver support max encoded slice size per slice */ 298 PIPE_VIDEO_CAP_SLICE_STRUCTURE_MAX_SLICE_SIZE = 0x00000008, 299 /* Driver supports an arbitrary number of rows per slice. */ 300 PIPE_VIDEO_CAP_SLICE_STRUCTURE_ARBITRARY_ROWS = 0x00000010, 301 /* Driver supports any number of rows per slice but they must be the same 302 * for all slices except for the last one, which must be equal or smaller 303 * to the previous slices. */ 304 PIPE_VIDEO_CAP_SLICE_STRUCTURE_EQUAL_MULTI_ROWS = 0x00000020, 305 }; 306 307 enum pipe_video_enc_intra_refresh_mode 308 { 309 /* no intra-refresh is supported */ 310 PIPE_VIDEO_ENC_INTRA_REFRESH_NONE = 0x00000, 311 /* intra-refresh is column based */ 312 PIPE_VIDEO_ENC_INTRA_REFRESH_COLUMN = 0x00001, 313 /* intra-refresh is row based */ 314 PIPE_VIDEO_ENC_INTRA_REFRESH_ROW = 0x00002, 315 /* intra-refresh could be adaptive, and decided by application */ 316 PIPE_VIDEO_ENC_INTRA_REFRESH_ADAPTIVE = 0x00010, 317 /* intra-refresh could be cyclic, decided by application */ 318 PIPE_VIDEO_ENC_INTRA_REFRESH_CYCLIC = 0x00020, 319 /* intra-refresh can be on P frame */ 320 PIPE_VIDEO_ENC_INTRA_REFRESH_P_FRAME = 0x10000, 321 /* intra-refresh can be on B frame */ 322 PIPE_VIDEO_ENC_INTRA_REFRESH_B_FRAME = 0x20000, 323 /* intra-refresh support multiple reference encoder */ 324 PIPE_VIDEO_ENC_INTRA_REFRESH_MULTI_REF = 0x40000, 325 }; 326 327 enum pipe_video_slice_mode 328 { 329 /* 330 * Partitions the frame using block offsets and block numbers 331 */ 332 PIPE_VIDEO_SLICE_MODE_BLOCKS = 0, 333 /* 334 * Partitions the frame using max slice size per coded slice 335 */ 336 PIPE_VIDEO_SLICE_MODE_MAX_SLICE_SIZE = 1, 337 }; 338 339 enum pipe_video_entrypoint 340 { 341 PIPE_VIDEO_ENTRYPOINT_UNKNOWN, 342 PIPE_VIDEO_ENTRYPOINT_BITSTREAM, 343 PIPE_VIDEO_ENTRYPOINT_IDCT, 344 PIPE_VIDEO_ENTRYPOINT_MC, 345 PIPE_VIDEO_ENTRYPOINT_ENCODE, 346 PIPE_VIDEO_ENTRYPOINT_PROCESSING, 347 }; 348 349 #if defined(__cplusplus) 350 } 351 #endif 352 353 #endif /* PIPE_VIDEO_ENUMS_H */ 354