Add support for new VA buffer export APIs.
[platform/upstream/libva-intel-driver.git] / src / i965_drv_video.h
index 75c66e9..a72bb64 100644 (file)
 #define DEFAULT_HUE             0
 #define DEFAULT_SATURATION      50
 
+#define ENCODER_QUALITY_RANGE     2
+#define ENCODER_DEFAULT_QUALITY   1
+#define ENCODER_HIGH_QUALITY      ENCODER_DEFAULT_QUALITY
+#define ENCODER_LOW_QUALITY       2
+
 struct i965_surface
 {
     struct object_base *base;
@@ -125,6 +130,9 @@ struct decode_state
     struct object_surface *reference_objects[16]; /* Up to 2 reference surfaces are valid for MPEG-2,*/
 };
 
+#define SLICE_PACKED_DATA_INDEX_TYPE    0x80000000
+#define SLICE_PACKED_DATA_INDEX_MASK    0x00FFFFFF
+
 struct encode_state
 {
     struct codec_state_base base;
@@ -145,6 +153,38 @@ struct encode_state
     struct buffer_store **slice_params_ext;
     int max_slice_params_ext;
     int num_slice_params_ext;
+
+    /* Check the user-configurable packed_header attribute.
+     * Currently it is mainly used to check whether the packed slice_header data
+     * is provided by user or the driver.
+     * TBD: It will check for the packed SPS/PPS/MISC/RAWDATA and so on.
+     */
+    unsigned int packed_header_flag;
+    /* For the packed data that needs to be inserted into video clip */
+    /* currently it is mainly to track packed raw data and packed slice_header data. */
+    struct buffer_store **packed_header_params_ext;
+    int max_packed_header_params_ext;
+    int num_packed_header_params_ext;
+    struct buffer_store **packed_header_data_ext;
+    int max_packed_header_data_ext;
+    int num_packed_header_data_ext;
+
+    /* the index of current slice */
+    int slice_index;
+    /* the array is determined by max_slice_params_ext */
+    int max_slice_num;
+    /* This is to store the first index of packed data for one slice */
+    int *slice_rawdata_index;
+    /* This is to store the number of packed data for one slice.
+     * Both packed rawdata and slice_header data are tracked by this
+     * this variable. That is to say: When one packed slice_header is parsed,
+     * this variable will also be increased.
+     */
+    int *slice_rawdata_count;
+
+    /* This is to store the index of packed slice header for one slice */
+    int *slice_header_index;
+
     int last_packed_header_type;
 
     struct buffer_store *misc_param[16];
@@ -202,12 +242,8 @@ struct object_context
 };
 
 #define SURFACE_REFERENCED      (1 << 0)
-#define SURFACE_DISPLAYED       (1 << 1)
 #define SURFACE_DERIVED         (1 << 2)
-#define SURFACE_REF_DIS_MASK    ((SURFACE_REFERENCED) | \
-                                 (SURFACE_DISPLAYED))
 #define SURFACE_ALL_MASK        ((SURFACE_REFERENCED) | \
-                                 (SURFACE_DISPLAYED) |  \
                                  (SURFACE_DERIVED))
 
 struct object_surface 
@@ -251,6 +287,10 @@ struct object_buffer
     int num_elements;
     int size_element;
     VABufferType type;
+
+    /* Export state */
+    unsigned int export_refcount;
+    VABufferInfo export_state;
 };
 
 struct object_image 
@@ -302,6 +342,7 @@ struct hw_codec_info
     int min_linear_wpitch;
     int min_linear_hpitch;
 
+    unsigned int h264_mvc_dec_profiles;
     unsigned int h264_dec_chroma_formats;
     unsigned int jpeg_dec_chroma_formats;
 
@@ -321,7 +362,6 @@ struct hw_codec_info
     unsigned int has_di_motion_compensated:1;
     unsigned int has_vp8_decoding:1;
     unsigned int has_vp8_encoding:1;
-    unsigned int has_h264_mvc_decoding:1;
     unsigned int has_h264_mvc_encoding:1;
 
     unsigned int num_filters;