Configuration for VP8 decoding/encoding
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 27 Feb 2013 05:25:37 +0000 (13:25 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 27 Feb 2014 02:00:21 +0000 (10:00 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/i965_drv_video.c
src/i965_drv_video.h

index c6c0591..50bc0de 100755 (executable)
 
 #define HAS_TILED_SURFACE(ctx) ((ctx)->codec_info->has_tiled_surface)
 
+#define HAS_VP8_DECODING(ctx)   ((ctx)->codec_info->has_vp8_decoding && \
+                                 (ctx)->intel.has_bsd)
+
+#define HAS_VP8_ENCODING(ctx)   ((ctx)->codec_info->has_vp8_encoding && \
+                                 (ctx)->intel.has_bsd)
+
+
 static int get_sampling_from_fourcc(unsigned int fourcc);
 
 /* Check whether we are rendering to X11 (VA/X11 or VA/GLX API) */
@@ -413,6 +420,11 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
         profile_list[i++] = VAProfileJPEGBaseline;
     }
 
+    if (HAS_VP8_DECODING(i965) ||
+        HAS_VP8_ENCODING(i965)) {
+        profile_list[i++] = VAProfileVP8Version0_3;
+    }
+
     /* If the assert fails then I965_MAX_PROFILES needs to be bigger */
     assert(i <= I965_MAX_PROFILES);
     *num_profiles = i;
@@ -468,6 +480,13 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
             entrypoint_list[n++] = VAEntrypointVLD;
         break;
 
+    case VAProfileVP8Version0_3:
+        if (HAS_VP8_DECODING(i965))
+            entrypoint_list[n++] = VAEntrypointVLD;
+        
+        if (HAS_VP8_ENCODING(i965))
+            entrypoint_list[n++] = VAEntrypointEncSlice;
+
     default:
         break;
     }
@@ -621,6 +640,15 @@ i965_CreateConfig(VADriverContextP ctx,
 
         break;
 
+    case VAProfileVP8Version0_3:
+        if ((HAS_VP8_DECODING(i965) && VAEntrypointVLD == entrypoint) ||
+            (HAS_VP8_ENCODING(i965) && VAEntrypointEncSlice == entrypoint))
+            vaStatus = VA_STATUS_SUCCESS;
+        else
+            vaStatus = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+
+        break;
+
     default:
         vaStatus = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
         break;
@@ -1954,6 +1982,10 @@ i965_BeginPicture(VADriverContextP ctx,
         vaStatus = VA_STATUS_SUCCESS;
         break;
 
+    case VAProfileVP8Version0_3:
+        vaStatus = VA_STATUS_SUCCESS;
+        break;
+
     default:
         assert(0);
         vaStatus = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
index 773c8ca..a1dd971 100644 (file)
@@ -41,7 +41,7 @@
 #include "object_heap.h"
 #include "intel_driver.h"
 
-#define I965_MAX_PROFILES                       11
+#define I965_MAX_PROFILES                       20
 #define I965_MAX_ENTRYPOINTS                    5
 #define I965_MAX_CONFIG_ATTRIBUTES              10
 #define I965_MAX_IMAGE_FORMATS                  10
@@ -296,6 +296,8 @@ struct hw_codec_info
     unsigned int has_tiled_surface:1;
     unsigned int has_di_motion_adptive:1;
     unsigned int has_di_motion_compensated:1;
+    unsigned int has_vp8_decoding:1;
+    unsigned int has_vp8_encoding:1;
 
     unsigned int num_filters;
     struct i965_filter filters[VAProcFilterCount];