summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-06-03 17:30:11 +0200
committerXiang, Haihao <haihao.xiang@intel.com>2014-06-16 11:53:35 +0800
commit585596a468db65e93b618b7aabe4e46d23de7b1f (patch)
tree37c454dbab0c34df0c2abfdec9384db0b806fe68 /src
parentd07f1e3c6505b169f59f075b5ea5a82331118f8f (diff)
downloadlibva-intel-driver-585596a468db65e93b618b7aabe4e46d23de7b1f.tar.gz
libva-intel-driver-585596a468db65e93b618b7aabe4e46d23de7b1f.tar.bz2
libva-intel-driver-585596a468db65e93b618b7aabe4e46d23de7b1f.zip
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> (cherry picked from commit 1f244834dedb7b46863b315a898d8649d01c5f58) Conflicts: src/i965_device_info.c src/i965_drv_video.c src/va_backend_compat.h
Diffstat (limited to 'src')
-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
-rw-r--r--src/i965_device_info.c12
-rwxr-xr-xsrc/i965_drv_video.c38
-rw-r--r--src/i965_drv_video.h2
-rw-r--r--src/va_backend_compat.h6
9 files changed, 54 insertions, 17 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c
index 113561c..e22e57a 100755
--- a/src/gen6_mfd.c
+++ b/src/gen6_mfd.c
@@ -1858,6 +1858,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 9af57c2..7e3d33a 100644
--- a/src/i965_decoder_utils.c
+++ b/src/i965_decoder_utils.c
@@ -919,6 +919,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 c0b26e8..9573b7d 100644
--- 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,
@@ -127,6 +132,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,
@@ -164,6 +170,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,
@@ -179,7 +187,6 @@ 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,
@@ -207,6 +214,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,
@@ -223,7 +232,6 @@ 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,
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index f23b449..403acde 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -84,8 +84,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)
@@ -390,6 +394,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;
@@ -410,8 +418,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;
}
@@ -455,7 +462,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))
@@ -563,8 +570,9 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
case VAProfileH264MultiviewHigh:
case VAProfileH264StereoHigh:
- if ((HAS_H264_MVC_DECODING(i965) && VAEntrypointVLD == entrypoint) ||
- (HAS_H264_MVC_ENCODING(i965) && VAEntrypointEncSlice == entrypoint)) {
+ if ((HAS_H264_MVC_DECODING_PROFILE(i965, profile) &&
+ entrypoint == VAEntrypointVLD) ||
+ (HAS_H264_MVC_ENCODING(i965) && entrypoint == VAEntrypointEncSlice)) {
va_status = VA_STATUS_SUCCESS;
} else {
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
@@ -1695,6 +1703,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;
@@ -2105,9 +2119,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 75c66e9..e25b9c8 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -302,6 +302,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;
@@ -321,7 +322,6 @@ 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;
diff --git a/src/va_backend_compat.h b/src/va_backend_compat.h
index 5fcb198..8767153 100644
--- a/src/va_backend_compat.h
+++ b/src/va_backend_compat.h
@@ -45,12 +45,6 @@
# define VA_DRM_AUTH_CUSTOM VA_DUMMY
#endif
-#if !VA_CHECK_VERSION(0,35,1)
-
-#define VAProcFilterSkinToneEnhancement 5
-
-#endif
-
#if !VA_CHECK_VERSION(0,35,2)
# define VAProfileH264MultiviewHigh 15
# define VAProfileH264StereoHigh 16