summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-06-03 17:30:11 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-06-06 14:32:41 +0200
commit1f244834dedb7b46863b315a898d8649d01c5f58 (patch)
treee5dcdb36799446da946249c87fee26bcfa95158c
parent8dfdf10612c726b60ecd5b61eee2b7d6a520bb33 (diff)
decoder: h264: expose the set of supported MVC profiles.
H.264 MVC decoding support is defined as follows: - Stereo High profile on Sandybridge and newer ; - Multiview High profile on Haswell and newer. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rwxr-xr-xsrc/gen6_mfd.c1
-rw-r--r--src/gen75_mfd.c4
-rwxr-xr-xsrc/gen7_mfd.c2
-rw-r--r--src/gen8_mfd.c4
-rw-r--r--src/i965_decoder_utils.c2
-rwxr-xr-xsrc/i965_device_info.c12
-rwxr-xr-xsrc/i965_drv_video.c36
-rw-r--r--src/i965_drv_video.h2
-rw-r--r--src/va_backend_compat.h5
9 files changed, 58 insertions, 10 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c
index 8c09f39..f13a75c 100755
--- a/src/gen6_mfd.c
+++ b/src/gen6_mfd.c
@@ -1868,6 +1868,7 @@ gen6_mfd_decode_picture(VADriverContextP ctx,
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
gen6_mfd_avc_decode_picture(ctx, decode_state, gen6_mfd_context);
break;
diff --git a/src/gen75_mfd.c b/src/gen75_mfd.c
index bab5df4..aaee807 100644
--- a/src/gen75_mfd.c
+++ b/src/gen75_mfd.c
@@ -3141,6 +3141,8 @@ gen75_mfd_decode_picture(VADriverContextP ctx,
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
+ case VAProfileH264MultiviewHigh:
gen75_mfd_avc_decode_picture(ctx, decode_state, gen7_mfd_context);
break;
@@ -3235,6 +3237,8 @@ gen75_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
+ case VAProfileH264MultiviewHigh:
gen75_mfd_avc_context_init(ctx, gen7_mfd_context);
break;
default:
diff --git a/src/gen7_mfd.c b/src/gen7_mfd.c
index e7f188c..db35abf 100755
--- a/src/gen7_mfd.c
+++ b/src/gen7_mfd.c
@@ -2612,6 +2612,7 @@ gen7_mfd_decode_picture(VADriverContextP ctx,
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
gen7_mfd_avc_decode_picture(ctx, decode_state, gen7_mfd_context);
break;
@@ -2706,6 +2707,7 @@ gen7_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
gen7_mfd_avc_context_init(ctx, gen7_mfd_context);
break;
default:
diff --git a/src/gen8_mfd.c b/src/gen8_mfd.c
index 0b39dac..4e24f55 100644
--- a/src/gen8_mfd.c
+++ b/src/gen8_mfd.c
@@ -3062,6 +3062,8 @@ gen8_mfd_decode_picture(VADriverContextP ctx,
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
+ case VAProfileH264MultiviewHigh:
gen8_mfd_avc_decode_picture(ctx, decode_state, gen7_mfd_context);
break;
@@ -3162,6 +3164,8 @@ gen8_dec_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
+ case VAProfileH264MultiviewHigh:
gen8_mfd_avc_context_init(ctx, gen7_mfd_context);
break;
default:
diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c
index f163516..fd07e56 100644
--- a/src/i965_decoder_utils.c
+++ b/src/i965_decoder_utils.c
@@ -914,6 +914,8 @@ intel_decoder_sanity_check_input(VADriverContextP ctx,
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ case VAProfileH264StereoHigh:
+ case VAProfileH264MultiviewHigh:
vaStatus = intel_decoder_check_avc_parameter(ctx, profile, decode_state);
break;
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index 429c403..e93cdcc 100755
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -36,6 +36,10 @@
(VA_RT_FORMAT_YUV400 | VA_RT_FORMAT_YUV411 | VA_RT_FORMAT_YUV422 | \
VA_RT_FORMAT_YUV444)
+/* Defines VA profile as a 32-bit unsigned integer mask */
+#define VA_PROFILE_MASK(PROFILE) \
+ (1U << VAProfile##PROFILE)
+
extern struct hw_context *i965_proc_context_init(VADriverContextP, struct object_config *);
extern struct hw_context *g4x_dec_hw_context_init(VADriverContextP, struct object_config *);
extern bool genx_render_init(VADriverContextP);
@@ -94,6 +98,7 @@ static const struct hw_codec_info snb_hw_codec_info = {
.min_linear_wpitch = 16,
.min_linear_hpitch = 16,
+ .h264_mvc_dec_profiles = VA_PROFILE_MASK(H264StereoHigh),
.h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
.has_mpeg2_decoding = 1,
@@ -128,6 +133,7 @@ static const struct hw_codec_info ivb_hw_codec_info = {
.min_linear_wpitch = 64,
.min_linear_hpitch = 16,
+ .h264_mvc_dec_profiles = VA_PROFILE_MASK(H264StereoHigh),
.h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
.jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
@@ -166,6 +172,8 @@ static const struct hw_codec_info hsw_hw_codec_info = {
.min_linear_wpitch = 64,
.min_linear_hpitch = 16,
+ .h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
+ VA_PROFILE_MASK(H264MultiviewHigh)),
.h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
.jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
@@ -182,7 +190,6 @@ static const struct hw_codec_info hsw_hw_codec_info = {
.has_di_motion_adptive = 1,
.has_di_motion_compensated = 1,
.has_blending = 1,
- .has_h264_mvc_decoding = 1,
.has_h264_mvc_encoding = 1,
.num_filters = 5,
@@ -210,6 +217,8 @@ static const struct hw_codec_info bdw_hw_codec_info = {
.min_linear_wpitch = 64,
.min_linear_hpitch = 16,
+ .h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
+ VA_PROFILE_MASK(H264MultiviewHigh)),
.h264_dec_chroma_formats = EXTRA_H264_DEC_CHROMA_FORMATS,
.jpeg_dec_chroma_formats = EXTRA_JPEG_DEC_CHROMA_FORMATS,
@@ -227,7 +236,6 @@ static const struct hw_codec_info bdw_hw_codec_info = {
.has_di_motion_compensated = 1,
.has_vp8_decoding = 1,
.has_blending = 1,
- .has_h264_mvc_decoding = 1,
.has_h264_mvc_encoding = 1,
.num_filters = 5,
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index a673a94..df625bb 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -86,8 +86,12 @@
#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_DECODING(ctx) \
+ (HAS_H264_DECODING(ctx) && (ctx)->codec_info->h264_mvc_dec_profiles)
+
+#define HAS_H264_MVC_DECODING_PROFILE(ctx, profile) \
+ (HAS_H264_MVC_DECODING(ctx) && \
+ ((ctx)->codec_info->h264_mvc_dec_profiles & (1U << profile)))
#define HAS_H264_MVC_ENCODING(ctx) ((ctx)->codec_info->has_h264_mvc_encoding && \
(ctx)->intel.has_bsd)
@@ -392,6 +396,10 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
profile_list[i++] = VAProfileH264Main;
profile_list[i++] = VAProfileH264High;
}
+ if (HAS_H264_MVC_DECODING_PROFILE(i965, VAProfileH264MultiviewHigh))
+ profile_list[i++] = VAProfileH264MultiviewHigh;
+ if (HAS_H264_MVC_DECODING_PROFILE(i965, VAProfileH264StereoHigh))
+ profile_list[i++] = VAProfileH264StereoHigh;
if (HAS_VC1_DECODING(i965)) {
profile_list[i++] = VAProfileVC1Simple;
@@ -412,8 +420,7 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
profile_list[i++] = VAProfileVP8Version0_3;
}
- if (HAS_H264_MVC_DECODING(i965) ||
- HAS_H264_MVC_ENCODING(i965)) {
+ if (HAS_H264_MVC_ENCODING(i965)) {
profile_list[i++] = VAProfileH264MultiviewHigh;
profile_list[i++] = VAProfileH264StereoHigh;
}
@@ -457,7 +464,7 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
break;
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
- if (HAS_H264_MVC_DECODING(i965))
+ if (HAS_H264_MVC_DECODING_PROFILE(i965, profile))
entrypoint_list[n++] = VAEntrypointVLD;
if (HAS_H264_MVC_ENCODING(i965))
@@ -565,7 +572,8 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
- if ((HAS_H264_MVC_DECODING(i965) && entrypoint == VAEntrypointVLD) ||
+ if ((HAS_H264_MVC_DECODING_PROFILE(i965, profile) &&
+ entrypoint == VAEntrypointVLD) ||
(HAS_H264_MVC_ENCODING(i965) && entrypoint == VAEntrypointEncSlice)) {
va_status = VA_STATUS_SUCCESS;
} else {
@@ -1732,6 +1740,12 @@ i965_CreateContext(VADriverContextP ctx,
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
render_state->interleaved_uv = 1;
break;
+ case VAProfileH264MultiviewHigh:
+ case VAProfileH264StereoHigh:
+ if (!HAS_H264_MVC_DECODING(i965))
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+ render_state->interleaved_uv = 1;
+ break;
default:
render_state->interleaved_uv = !!(IS_GEN6(i965->intel.device_info) || IS_GEN7(i965->intel.device_info) || IS_GEN8(i965->intel.device_info));
break;
@@ -2161,9 +2175,17 @@ i965_BeginPicture(VADriverContextP ctx,
case VAProfileH264ConstrainedBaseline:
case VAProfileH264Main:
case VAProfileH264High:
+ vaStatus = VA_STATUS_SUCCESS;
+ break;
+
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
- vaStatus = VA_STATUS_SUCCESS;
+ if (HAS_H264_MVC_DECODING_PROFILE(i965, obj_config->profile) ||
+ HAS_H264_MVC_ENCODING(i965)) {
+ vaStatus = VA_STATUS_SUCCESS;
+ } else {
+ ASSERT_RET(0, VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
+ }
break;
case VAProfileVC1Simple:
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index 418c277..3ae6c25 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -325,6 +325,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;
@@ -345,7 +346,6 @@ struct hw_codec_info
unsigned int has_blending: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;
diff --git a/src/va_backend_compat.h b/src/va_backend_compat.h
index f5c9f75..8767153 100644
--- a/src/va_backend_compat.h
+++ b/src/va_backend_compat.h
@@ -45,4 +45,9 @@
# define VA_DRM_AUTH_CUSTOM VA_DUMMY
#endif
+#if !VA_CHECK_VERSION(0,35,2)
+# define VAProfileH264MultiviewHigh 15
+# define VAProfileH264StereoHigh 16
+#endif
+
#endif /* VA_BACKEND_COMPAT_H */