OSDN Git Service

5968ba6d1560dcd0ee3bdb74ad3835047306d19c
[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  * \brief FEI specific attribute definitions
41  */
42 /** @name Attribute values for VAConfigAttribFEIFunctionType
43  *
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.
52  *
53  **/
54 /**@{*/
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
61
62 /**@}*/
63
64 /** \brief Attribute value for VAConfigAttribStats */
65 typedef union _VAConfigAttribValStats {
66     struct {
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;
76     } bits;
77     uint32_t value;
78 } VAConfigAttribValStats;
79
80 typedef struct _VAPictureStats
81 {
82     VASurfaceID picture_id;
83     /*
84      * see flags below.
85      */
86     uint32_t flags;
87 } VAPictureStats;
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
96  **/
97 #define VA_PICTURE_STATS_CONTENT_UPDATED           0x00000010
98
99 /** \brief Motion Vector and Statistics frame level controls.
100  * common part VAStatsStatisticsParameterBufferType for a MB or CTB
101  **/
102 typedef struct _VAStatsStatisticsParameter
103 {
104     /** \brief Source surface ID.  */
105     VAPictureStats  input;
106
107     /** \brief Past reference surface ID pointer.  */
108     VAPictureStats  *past_references;
109
110     /** \brief Past reference surface number  */
111     uint32_t        num_past_references;
112
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.
120      **/
121     VABufferID      *past_ref_stat_buf;
122
123     /** \brief Future reference surface ID pointer.  */
124     VAPictureStats  *future_references;
125
126     /** \brief Future reference surface number  */
127     uint32_t        num_future_references;
128
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.
136      **/
137     VABufferID      *future_ref_stat_buf;
138
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).
143      **/
144     VABufferID      *outputs;
145
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).
150      **/
151     VABufferID      mv_predictor;
152
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.
156      **/
157     VABufferID      qp;
158 } VAStatsStatisticsParameter;
159
160 #ifdef __cplusplus
161 }
162 #endif
163
164 #endif /* VA_FEI_H */