OSDN Git Service

update NEWS for libva 2.4.0
[android-x86/hardware-intel-common-libva.git] / va / va_fei.h
1 /*
2  * Copyright (c) 2007-2017 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_fei.h
27  * \brief The FEI encoding common API
28  */
29
30 #ifndef VA_FEI_H
31 #define VA_FEI_H
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #include <stdint.h>
38
39 /**
40  * \defgroup api_fei FEI encoding common API
41  *
42  * @{
43  */
44
45 /**
46  * \brief FEI specific attribute definitions
47  */
48 /** @name Attribute values for VAConfigAttribFEIFunctionType
49  *
50  * This is only for VAEntrypointFEI
51  * The desired type should be passed to driver when creating the configuration.
52  * If VA_FEI_FUNCTION_ENC_PAK is set, VA_FEI_FUNCTION_ENC and VA_FEI_FUNCTION_PAK
53  * will be ignored if set also. Combination of VA_FEI_FUNCTION_ENC and VA_FEI_FUNCTION_PAK
54  * is not valid. If  VA_FEI_FUNCTION_ENC is set, there will be no bitstream output.
55  * If VA_FEI_FUNCTION_PAK is set, two extra input buffers for PAK are needed:
56  * VAEncFEIMVBufferType and VAEncFEIMBCodeBufferType.
57  * VA_FEI_FUNCTION_ENC_PAK is recommended for best performance.
58  *
59  **/
60 /**@{*/
61 /** \brief ENC only is supported */
62 #define VA_FEI_FUNCTION_ENC                             0x00000001
63 /** \brief PAK only is supported */
64 #define VA_FEI_FUNCTION_PAK                             0x00000002
65 /** \brief ENC_PAK is supported */
66 #define VA_FEI_FUNCTION_ENC_PAK                         0x00000004
67
68 /**@}*/
69
70 /** \brief Attribute value for VAConfigAttribStats */
71 typedef union _VAConfigAttribValStats {
72     struct {
73         /** \brief Max number of past reference frames that are supported. */
74         uint32_t    max_num_past_references   : 4;
75         /** \brief Max number of future reference frames that are supported. */
76         uint32_t    max_num_future_references : 4;
77         /** \brief Number of supported output buffers for VAStatsStatisticsParameter->outputs */
78         uint32_t    num_outputs               : 3;
79         /** \brief Interlaced content is supported */
80         uint32_t    interlaced                : 1;
81         uint32_t    reserved                  : 20;
82     } bits;
83     uint32_t value;
84 } VAConfigAttribValStats;
85
86 typedef struct _VAPictureStats
87 {
88     VASurfaceID picture_id;
89     /*
90      * see flags below.
91      */
92     uint32_t flags;
93 } VAPictureStats;
94 /* flags in VAPictureStats could be one of the following */
95 #define VA_PICTURE_STATS_INVALID                   0x00000001
96 #define VA_PICTURE_STATS_PROGRESSIVE               0x00000000
97 #define VA_PICTURE_STATS_TOP_FIELD                 0x00000002
98 #define VA_PICTURE_STATS_BOTTOM_FIELD              0x00000004
99 /** \brief picutre surface content updated indicator.
100  * The picture surface content is updated, it means temporary buffer like downscaled pixel data in driver
101  * internal needs be forced freshing
102  **/
103 #define VA_PICTURE_STATS_CONTENT_UPDATED           0x00000010
104
105 /** \brief Motion Vector and Statistics frame level controls.
106  * common part VAStatsStatisticsParameterBufferType for a MB or CTB
107  **/
108 typedef struct _VAStatsStatisticsParameter
109 {
110     /** \brief Source surface ID.  */
111     VAPictureStats  input;
112
113     /** \brief Past reference surface ID pointer.  */
114     VAPictureStats  *past_references;
115
116     /** \brief Past reference surface number  */
117     uint32_t        num_past_references;
118
119     /** \brief Statistics output for past reference surface.
120      * Only enabling statistics output for past reference picture when *past_ref_stat_buf is a valid
121      * VABufferID, it is needed in case app wants statistics data of both reference and current pictures
122      * in very special use cases for better performance.
123      * The output layout is defined by VAStatsStatisticsBufferType(for progressive and top field of
124      * interlaced case) and VAStatsStatisticsBottomFieldBufferType(only for interlaced case), only
125      * pixel_average_16x16/pixel_average_8x8 and variance_16x16/variance_8x8 data are valid.
126      **/
127     VABufferID      *past_ref_stat_buf;
128
129     /** \brief Future reference surface ID pointer.  */
130     VAPictureStats  *future_references;
131
132     /** \brief Future reference surface number  */
133     uint32_t        num_future_references;
134
135     /** \brief Statistics output for future reference surface.
136      * Only enabling statistics output for future reference picture when *past_ref_stat_buf is a valid
137      * VABufferID, it is needed in case app wants statistics data of both reference and current pictures
138      * in very special use cases for better performance.
139      * The output layout is defined by VAStatsStatisticsBufferType(for progressive and top field of
140      * interlaced case) and VAStatsStatisticsBottomFieldBufferType(only for interlaced case), only
141      * pixel_average_16x16/pixel_average_8x8 and variance_16x16/variance_8x8 data are valid.
142      **/
143     VABufferID      *future_ref_stat_buf;
144
145     /** \brief ID of the output buffer.
146      * The number of outputs is determined by below DisableMVOutput and DisableStatisticsOutput.
147      * The output layout is defined by VAStatsMVBufferType, VAStatsStatisticsBufferType(for progressive and
148      * top field of interlaced case) and VAStatsStatisticsBottomFieldBufferType(only for interlaced case).
149      **/
150     VABufferID      *outputs;
151
152     /** \brief MV predictor. It is valid only when mv_predictor_ctrl is not 0.
153      * Each block has a pair of MVs, one for past and one for future reference
154      * as defined by VAMotionVector. The block is in raster scan order.
155      * Buffer size shall not be less than the number of blocks multiplied by sizeof(VAMotionVector).
156      **/
157     VABufferID      mv_predictor;
158
159     /** \brief QP input buffer. It is valid only when mb_qp is set to 1.
160      * The data in this buffer correspond to the input source.
161      * One QP per MB or CTB block in raster scan order, each QP is a signed char (8-bit) value.
162      **/
163     VABufferID      qp;
164 } VAStatsStatisticsParameter;
165
166 #ifdef __cplusplus
167 }
168 #endif
169
170 #endif /* VA_FEI_H */