OSDN Git Service

va.h: fix comments error for arbitrary number of MBs per slice.
[android-x86/hardware-intel-common-libva.git] / va / va_dec_vp8.h
index 0f45d44..32830cb 100644 (file)
@@ -51,11 +51,15 @@ extern "C" {
 typedef struct _VABoolCoderContextVPX
 {
     /* partition 0 "range" */
-    unsigned short range;
+    unsigned char range;
     /* partition 0 "value" */
-    unsigned int value;
-    /* partition 0 number of shifts before an output byte is available */
-    unsigned short count;
+    unsigned char value;
+    /*
+     * 'partition 0 number of shifts before an output byte is available'
+     * it is the number of remaining bits in 'value' for decoding, range [0, 7].
+     */
+
+    unsigned char count;
 } VABoolCoderContextVPX;
 
 /**
@@ -83,7 +87,7 @@ typedef struct  _VAPictureParameterBufferVP8
 
     union {
         struct {
-           /* same as key_frame in bitstream syntax */
+           /* same as key_frame in bitstream syntax, 0 means a key frame */
             unsigned int key_frame                     : 1; 
            /* same as version in bitstream syntax */
             unsigned int version                       : 3;
@@ -107,8 +111,6 @@ typedef struct  _VAPictureParameterBufferVP8
             unsigned int sign_bias_alternate           : 1; 
            /* same as mb_no_coeff_skip in bitstream syntax */
             unsigned int mb_no_coeff_skip              : 1; 
-           /* see section 11.1 for mb_skip_coeff */
-            unsigned int mb_skip_coeff                 : 1; 
            /* flag to indicate that loop filter should be disabled */
             unsigned int loop_filter_disable           : 1; 
         } bits;
@@ -161,25 +163,40 @@ typedef struct  _VAPictureParameterBufferVP8
  * \brief VP8 Slice Parameter Buffer Structure
  *
  * This structure conveys parameters related to data partitions and should be 
- * sent once per frame.
+ * sent once per frame. Slice data buffer of VASliceDataBufferType is used
+ * to send the partition data.
  *
  */
 typedef struct  _VASliceParameterBufferVP8
 {
-    /* Partitions */
-    unsigned char num_of_partitions;
-    unsigned int partition_size[9];
-    /* 
-     * slice data buffer of VASliceDataBufferType is used to send the 
-     * partition data. This field specifies the offset to the first byte of 
-     * partition data in the buffer.
+    /*
+     * number of bytes in the slice data buffer for the partitions 
      */
-    unsigned int partition_data_offset;
-
+    unsigned int slice_data_size;
+    /*
+     * offset to the first byte of partition data (control partition)
+     */
+    unsigned int slice_data_offset;
     /*
-     * offset to the first bit of MB from the first byte of slice data buffer
+     * see VA_SLICE_DATA_FLAG_XXX definitions
+     */
+    unsigned int slice_data_flag; 
+    /*
+     * offset to the first bit of MB from the first byte of partition data(slice_data_offset)
      */
     unsigned int macroblock_offset;
+
+    /*
+     * Partitions
+     * (1<<log2_nbr_of_dct_partitions)+1, count both control partition (frame header) and toke partition
+     */
+    unsigned char num_of_partitions;
+    /*
+     * partition_size[0] is remaining bytes of control partition after parsed by application.
+     * exclude current byte for the remaining bits in bool_coder_ctx.
+     * exclude the uncompress data chunk since first_part_size 'excluding the uncompressed data chunk'
+     */
+    unsigned int partition_size[9];
 } VASliceParameterBufferVP8;
 
 /**
@@ -212,6 +229,7 @@ typedef struct _VAIQMatrixBufferVP8
 {
     /* 
      * array first dimensional is segment and 2nd dimensional is Q index
+     * all Q indexs should be clipped to be range [0, 127]
      */
     unsigned short quantization_index[4][6];
 } VAIQMatrixBufferVP8;