MVC: CODEC_H264_MVC defination and relatived properties check
authorLi Xiaowei <xiaowei.a.li@intel.com>
Tue, 10 Dec 2013 02:35:38 +0000 (10:35 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 16 Jun 2014 03:53:35 +0000 (11:53 +0800)
Signed-off-by: Li Xiaowei <xiaowei.a.li@intel.com>
(cherry picked from commit 7d1ddfd3646f35f306f38bfabef6af9b2ebb19f4)

Conflicts:
src/i965_drv_video.c

src/i965_device_info.c
src/i965_drv_video.c
src/i965_drv_video.h
src/i965_encoder.c

index 6fad106..c0b26e8 100644 (file)
@@ -179,6 +179,8 @@ static const struct hw_codec_info hsw_hw_codec_info = {
     .has_tiled_surface = 1,
     .has_di_motion_adptive = 1,
     .has_di_motion_compensated = 1,
+    .has_h264_mvc_decoding = 1,
+    .has_h264_mvc_encoding = 1,
 
     .num_filters = 5,
     .filters = {
@@ -221,6 +223,8 @@ static const struct hw_codec_info bdw_hw_codec_info = {
     .has_di_motion_adptive = 1,
     .has_di_motion_compensated = 1,
     .has_vp8_decoding = 1,
+    .has_h264_mvc_decoding = 1,
+    .has_h264_mvc_encoding = 1,
 
     .num_filters = 5,
     .filters = {
index 00479cf..f23b449 100755 (executable)
 #define HAS_VP8_ENCODING(ctx)   ((ctx)->codec_info->has_vp8_encoding && \
                                  (ctx)->intel.has_bsd)
 
+#define HAS_H264_MVC_DECODING(ctx)  ((ctx)->codec_info->has_h264_mvc_decoding && \
+                                     (ctx)->intel.has_bsd)
+
+#define HAS_H264_MVC_ENCODING(ctx)  ((ctx)->codec_info->has_h264_mvc_encoding && \
+                                     (ctx)->intel.has_bsd)
 
 static int get_sampling_from_fourcc(unsigned int fourcc);
 
@@ -405,6 +410,12 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
         profile_list[i++] = VAProfileVP8Version0_3;
     }
 
+    if (HAS_H264_MVC_DECODING(i965) ||
+        HAS_H264_MVC_ENCODING(i965)) {
+        profile_list[i++] = VAProfileH264MultiviewHigh;
+        profile_list[i++] = VAProfileH264StereoHigh;
+    }
+
     /* If the assert fails then I965_MAX_PROFILES needs to be bigger */
     ASSERT_RET(i <= I965_MAX_PROFILES, VA_STATUS_ERROR_OPERATION_FAILED);
     *num_profiles = i;
@@ -437,11 +448,19 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
     case VAProfileH264High:
         if (HAS_H264_DECODING(i965))
             entrypoint_list[n++] = VAEntrypointVLD;
-        
+
         if (HAS_H264_ENCODING(i965))
             entrypoint_list[n++] = VAEntrypointEncSlice;
 
         break;
+   case VAProfileH264MultiviewHigh:
+   case VAProfileH264StereoHigh:
+       if (HAS_H264_MVC_DECODING(i965))
+            entrypoint_list[n++] = VAEntrypointVLD;
+
+       if (HAS_H264_MVC_ENCODING(i965))
+            entrypoint_list[n++] = VAEntrypointEncSlice;
+        break;
 
     case VAProfileVC1Simple:
     case VAProfileVC1Main:
@@ -542,6 +561,17 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
         }
         break;
 
+    case VAProfileH264MultiviewHigh:
+    case VAProfileH264StereoHigh:
+        if ((HAS_H264_MVC_DECODING(i965) && VAEntrypointVLD == entrypoint) ||
+            (HAS_H264_MVC_ENCODING(i965) && VAEntrypointEncSlice == entrypoint)) {
+            va_status = VA_STATUS_SUCCESS;
+        } else {
+            va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+        }
+
+        break;
+
     default:
         va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
         break;
@@ -696,6 +726,7 @@ i965_CreateConfig(VADriverContextP ctx,
     VAStatus vaStatus;
 
     vaStatus = i965_validate_config(ctx, profile, entrypoint);
+
     if (VA_STATUS_SUCCESS != vaStatus) {
         return vaStatus;
     }
@@ -1956,7 +1987,8 @@ i965_MapBuffer(VADriverContextP ctx,
 
                 coded_buffer_segment->base.buf = buffer = (unsigned char *)(obj_buffer->buffer_store->bo->virtual) + I965_CODEDBUFFER_HEADER_SIZE;
 
-                if (coded_buffer_segment->codec == CODEC_H264) {
+                if (coded_buffer_segment->codec == CODEC_H264 ||
+                    coded_buffer_segment->codec == CODEC_H264_MVC) {
                     delimiter0 = H264_DELIMITER0;
                     delimiter1 = H264_DELIMITER1;
                     delimiter2 = H264_DELIMITER2;
@@ -2073,7 +2105,9 @@ i965_BeginPicture(VADriverContextP ctx,
     case VAProfileH264ConstrainedBaseline:
     case VAProfileH264Main:
     case VAProfileH264High:
-        vaStatus = VA_STATUS_SUCCESS;
+    case VAProfileH264MultiviewHigh:
+    case VAProfileH264StereoHigh:
+         vaStatus = VA_STATUS_SUCCESS;
         break;
 
     case VAProfileVC1Simple:
index 66c3466..75c66e9 100644 (file)
@@ -321,6 +321,8 @@ 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;
     struct i965_filter filters[VAProcFilterCount];
@@ -403,6 +405,7 @@ va_enc_packed_type_to_idx(int packed_type);
 /* reserve 2 byte for internal using */
 #define CODEC_H264      0
 #define CODEC_MPEG2     1
+#define CODEC_H264_MVC  2
 
 #define H264_DELIMITER0 0x00
 #define H264_DELIMITER1 0x00
index 0846a39..14c37bb 100644 (file)
@@ -258,6 +258,8 @@ intel_encoder_sanity_check_input(VADriverContextP ctx,
     case VAProfileH264ConstrainedBaseline:
     case VAProfileH264Main:
     case VAProfileH264High:
+    case VAProfileH264MultiviewHigh:
+    case VAProfileH264StereoHigh:
         vaStatus = intel_encoder_check_avc_parameter(ctx, encode_state, encoder_context);
         break;
 
@@ -346,6 +348,11 @@ intel_enc_hw_context_init(VADriverContextP ctx,
         encoder_context->codec = CODEC_H264;
         break;
 
+    case VAProfileH264StereoHigh:
+    case VAProfileH264MultiviewHigh:
+        encoder_context->codec = CODEC_H264_MVC;
+        break;
+
     default:
         /* Never get here */
         assert(0);