OSDN Git Service

add VAConfigAttribDecJPEG attributes
[android-x86/hardware-intel-common-libva.git] / va / va.h
diff --git a/va/va.h b/va/va.h
index e4b3d10..d8a9eaa 100644 (file)
--- a/va/va.h
+++ b/va/va.h
@@ -107,11 +107,13 @@ extern "C" {
  * enable hardware accelerated video decode and encode at various
  * entry-points (VLD, IDCT, Motion Compensation etc.) for the
  * prevailing coding standards today (MPEG-2, MPEG-4 ASP/H.263, MPEG-4
- * AVC/H.264, VC-1/VMW3, and JPEG).
+ * AVC/H.264, VC-1/VMW3, and JPEG, HEVC/H265, VP8, VP9) and video pre/post
+ * processing
  *
  * VA-API is split into several modules:
  * - \ref api_core
- * - \ref api_enc_h264
+ * - \ref api_enc_xxx (xxx = h264, hevc, jpec, mpeg2, vp8, vp9)
+ * - \ref api_dec_xxx (xxx = hevc, jpec, vp8, vp9)
  * - \ref api_vpp
  */
 
@@ -124,9 +126,9 @@ extern "C" {
 /**
 Overview 
 
-The VA API is intended to provide an interface between a video decode/encode/display
+The VA API is intended to provide an interface between a video decode/encode/processing
 application (client) and a hardware accelerator (server), to off-load 
-video decode/encode/display operations from the host to the hardware accelerator at various 
+video decode/encode/processing operations from the host to the hardware accelerator at various
 entry-points.
 
 The basic operation steps are:
@@ -134,18 +136,18 @@ The basic operation steps are:
 - Negotiate a mutually acceptable configuration with the server to lock
   down profile, entrypoints, and other attributes that will not change on 
   a frame-by-frame basis.
-- Create a decode context which represents a "virtualized" hardware decode 
-  device
-- Get and fill decode buffers with picture level, slice level and macroblock 
-  level data (depending on entrypoints)
-- Pass the decode buffers to the server to decode the current frame
+- Create a video decode, encode or processing context which represents a
+  "virtualized" hardware device
+- Get and fill the render buffers with the corresponding data (depending on
+  profiles and entrypoints)
+- Pass the render buffers to the server to handle the current frame
 
 Initialization & Configuration Management 
 
 - Find out supported profiles
 - Find out entrypoints for a given profile
 - Find out configuration attributes for a given profile/entrypoint pair
-- Create a configuration for use by the decoder
+- Create a configuration for use by the application
 
 */
 
@@ -229,6 +231,12 @@ typedef int VAStatus;      /** Return status type from functions */
 #define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300
 #define VA_FILTER_SCALING_MASK          0x00000f00
 
+/** Padding size in 4-bytes */
+#define VA_PADDING_LOW          4
+#define VA_PADDING_MEDIUM       8
+#define VA_PADDING_HIGH         16
+#define VA_PADDING_LARGE        32
+
 /**
  * Returns a short english description of error_status
  */
@@ -419,7 +427,14 @@ typedef enum
      * See \c VA_DEC_SLICE_MODE_xxx for the list of slice decoding modes.
      */
     VAConfigAttribDecSliceMode         = 6,
-
+   /**
+     * \brief JPEG decoding attribute. Read-only.
+     *
+     * This attribute exposes a number of capabilities of the underlying
+     * JPEG implementation. The attribute value is partitioned into fields as defined in the
+     * VAConfigAttribValDecJPEG union.
+     */
+    VAConfigAttribDecJPEG             = 7,
     /** @name Attributes for encoding */
     /**@{*/
     /**
@@ -607,17 +622,45 @@ typedef struct _VAConfigAttrib {
 #define VA_DEC_SLICE_MODE_NORMAL       0x00000001
 /** \brief Driver supports base mode for slice decoding */
 #define VA_DEC_SLICE_MODE_BASE         0x00000002
+
+/** @name Attribute values for VAConfigAttribDecJPEG */
+/**@{*/
+typedef union _VAConfigAttribValDecJPEG {
+    struct{
+    /** \brief Set to (1 << VA_ROTATION_xxx) for supported rotation angles. */
+    uint32_t rotation : 4;
+    /** \brief Reserved for future use. */
+    uint32_t reserved : 28;
+    }bits;
+    uint32_t value;
+    uint32_t va_reserved[VA_PADDING_LOW];
+} VAConfigAttribValDecJPEG;
 /**@}*/
 
 /** @name Attribute values for VAConfigAttribEncPackedHeaders */
 /**@{*/
 /** \brief Driver does not support any packed headers mode. */
 #define VA_ENC_PACKED_HEADER_NONE       0x00000000
-/** \brief Driver supports packed sequence headers. e.g. SPS for H.264. */
+/**
+ * \brief Driver supports packed sequence headers. e.g. SPS for H.264.
+ *
+ * Application must provide it to driver once this flag is returned through
+ * vaGetConfigAttributes()
+ */
 #define VA_ENC_PACKED_HEADER_SEQUENCE   0x00000001
-/** \brief Driver supports packed picture headers. e.g. PPS for H.264. */
+/**
+ * \brief Driver supports packed picture headers. e.g. PPS for H.264.
+ *
+ * Application must provide it to driver once this falg is returned through
+ * vaGetConfigAttributes()
+ */
 #define VA_ENC_PACKED_HEADER_PICTURE    0x00000002
-/** \brief Driver supports packed slice headers. e.g. \c slice_header() for H.264. */
+/**
+ * \brief Driver supports packed slice headers. e.g. slice_header() for H.264.
+ *
+ * Application must provide it to driver once this flag is returned through
+ * vaGetConfigAttributes()
+ */
 #define VA_ENC_PACKED_HEADER_SLICE      0x00000004
 /**
  * \brief Driver supports misc packed headers. e.g. SEI for H.264.
@@ -822,7 +865,7 @@ typedef unsigned int VAGenericID;
 typedef VAGenericID VAConfigID;
 
 /**
- * Create a configuration for the decode pipeline 
+ * Create a configuration for the video decode/encode/processing pipeline
  * it passes in the attribute list that specifies the attributes it cares 
  * about, with the rest taking default values.  
  */
@@ -864,14 +907,17 @@ VAStatus vaQueryConfigAttributes (
 /**
  * Contexts and Surfaces
  *
- * Context represents a "virtual" video decode pipeline. Surfaces are render 
- * targets for a given context. The data in the surfaces are not accessible  
- * to the client and the internal data format of the surface is implementatin 
- * specific. 
+ * Context represents a "virtual" video decode, encode or video processing
+ * pipeline. Surfaces are render targets for a given context. The data in the
+ * surfaces are not accessible to the client except if derived image is supported
+ * and the internal data format of the surface is implementation specific.
  *
- * Surfaces will be bound to a context when the context is created. Once
- * a surface is bound to a given context, it can not be used to create  
- * another context. The association is removed when the context is destroyed
+ * Surfaces are provided as a hint of what surfaces will be used when the context
+ * is created through vaCreateContext(). A surface may be used by different contexts
+ * at the same time as soon as application can make sure the operations are synchronized
+ * between different contexts, e.g. a surface is used as the output of a decode context
+ * and the input of a video process context. Surfaces can only be destroyed after all
+ * contexts using these surfaces have been destroyed.
  * 
  * Both contexts and surfaces are identified by unique IDs and its
  * implementation specific internals are kept opaque to the clients
@@ -1105,7 +1151,7 @@ vaCreateSurfaces(
     
 /**
  * vaDestroySurfaces - Destroy resources associated with surfaces. 
- *  Surfaces can only be destroyed after the context associated has been 
+ *  Surfaces can only be destroyed after all contexts using these surfaces have been
  *  destroyed.  
  *  dpy: display
  *  surfaces: array of surfaces to destroy
@@ -1126,7 +1172,7 @@ VAStatus vaDestroySurfaces (
  *  picture_height: coded picture height
  *  flag: any combination of the following:
  *    VA_PROGRESSIVE (only progressive frame pictures in the sequence when set)
- *  render_targets: render targets (surfaces) tied to the context
+ *  render_targets: a hint for render targets (surfaces) tied to the context
  *  num_render_targets: number of render targets in the above array
  *  context: created context id upon return
  */
@@ -1151,6 +1197,86 @@ VAStatus vaDestroyContext (
     VAContextID context
 );
 
+//Multi-frame context
+typedef VAGenericID VAMFContextID;
+/**
+ * vaCreateMFContext - Create a multi-frame context
+ *  interface encapsulating common for all streams memory objects and structures
+ *  required for single GPU task submission from several VAContextID's.
+ *  Allocation: This call only creates an instance, doesn't allocate any additional memory.
+ *  Support identification: Application can identify multi-frame feature support by ability
+ *  to create multi-frame context. If driver supports multi-frame - call successful,
+ *  mf_context != NULL and VAStatus = VA_STATUS_SUCCESS, otherwise if multi-frame processing
+ *  not supported driver returns VA_STATUS_ERROR_UNIMPLEMENTED and mf_context = NULL.
+ *  return values:
+ *  VA_STATUS_SUCCESS - operation successful.
+ *  VA_STATUS_ERROR_UNIMPLEMENTED - no support for multi-frame.
+ *  dpy: display adapter.
+ *  mf_context: Multi-Frame context encapsulating all associated context
+ *  for multi-frame submission.
+ */
+VAStatus vaCreateMFContext (
+    VADisplay dpy,
+    VAMFContextID *mf_context    /* out */
+);
+
+/**
+ * vaMFAddContext - Provide ability to associate each context used for
+ *  Multi-Frame submission and common Multi-Frame context.
+ *  Try to add context to understand if it is supported.
+ *  Allocation: this call allocates and/or reallocates all memory objects
+ *  common for all contexts associated with particular Multi-Frame context.
+ *  All memory required for each context(pixel buffers, internal driver
+ *  buffers required for processing) allocated during standard vaCreateContext call for each context.
+ *  Runtime dependency - if current implementation doesn't allow to run different entry points/profile,
+ *  first context added will set entry point/profile for whole Multi-Frame context,
+ *  all other entry points and profiles can be rejected to be added.
+ *  Return values:
+ *  VA_STATUS_SUCCESS - operation successful, context was added.
+ *  VA_STATUS_ERROR_OPERATION_FAILED - something unexpected happened - application have to close
+ *  current mf_context and associated contexts and start working with new ones.
+ *  VA_STATUS_ERROR_INVALID_CONTEXT - ContextID is invalid, means:
+ *  1 - mf_context is not valid context or
+ *  2 - driver can't suport different VAEntrypoint or VAProfile simultaneosly
+ *  and current context contradicts with previously added, application can continue with current mf_context
+ *  and other contexts passed this call, rejected context can continue work in stand-alone
+ *  mode or other mf_context.
+ *  VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT - particular context being added was created with with
+ *  unsupported VAEntrypoint. Application can continue with current mf_context
+ *  and other contexts passed this call, rejected context can continue work in stand-alone
+ *  mode.
+ *  VA_STATUS_ERROR_UNSUPPORTED_PROFILE - Current context with Particular VAEntrypoint is supported
+ *  but VAProfile is not supported. Application can continue with current mf_context
+ *  and other contexts passed this call, rejected context can continue work in stand-alone
+ *  mode.
+ *  dpy: display adapter.
+ *  context: context being associated with Multi-Frame context.
+ *  mf_context: - multi-frame context used to associate contexts for multi-frame submission.
+ */
+VAStatus vaMFAddContext (
+    VADisplay dpy,
+    VAMFContextID mf_context,
+    VAContextID context
+);
+
+/**
+ * vaMFReleaseContext - Removes context from multi-frame and
+ *  association with multi-frame context.
+ *  After association removed vaEndPicture will submit tasks, but not vaMFSubmit.
+ *  Return values:
+ *  VA_STATUS_SUCCESS - operation successful, context was removed.
+ *  VA_STATUS_ERROR_OPERATION_FAILED - something unexpected happened.
+ *  application need to destroy this VAMFContextID and all assotiated VAContextID
+ *  dpy: display
+ *  mf_context: VAMFContextID where context is added
+ *  context: VAContextID to be added
+ */
+VAStatus vaMFReleaseContext (
+    VADisplay dpy,
+    VAMFContextID mf_context,
+    VAContextID context
+);
+
 /**
  * Buffers 
  * Buffers are used to pass various types of data from the
@@ -1286,6 +1412,9 @@ typedef struct _VAEncPackedHeaderParameterBuffer {
     uint32_t                bit_length;
     /** \brief Flag: buffer contains start code emulation prevention bytes? */
     uint8_t               has_emulation_bytes;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncPackedHeaderParameterBuffer;
 
 /**
@@ -1325,6 +1454,9 @@ typedef struct _VAEncMiscParameterTemporalLayerStructure
      * ids for frames starting from the 2nd frame.
      */
     uint32_t layer_id[32];
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterTemporalLayerStructure;
 
 
@@ -1358,10 +1490,14 @@ typedef struct _VAEncMiscParameterRateControl
              * The temporal layer that the rate control parameters are specified for.
              */
             uint32_t temporal_id : 8;
+            /** \brief Reserved for future use, must be zero */
             uint32_t reserved : 17;
         } bits;
         uint32_t value;
     } rc_flags;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_MEDIUM];
 } VAEncMiscParameterRateControl;
 
 typedef struct _VAEncMiscParameterFrameRate
@@ -1397,6 +1533,9 @@ typedef struct _VAEncMiscParameterFrameRate
          } bits;
          uint32_t value;
      } framerate_flags;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterFrameRate;
 
 /**
@@ -1407,6 +1546,9 @@ typedef struct _VAEncMiscParameterFrameRate
 typedef struct _VAEncMiscParameterMaxSliceSize
 {
     uint32_t max_slice_size;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterMaxSliceSize;
 
 typedef struct _VAEncMiscParameterAIR
@@ -1414,12 +1556,18 @@ typedef struct _VAEncMiscParameterAIR
     uint32_t air_num_mbs;
     uint32_t air_threshold;
     uint32_t air_auto; /* if set to 1 then hardware auto-tune the AIR threshold */
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterAIR;
 
 typedef struct _VAEncMiscParameterHRD
 {
     uint32_t initial_buffer_fullness;       /* in bits */
     uint32_t buffer_size;                   /* in bits */
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterHRD;
 
 /**
@@ -1436,6 +1584,9 @@ typedef struct _VAEncMiscParameterBufferMaxFrameSize {
     VAEncMiscParameterType      type;
     /** \brief Maximum size of a frame (in bits). */
     uint32_t                max_frame_size;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterBufferMaxFrameSize;
 
 /**
@@ -1454,6 +1605,9 @@ typedef struct _VAEncMiscParameterBufferQualityLevel {
      * level is used.
      */
     uint32_t                quality_level;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterBufferQualityLevel;
 
 /**
@@ -1478,6 +1632,9 @@ typedef struct _VAEncMiscParameterSkipFrame {
     /** \brief When skip_frame_flag = 1, the size of the skipped frames in bits.   When skip_frame_flag = 2, 
       * the size of the current skipped frame that is to be packed/encrypted in bits. */
     uint32_t                size_skip_frames;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterSkipFrame;
 
 /**
@@ -1548,6 +1705,9 @@ typedef struct _VAEncMiscParameterBufferROI {
         } bits;
         uint32_t value;
     } roi_flags;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncMiscParameterBufferROI;
 
 /**
@@ -1608,6 +1768,9 @@ typedef struct _VAHuffmanTableBufferJPEGBaseline {
         uint8_t   pad[2];
         /**@}*/
     }                   huffman_table[2];
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAHuffmanTableBufferJPEGBaseline;
 
 /****************************
@@ -1646,6 +1809,9 @@ typedef struct _VAPictureParameterBufferMPEG2
         } bits;
         uint32_t value;
     } picture_coding_extension;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAPictureParameterBufferMPEG2;
 
 /** MPEG-2 Inverse Quantization Matrix Buffer */
@@ -1667,6 +1833,9 @@ typedef struct _VAIQMatrixBufferMPEG2
     uint8_t chroma_intra_quantiser_matrix[64];
     /** \brief Chroma non-intra matrix, in zig-zag scan order. */
     uint8_t chroma_non_intra_quantiser_matrix[64];
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAIQMatrixBufferMPEG2;
 
 /** MPEG-2 Slice Parameter Buffer */
@@ -1680,6 +1849,9 @@ typedef struct _VASliceParameterBufferMPEG2
     uint32_t slice_vertical_position;
     int32_t quantiser_scale_code;
     int32_t intra_slice_flag;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VASliceParameterBufferMPEG2;
 
 /** MPEG-2 Macroblock Parameter Buffer */
@@ -1719,6 +1891,9 @@ typedef struct _VAMacroblockParameterBufferMPEG2
      
     /* Number of skipped macroblocks after this macroblock */
     uint16_t num_skipped_macroblocks;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAMacroblockParameterBufferMPEG2;
 
 /* 
@@ -1790,6 +1965,9 @@ typedef struct _VAPictureParameterBufferMPEG4
     /* for direct mode prediction */
     int16_t TRB;
     int16_t TRD;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAPictureParameterBufferMPEG4;
 
 /** MPEG-4 Inverse Quantization Matrix Buffer */
@@ -1803,6 +1981,9 @@ typedef struct _VAIQMatrixBufferMPEG4
     uint8_t intra_quant_mat[64];
     /** The matrix for non-intra blocks, in zig-zag scan order. */
     uint8_t non_intra_quant_mat[64];
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAIQMatrixBufferMPEG4;
 
 /** MPEG-4 Slice Parameter Buffer */
@@ -1814,6 +1995,9 @@ typedef struct _VASliceParameterBufferMPEG4
     uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
     uint32_t macroblock_number;
     int32_t quant_scale;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VASliceParameterBufferMPEG4;
 
 /**
@@ -1987,6 +2171,13 @@ typedef struct _VAPictureParameterBufferVC1
         } bits;
         uint32_t value;
     } transform_fields;
+
+    uint8_t luma_scale2;                  /* PICTURE_LAYER::LUMSCALE2 */
+    uint8_t luma_shift2;                  /* PICTURE_LAYER::LUMSHIFT2 */
+    uint8_t intensity_compensation_field; /* Index for PICTURE_LAYER::INTCOMPFIELD value in Table 109 (9.1.1.48) */
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_MEDIUM - 1];
 } VAPictureParameterBufferVC1;
 
 /** VC-1 Bitplane Buffer
@@ -2015,6 +2206,9 @@ typedef struct _VASliceParameterBufferVC1
     uint32_t slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
     uint32_t macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
     uint32_t slice_vertical_position;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VASliceParameterBufferVC1;
 
 /* VC-1 Slice Data Buffer */
@@ -2033,6 +2227,9 @@ typedef struct _VAPictureH264
     uint32_t flags;
     int32_t TopFieldOrderCnt;
     int32_t BottomFieldOrderCnt;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAPictureH264;
 /* flags in VAPictureH264 could be OR of the following */
 #define VA_PICTURE_H264_INVALID                        0x00000001
@@ -2095,6 +2292,9 @@ typedef struct _VAPictureParameterBufferH264
         uint32_t value;
     } pic_fields;
     uint16_t frame_num;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_MEDIUM];
 } VAPictureParameterBufferH264;
 
 /** H.264 Inverse Quantization Matrix Buffer */
@@ -2104,6 +2304,9 @@ typedef struct _VAIQMatrixBufferH264
     uint8_t ScalingList4x4[6][16];
     /** \brief 8x8 scaling list, in raster scan order. */
     uint8_t ScalingList8x8[2][64];
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAIQMatrixBufferH264;
 
 /** H.264 Slice Parameter Buffer */
@@ -2127,7 +2330,19 @@ typedef struct _VASliceParameterBufferH264
     uint16_t first_mb_in_slice;
     uint8_t slice_type;
     uint8_t direct_spatial_mv_pred_flag;
+    /**
+     * H264/AVC syntax element
+     *
+     * if num_ref_idx_active_override_flag equals 0, host decoder should
+     * set its value to num_ref_idx_l0_default_active_minus1.
+     */
     uint8_t num_ref_idx_l0_active_minus1;
+    /**
+     * H264/AVC syntax element
+     *
+     * if num_ref_idx_active_override_flag equals 0, host decoder should
+     * set its value to num_ref_idx_l1_default_active_minus1.
+     */
     uint8_t num_ref_idx_l1_active_minus1;
     uint8_t cabac_init_idc;
     int8_t slice_qp_delta;
@@ -2150,6 +2365,9 @@ typedef struct _VASliceParameterBufferH264
     uint8_t chroma_weight_l1_flag;
     int16_t chroma_weight_l1[32][2];
     int16_t chroma_offset_l1[32][2];
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VASliceParameterBufferH264;
 
 /****************************
@@ -2176,6 +2394,9 @@ typedef struct _VAEncSliceParameterBuffer
         } bits;
         uint32_t value;
     } slice_flags;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncSliceParameterBuffer;
 
 
@@ -2190,6 +2411,9 @@ typedef struct _VAEncSequenceParameterBufferH263
     uint32_t frame_rate;
     uint32_t initial_qp;
     uint32_t min_qp;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncSequenceParameterBufferH263;
 
 typedef struct _VAEncPictureParameterBufferH263
@@ -2200,6 +2424,9 @@ typedef struct _VAEncPictureParameterBufferH263
     uint16_t picture_width;
     uint16_t picture_height;
     VAEncPictureType picture_type;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncPictureParameterBufferH263;
 
 /****************************
@@ -2219,6 +2446,9 @@ typedef struct _VAEncSequenceParameterBufferMPEG4
     uint32_t frame_rate;
     uint32_t initial_qp;
     uint32_t min_qp;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncSequenceParameterBufferMPEG4;
 
 typedef struct _VAEncPictureParameterBufferMPEG4
@@ -2231,6 +2461,9 @@ typedef struct _VAEncPictureParameterBufferMPEG4
     uint32_t modulo_time_base; /* number of 1s */
     uint32_t vop_time_increment;
     VAEncPictureType picture_type;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAEncPictureParameterBufferMPEG4;
 
 
@@ -2263,6 +2496,28 @@ VAStatus vaCreateBuffer (
 );
 
 /**
+ * Create a buffer for given width & height get unit_size, pitch, buf_id for 2D buffer
+ * for permb qp buffer, it will return unit_size for one MB or LCU and the pitch for alignments
+ * can call vaMapBuffer with this Buffer ID to get virtual address.
+ * e.g. AVC 1080P encode, 1920x1088, the size in MB is 120x68,but inside driver,
+ * maybe it should align with 256, and one byte present one Qp.so, call the function.
+ * then get unit_size = 1, pitch = 256. call vaMapBuffer to get the virtual address (pBuf).
+ * then read write the memory like 2D. the size is 256x68, application can only use 120x68
+ * pBuf + 256 is the start of next line.
+ * different driver implementation maybe return different unit_size and pitch
+ */
+VAStatus vaCreateBuffer2(
+    VADisplay dpy,
+    VAContextID context,
+    VABufferType type,
+    unsigned int width,
+    unsigned int height,
+    unsigned int *unit_size,
+    unsigned int *pitch,
+    VABufferID *buf_id
+);
+
+/**
  * Convey to the server how many valid elements are in the buffer. 
  * e.g. if multiple slice parameters are being held in a single buffer,
  * this will communicate to the server the number of slice parameters
@@ -2341,6 +2596,9 @@ typedef  struct _VACodedBufferSegment  {
      * or \c NULL if there is none.
      */
     void               *next;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VACodedBufferSegment;
      
 /**
@@ -2398,6 +2656,9 @@ typedef struct {
     uint32_t            mem_type;
     /** \brief Size of the underlying buffer. */
     size_t              mem_size;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VABufferInfo;
 
 /**
@@ -2483,16 +2744,20 @@ vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info);
 VAStatus
 vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id);
 
-/*
-Render (Decode) Pictures
-
-A picture represents either a frame or a field.
-
-The Begin/Render/End sequence sends the decode buffers to the server
-*/
+/**
+ * Render (Video Decode/Encode/Processing) Pictures
+ *
+ * A picture represents either a frame or a field.
+ *
+ * The Begin/Render/End sequence sends the video decode/encode/processing buffers
+ * to the server
+ */
 
 /**
- * Get ready to decode a picture to a target surface
+ * Get ready for a video pipeline
+ * - decode a picture to a target surface
+ * - encode a picture from a target surface
+ * - process a picture to a target surface
  */
 VAStatus vaBeginPicture (
     VADisplay dpy,
@@ -2501,7 +2766,7 @@ VAStatus vaBeginPicture (
 );
 
 /**
- * Send decode buffers to the server.
+ * Send video decode, encode or processing buffers to the server.
  */
 VAStatus vaRenderPicture (
     VADisplay dpy,
@@ -2515,12 +2780,40 @@ VAStatus vaRenderPicture (
  * The server should start processing all pending operations for this 
  * surface. This call is non-blocking. The client can start another 
  * Begin/Render/End sequence on a different render target.
+ * if VAContextID used in this function previously successfully passed
+ * vaMFAddContext call, real processing will be started during vaMFSubmit
  */
 VAStatus vaEndPicture (
     VADisplay dpy,
     VAContextID context
 );
 
+/**
+ * Make the end of rendering for a pictures in contexts passed with submission.
+ * The server should start processing all pending operations for contexts.
+ * All contexts passed should be associated through vaMFAddContext
+ * and call sequence Begin/Render/End performed.
+ * This call is non-blocking. The client can start another
+ * Begin/Render/End/vaMFSubmit sequence on a different render targets.
+ * Return values:
+ * VA_STATUS_SUCCESS - operation successful, context was removed.
+ * VA_STATUS_ERROR_INVALID_CONTEXT - mf_context or one of contexts are invalid
+ * due to mf_context not created or one of contexts not assotiated with mf_context
+ * through vaAddContext.
+ * VA_STATUS_ERROR_INVALID_PARAMETER - one of context has not submitted it's frame
+ * through vaBeginPicture vaRenderPicture vaEndPicture call sequence.
+ * dpy: display
+ * mf_context: Multi-Frame context
+ * contexts: list of contexts submitting their tasks for multi-frame operation.
+ * num_contexts: number of passed contexts.
+ */
+VAStatus vaMFSubmit (
+    VADisplay dpy,
+    VAMFContextID mf_context,
+    VAContextID * contexts,
+    int num_contexts
+);
+
 /*
 
 Synchronization 
@@ -2572,6 +2865,9 @@ typedef struct _VASurfaceDecodeMBErrors
     uint32_t start_mb; /* start mb address with errors */
     uint32_t end_mb;  /* end mb address with errors */
     VADecodeErrorType decode_error_type;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VASurfaceDecodeMBErrors;
 
 /**
@@ -2664,6 +2960,9 @@ typedef struct _VAImageFormat
     uint32_t   green_mask;
     uint32_t   blue_mask;
     uint32_t   alpha_mask;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAImageFormat;
 
 typedef VAGenericID VAImageID;
@@ -2707,6 +3006,9 @@ typedef struct _VAImage
      * Only entry_bytes characters of the string are used.
      */
     int8_t component_order[4];
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAImage;
 
 /** Get maximum number of image formats supported by the implementation */
@@ -2982,6 +3284,23 @@ typedef enum
 #define VA_ROTATION_90          0x00000001
 #define VA_ROTATION_180         0x00000002
 #define VA_ROTATION_270         0x00000003
+/**@}*/
+
+/**
+ * @name Mirroring directions
+ *
+ * Those values could be used for VADisplayAttribMirror attribute or
+ * VAProcPipelineParameterBuffer::mirror_state.
+
+ */
+/**@{*/
+/** \brief No Mirroring. */
+#define VA_MIRROR_NONE              0x00000000
+/** \brief Horizontal Mirroring. */
+#define VA_MIRROR_HORIZONTAL        0x00000001
+/** \brief Vertical Mirroring. */
+#define VA_MIRROR_VERTICAL          0x00000002
+/**@}*/
 
 /** attribute value for VADisplayAttribOutOfLoopDeblock */
 #define VA_OOL_DEBLOCKING_FALSE 0x00000000
@@ -3086,6 +3405,9 @@ typedef struct _VADisplayAttribute
     int32_t value;     /* used by the set/get attribute functions */
 /* flags can be VA_DISPLAY_ATTRIB_GETTABLE or VA_DISPLAY_ATTRIB_SETTABLE or OR'd together */
     uint32_t flags;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VADisplayAttribute;
 
 /** Get maximum number of display attributs supported by the implementation */
@@ -3154,6 +3476,9 @@ typedef struct _VAPictureHEVC
     int32_t                 pic_order_cnt;
     /* described below */
     uint32_t                flags;
+
+    /** \brief Reserved bytes for future use, must be zero */
+    uint32_t                va_reserved[VA_PADDING_LOW];
 } VAPictureHEVC;
 
 /* flags in VAPictureHEVC could be OR of the following */