[Libva] [PATCH V3: 3/4] HEVC10bit ENC:enable hevc 10bit encoding pipeline
Pengfei Qu
Pengfei.Qu at intel.com
Tue Sep 6 00:09:30 UTC 2016
Signed-off-by: Pengfei Qu <Pengfei.Qu at intel.com>
---
src/i965_device_info.c | 1 +
src/i965_drv_video.c | 20 +++++++++++++++-----
src/i965_drv_video.h | 1 +
src/i965_encoder.c | 18 +++++++++++++-----
4 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index 47fd50a..1633924 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -469,6 +469,7 @@ static struct hw_codec_info kbl_hw_codec_info = {
.has_h264_mvc_encoding = 1,
.has_hevc_decoding = 1,
.has_hevc_encoding = 1,
+ .has_hevc10_encoding = 1,
.has_hevc10_decoding = 1,
.has_vp9_decoding = 1,
.has_vpp_p010 = 1,
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 77b9f37..9e9393e 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -120,6 +120,8 @@
#define HAS_HEVC10_DECODING(ctx) ((ctx)->codec_info->has_hevc10_decoding && \
(ctx)->intel.has_bsd)
+#define HAS_HEVC10_ENCODING(ctx) ((ctx)->codec_info->has_hevc10_encoding && \
+ (ctx)->intel.has_bsd)
#define HAS_VPP_P010(ctx) ((ctx)->codec_info->has_vpp_p010 && \
(ctx)->intel.has_bsd)
@@ -605,7 +607,8 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
profile_list[i++] = VAProfileHEVCMain;
}
- if (HAS_HEVC10_DECODING(i965)) {
+ if (HAS_HEVC10_DECODING(i965)||
+ HAS_HEVC10_ENCODING(i965)) {
profile_list[i++] = VAProfileHEVCMain10;
}
@@ -728,6 +731,9 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
if (HAS_HEVC10_DECODING(i965))
entrypoint_list[n++] = VAEntrypointVLD;
+ if (HAS_HEVC10_ENCODING(i965))
+ entrypoint_list[n++] = VAEntrypointEncSlice;
+
break;
case VAProfileVP9Profile0:
@@ -852,7 +858,8 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
break;
case VAProfileHEVCMain10:
- if (HAS_HEVC10_DECODING(i965) && (entrypoint == VAEntrypointVLD))
+ if ((HAS_HEVC10_DECODING(i965) && (entrypoint == VAEntrypointVLD))||
+ (HAS_HEVC10_ENCODING(i965) && (entrypoint == VAEntrypointEncSlice)))
va_status = VA_STATUS_SUCCESS;
else
va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
@@ -988,7 +995,8 @@ i965_GetConfigAttributes(VADriverContextP ctx,
profile == VAProfileH264High ||
profile == VAProfileH264StereoHigh ||
profile == VAProfileH264MultiviewHigh ||
- profile == VAProfileHEVCMain) {
+ profile == VAProfileHEVCMain ||
+ profile == VAProfileHEVCMain10) {
attrib_list[i].value |= (VA_ENC_PACKED_HEADER_RAW_DATA |
VA_ENC_PACKED_HEADER_SLICE);
}
@@ -3270,7 +3278,8 @@ i965_encoder_render_picture(VADriverContextP ctx,
if ((param->type == VAEncPackedHeaderRawData) ||
(param->type == VAEncPackedHeaderSlice)) {
vaStatus = I965_RENDER_ENCODE_BUFFER(packed_header_params_ext);
- } else if((obj_config->profile == VAProfileHEVCMain) &&
+ } else if((obj_config->profile == VAProfileHEVCMain ||
+ obj_config->profile == VAProfileHEVCMain10) &&
(encode->last_packed_header_type == VAEncPackedHeaderSequence)) {
vaStatus = i965_encoder_render_packed_header_parameter_buffer(ctx,
obj_context,
@@ -3368,7 +3377,8 @@ i965_encoder_render_picture(VADriverContextP ctx,
((encode->last_packed_header_type & (~VAEncPackedHeaderMiscMask)) != 0)),
VA_STATUS_ERROR_ENCODING_ERROR);
- if((obj_config->profile == VAProfileHEVCMain) &&
+ if((obj_config->profile == VAProfileHEVCMain ||
+ obj_config->profile == VAProfileHEVCMain10) &&
(encode->last_packed_header_type == VAEncPackedHeaderSequence)) {
vaStatus = i965_encoder_render_packed_header_data_buffer(ctx,
diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
index 9fe042f..d9644a7 100644
--- a/src/i965_drv_video.h
+++ b/src/i965_drv_video.h
@@ -404,6 +404,7 @@ struct hw_codec_info
unsigned int has_h264_mvc_encoding:1;
unsigned int has_hevc_decoding:1;
unsigned int has_hevc_encoding:1;
+ unsigned int has_hevc10_encoding:1;
unsigned int has_hevc10_decoding:1;
unsigned int has_vp9_decoding:1;
unsigned int has_vpp_p010:1;
diff --git a/src/i965_encoder.c b/src/i965_encoder.c
index 47368fb..0304d4a 100644
--- a/src/i965_encoder.c
+++ b/src/i965_encoder.c
@@ -126,9 +126,15 @@ intel_encoder_check_yuv_surface(VADriverContextP ctx,
if (!obj_surface || !obj_surface->bo)
return VA_STATUS_ERROR_INVALID_PARAMETER;
- if (obj_surface->fourcc == VA_FOURCC_NV12) {
- unsigned int tiling = 0, swizzle = 0;
+ if (VAProfileHEVCMain10 == profile &&
+ obj_surface->fourcc != VA_FOURCC_P010)
+ return VA_STATUS_ERROR_INVALID_PARAMETER;
+
+ if (obj_surface->fourcc == VA_FOURCC_NV12 ||
+ (VAProfileHEVCMain10 == profile &&
+ obj_surface->fourcc == VA_FOURCC_P010)) {
+ unsigned int tiling = 0, swizzle = 0;
dri_bo_get_tiling(obj_surface->bo, &tiling, &swizzle);
if (tiling == I915_TILING_Y) {
@@ -493,7 +499,7 @@ intel_encoder_check_vp8_parameter(VADriverContextP ctx,
if (!obj_surface)
goto error;
- encode_state->reconstructed_object = obj_surface;
+ encode_state->reconstructed_object = obj_surface;
obj_buffer = BUFFER(pic_param->coded_buf);
assert(obj_buffer && obj_buffer->buffer_store && obj_buffer->buffer_store->bo);
@@ -725,7 +731,8 @@ intel_encoder_sanity_check_input(VADriverContextP ctx,
break;
}
- case VAProfileHEVCMain: {
+ case VAProfileHEVCMain:
+ case VAProfileHEVCMain10: {
vaStatus = intel_encoder_check_hevc_parameter(ctx, encode_state, encoder_context);
if (vaStatus != VA_STATUS_SUCCESS)
goto out;
@@ -867,6 +874,7 @@ intel_enc_hw_context_init(VADriverContextP ctx,
break;
case VAProfileHEVCMain:
+ case VAProfileHEVCMain10:
encoder_context->codec = CODEC_HEVC;
break;
@@ -947,7 +955,7 @@ gen9_enc_hw_context_init(VADriverContextP ctx, struct object_config *obj_config)
if (obj_config->entrypoint == VAEntrypointEncSliceLP) {
return intel_enc_hw_context_init(ctx, obj_config, NULL, gen9_vdenc_context_init);
} else {
- if (obj_config->profile == VAProfileHEVCMain) {
+ if ((obj_config->profile == VAProfileHEVCMain) || (obj_config->profile == VAProfileHEVCMain10)) {
return intel_enc_hw_context_init(ctx, obj_config, gen9_vme_context_init, gen9_hcpe_context_init);
} else if (obj_config->profile == VAProfileJPEGBaseline)
return intel_enc_hw_context_init(ctx, obj_config, gen8_vme_context_init, gen8_mfc_context_init);
--
2.7.4
More information about the Libva
mailing list