2 * Copyright (c) 2007-2017 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
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.
27 * \brief The FEI encoding common API
40 * \brief FEI specific attribute definitions
42 /** @name Attribute values for VAConfigAttribFEIFunctionType
44 * This is only for VAEntrypointFEI
45 * The desired type should be passed to driver when creating the configuration.
46 * If VA_FEI_FUNCTION_ENC_PAK is set, VA_FEI_FUNCTION_ENC and VA_FEI_FUNCTION_PAK
47 * will be ignored if set also. Combination of VA_FEI_FUNCTION_ENC and VA_FEI_FUNCTION_PAK
48 * is not valid. If VA_FEI_FUNCTION_ENC is set, there will be no bitstream output.
49 * If VA_FEI_FUNCTION_PAK is set, two extra input buffers for PAK are needed:
50 * VAEncFEIMVBufferType and VAEncFEIMBCodeBufferType.
51 * VA_FEI_FUNCTION_ENC_PAK is recommended for best performance.
55 /** \brief ENC only is supported */
56 #define VA_FEI_FUNCTION_ENC 0x00000001
57 /** \brief PAK only is supported */
58 #define VA_FEI_FUNCTION_PAK 0x00000002
59 /** \brief ENC_PAK is supported */
60 #define VA_FEI_FUNCTION_ENC_PAK 0x00000004
64 /** \brief Attribute value for VAConfigAttribStats */
65 typedef union _VAConfigAttribValStats {
67 /** \brief Max number of past reference frames that are supported. */
68 uint32_t max_num_past_references : 4;
69 /** \brief Max number of future reference frames that are supported. */
70 uint32_t max_num_future_references : 4;
71 /** \brief Number of supported output buffers for VAStatsStatisticsParameter->outputs */
72 uint32_t num_outputs : 3;
73 /** \brief Interlaced content is supported */
74 uint32_t interlaced : 1;
75 uint32_t reserved : 20;
78 } VAConfigAttribValStats;
80 typedef struct _VAPictureStats
82 VASurfaceID picture_id;
88 /* flags in VAPictureStats could be one of the following */
89 #define VA_PICTURE_STATS_INVALID 0x00000001
90 #define VA_PICTURE_STATS_PROGRESSIVE 0x00000000
91 #define VA_PICTURE_STATS_TOP_FIELD 0x00000002
92 #define VA_PICTURE_STATS_BOTTOM_FIELD 0x00000004
93 /** \brief picutre surface content updated indicator.
94 * The picture surface content is updated, it means temporary buffer like downscaled pixel data in driver
95 * internal needs be forced freshing
97 #define VA_PICTURE_STATS_CONTENT_UPDATED 0x00000010
99 /** \brief Motion Vector and Statistics frame level controls.
100 * common part VAStatsStatisticsParameterBufferType for a MB or CTB
102 typedef struct _VAStatsStatisticsParameter
104 /** \brief Source surface ID. */
105 VAPictureStats input;
107 /** \brief Past reference surface ID pointer. */
108 VAPictureStats *past_references;
110 /** \brief Past reference surface number */
111 uint32_t num_past_references;
113 /** \brief Statistics output for past reference surface.
114 * Only enabling statistics output for past reference picture when *past_ref_stat_buf is a valid
115 * VABufferID, it is needed in case app wants statistics data of both reference and current pictures
116 * in very special use cases for better performance.
117 * The output layout is defined by VAStatsStatisticsBufferType(for progressive and top field of
118 * interlaced case) and VAStatsStatisticsBottomFieldBufferType(only for interlaced case), only
119 * pixel_average_16x16/pixel_average_8x8 and variance_16x16/variance_8x8 data are valid.
121 VABufferID *past_ref_stat_buf;
123 /** \brief Future reference surface ID pointer. */
124 VAPictureStats *future_references;
126 /** \brief Future reference surface number */
127 uint32_t num_future_references;
129 /** \brief Statistics output for future reference surface.
130 * Only enabling statistics output for future reference picture when *past_ref_stat_buf is a valid
131 * VABufferID, it is needed in case app wants statistics data of both reference and current pictures
132 * in very special use cases for better performance.
133 * The output layout is defined by VAStatsStatisticsBufferType(for progressive and top field of
134 * interlaced case) and VAStatsStatisticsBottomFieldBufferType(only for interlaced case), only
135 * pixel_average_16x16/pixel_average_8x8 and variance_16x16/variance_8x8 data are valid.
137 VABufferID *future_ref_stat_buf;
139 /** \brief ID of the output buffer.
140 * The number of outputs is determined by below DisableMVOutput and DisableStatisticsOutput.
141 * The output layout is defined by VAStatsMVBufferType, VAStatsStatisticsBufferType(for progressive and
142 * top field of interlaced case) and VAStatsStatisticsBottomFieldBufferType(only for interlaced case).
146 /** \brief MV predictor. It is valid only when mv_predictor_ctrl is not 0.
147 * Each block has a pair of MVs, one for past and one for future reference
148 * as defined by VAMotionVector. The block is in raster scan order.
149 * Buffer size shall not be less than the number of blocks multiplied by sizeof(VAMotionVector).
151 VABufferID mv_predictor;
153 /** \brief QP input buffer. It is valid only when mb_qp is set to 1.
154 * The data in this buffer correspond to the input source.
155 * One QP per MB or CTB block in raster scan order, each QP is a signed char (8-bit) value.
158 } VAStatsStatisticsParameter;
164 #endif /* VA_FEI_H */