diff options
author | Li Xiaowei <xiaowei.a.li@intel.com> | 2013-12-10 10:35:38 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-06-16 11:53:35 +0800 |
commit | 40af27ded9830fa61dcf61d01c21551e1a148647 (patch) | |
tree | 4047f05e16449ec9111a770aafa7f07232ee4453 /src | |
parent | ab9de41941ea86e09e0ea2a170ebd2c84693a508 (diff) | |
download | libva-intel-driver-40af27ded9830fa61dcf61d01c21551e1a148647.tar.gz libva-intel-driver-40af27ded9830fa61dcf61d01c21551e1a148647.tar.bz2 libva-intel-driver-40af27ded9830fa61dcf61d01c21551e1a148647.zip |
MVC: CODEC_H264_MVC defination and relatived properties check
Signed-off-by: Li Xiaowei <xiaowei.a.li@intel.com>
(cherry picked from commit 7d1ddfd3646f35f306f38bfabef6af9b2ebb19f4)
Conflicts:
src/i965_drv_video.c
Diffstat (limited to 'src')
-rw-r--r-- | src/i965_device_info.c | 4 | ||||
-rwxr-xr-x | src/i965_drv_video.c | 40 | ||||
-rw-r--r-- | src/i965_drv_video.h | 3 | ||||
-rw-r--r-- | src/i965_encoder.c | 7 |
4 files changed, 51 insertions, 3 deletions
diff --git a/src/i965_device_info.c b/src/i965_device_info.c index 6fad106..c0b26e8 100644 --- a/src/i965_device_info.c +++ b/src/i965_device_info.c @@ -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 = { diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 00479cf..f23b449 100755 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -84,6 +84,11 @@ #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: diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h index 66c3466..75c66e9 100644 --- a/src/i965_drv_video.h +++ b/src/i965_drv_video.h @@ -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 diff --git a/src/i965_encoder.c b/src/i965_encoder.c index 0846a39..14c37bb 100644 --- a/src/i965_encoder.c +++ b/src/i965_encoder.c @@ -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); |