Enabling SNB avc encoding configuration
[platform/upstream/libva-intel-driver.git] / src / i965_fourcc.h
1 #ifndef _I965_FOURCC_H_
2 #define _I965_FOURCC_H_
3
4 #ifndef VA_FOURCC_YV16
5 #define VA_FOURCC_YV16 VA_FOURCC('Y','V','1','6')
6 #endif
7
8 #ifndef VA_FOURCC_I420
9 #define VA_FOURCC_I420 VA_FOURCC('I','4','2','0')
10 #endif
11
12 /*
13  * VA_FOURCC_IA44 is an exception because the va.h already
14  * defines the AI44 as VA_FOURCC('I', 'A', '4', '4').
15  */
16 #ifndef VA_FOURCC_IA44
17 #define VA_FOURCC_IA44 VA_FOURCC('A','I','4','4')
18 #endif
19
20 #ifndef VA_FOURCC_IA88
21 #define VA_FOURCC_IA88 VA_FOURCC('I','A','8','8')
22 #endif
23
24 #ifndef VA_FOURCC_AI88
25 #define VA_FOURCC_AI88 VA_FOURCC('A','I','8','8')
26 #endif
27
28 #ifndef VA_FOURCC_IMC1
29 #define VA_FOURCC_IMC1 VA_FOURCC('I','M','C','1')
30 #endif
31
32 #ifndef VA_FOURCC_YVY2
33 #define VA_FOURCC_YVY2 VA_FOURCC('Y','V','Y','2')
34 #endif
35
36 #define I965_MAX_PLANES         4
37 #define I965_MAX_COMONENTS      4
38
39 #define I965_COLOR_YUV          0
40 #define I965_COLOR_RGB          1
41 #define I965_COLOR_INDEX        2
42
43 typedef struct {
44     uint8_t plane;                      /* the plane which the pixel belongs to */
45     uint8_t offset;                     /* bits offset within a pixel in the plane */
46 } i965_component_info;
47
48 typedef struct {
49     uint32_t fourcc;                    /* fourcc */
50     uint32_t format;                    /* 0: YUV, 1: RGB, 2: Indexed format */
51     uint32_t subsampling;               /* Sub sampling */
52     uint8_t flag;                       /* 1: only supported by vaCreateSurfaces(), 2: only supported by vaCreateImage(), 3: both */
53     uint8_t hfactor;                    /* horizontal sampling factor */
54     uint8_t vfactor;                    /* vertical sampling factor */
55     uint8_t num_planes;                 /* number of planes */
56     uint8_t bpp[I965_MAX_PLANES];       /* bits per pixel within a plane */
57     uint8_t num_components;             /* number of components */
58     /*
59      * Components in the array are ordered in Y, U, V, A (up to 4 components)
60      * for YUV formats, R, G, B, A (up to 4 components) for RGB formats and
61      * I, A (2 components) for indexed formats
62      */
63     i965_component_info components[I965_MAX_COMONENTS];
64 } i965_fourcc_info;
65
66 extern const i965_fourcc_info *get_fourcc_info(unsigned int);
67
68 #endif /* _I965_FOURCC_H_ */