[Libva] [PATCH 1/3] Add VAEntrypointEncFEIIntel support

Zhao, Yakui yakui.zhao at intel.com
Tue May 13 17:48:00 PDT 2014


On Tue, 2014-05-13 at 03:20 -0600, Zhong Li wrote:
> Support VAEncFEIMVBufferTypeIntel and VAEntrypointEncFEIIntel
> 
> Signed-off-by: Zhong Li <zhong.li at intel.com>
> ---
>  src/i965_drv_video.c |   37 ++++++++++++++++++++++++-------------
>  src/i965_drv_video.h |    1 +
>  2 files changed, 25 insertions(+), 13 deletions(-)
> 
> diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
> index fa51651..e505e4a 100755
> --- a/src/i965_drv_video.c
> +++ b/src/i965_drv_video.c
> @@ -340,8 +340,10 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
>          if (HAS_H264_DECODING(i965))
>              entrypoint_list[n++] = VAEntrypointVLD;
>  
> -        if (HAS_H264_ENCODING(i965))
> +        if (HAS_H264_ENCODING(i965)) {
>              entrypoint_list[n++] = VAEntrypointEncSlice;
> +            entrypoint_list[n++] = VAEntrypointEncFEIIntel;
> +        }

Is this implemented on all the platforms supporting the encoding?
   
If not, it will be better that you can add some restrictions before it
is supported by all the platforms.

Thanks.
    Yakui
>  
>          break;
>     case VAProfileH264MultiviewHigh:
> @@ -405,7 +407,7 @@ i965_GetConfigAttributes(VADriverContextP ctx,
>              break;
>  
>          case VAConfigAttribRateControl:
> -            if (entrypoint == VAEntrypointEncSlice) {
> +            if (entrypoint == VAEntrypointEncFEIIntel || entrypoint == VAEntrypointEncSlice) {
>                  attrib_list[i].value = VA_RC_CQP;
>  
>                  if (profile != VAProfileMPEG2Main &&
> @@ -415,13 +417,13 @@ i965_GetConfigAttributes(VADriverContextP ctx,
>              }
>  
>          case VAConfigAttribEncPackedHeaders:
> -            if (entrypoint == VAEntrypointEncSlice) {
> +            if (entrypoint == VAEntrypointEncFEIIntel || entrypoint == VAEntrypointEncSlice) {
>                  attrib_list[i].value = VA_ENC_PACKED_HEADER_SEQUENCE | VA_ENC_PACKED_HEADER_PICTURE | VA_ENC_PACKED_HEADER_MISC;
>                  break;
>              }
>  
>  	case VAConfigAttribEncMaxRefFrames:
> -	    if (entrypoint == VAEntrypointEncSlice) {
> +           if (entrypoint == VAEntrypointEncFEIIntel || entrypoint == VAEntrypointEncSlice) {
>  		attrib_list[i].value = (1 << 16) | (1 << 0);
>  		break;
>  	    }
> @@ -497,7 +499,8 @@ i965_CreateConfig(VADriverContextP ctx,
>      case VAProfileH264Main:
>      case VAProfileH264High:
>          if ((HAS_H264_DECODING(i965) && VAEntrypointVLD == entrypoint) ||
> -            (HAS_H264_ENCODING(i965) && VAEntrypointEncSlice == entrypoint)) {
> +            (HAS_H264_ENCODING(i965) &&
> +            ((VAEntrypointEncFEIIntel == entrypoint) || (VAEntrypointEncSlice == entrypoint)))) {
>              vaStatus = VA_STATUS_SUCCESS;
>          } else {
>              vaStatus = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
> @@ -1563,7 +1566,8 @@ i965_CreateContext(VADriverContextP ctx,
>              obj_context->codec_state.proc.current_render_target = VA_INVALID_ID;
>              assert(i965->codec_info->proc_hw_context_init);
>              obj_context->hw_context = i965->codec_info->proc_hw_context_init(ctx, obj_config);
> -        } else if (VAEntrypointEncSlice == obj_config->entrypoint) { /*encode routin only*/
> +        } else if (VAEntrypointEncFEIIntel == obj_config->entrypoint || 
> +                   VAEntrypointEncSlice == obj_config->entrypoint) { /*encode routin only*/
>              obj_context->codec_type = CODEC_ENC;
>              memset(&obj_context->codec_state.encode, 0, sizeof(obj_context->codec_state.encode));
>              obj_context->codec_state.encode.current_render_target = VA_INVALID_ID;
> @@ -1663,6 +1667,7 @@ i965_create_buffer_internal(VADriverContextP ctx,
>      case VAProcFilterParameterBufferType:
>      case VAHuffmanTableBufferType:
>      case VAProbabilityBufferType:
> +    case VAEncFEIMVBufferTypeIntel:
>          /* Ok */
>          break;
>  
> @@ -2326,7 +2331,8 @@ i965_RenderPicture(VADriverContextP ctx,
>  
>      if (VAEntrypointVideoProc == obj_config->entrypoint) {
>          vaStatus = i965_proc_render_picture(ctx, context, buffers, num_buffers);
> -    } else if (VAEntrypointEncSlice == obj_config->entrypoint ) {
> +    } else if (VAEntrypointEncFEIIntel == obj_config->entrypoint || 
> +               VAEntrypointEncSlice == obj_config->entrypoint ) {
>          vaStatus = i965_encoder_render_picture(ctx, context, buffers, num_buffers);
>      } else {
>          vaStatus = i965_decoder_render_picture(ctx, context, buffers, num_buffers);
> @@ -2349,7 +2355,7 @@ i965_EndPicture(VADriverContextP ctx, VAContextID context)
>      if (obj_context->codec_type == CODEC_PROC) {
>          ASSERT_RET(VAEntrypointVideoProc == obj_config->entrypoint, VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
>      } else if (obj_context->codec_type == CODEC_ENC) {
> -        ASSERT_RET(VAEntrypointEncSlice == obj_config->entrypoint, VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
> +        ASSERT_RET(VAEntrypointEncFEIIntel == obj_config->entrypoint || VAEntrypointEncSlice == obj_config->entrypoint, VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
>  
>          if (!(obj_context->codec_state.encode.pic_param ||
>                  obj_context->codec_state.encode.pic_param_ext)) {
> @@ -4326,7 +4332,8 @@ i965_GetSurfaceAttributes(
>                          attrib_list[i].flags = VA_SURFACE_ATTRIB_NOT_SUPPORTED;
>                      }
>                  } else if (IS_GEN6(i965->intel.device_info)) {
> -                    if (obj_config->entrypoint == VAEntrypointEncSlice ||
> +                    if (obj_config->entrypoint == VAEntrypointEncFEIIntel ||
> +                        obj_config->entrypoint == VAEntrypointEncSlice ||
>                          obj_config->entrypoint == VAEntrypointVideoProc) {
>                          switch (attrib_list[i].value.value.i) {
>                          case VA_FOURCC_NV12:
> @@ -4351,7 +4358,8 @@ i965_GetSurfaceAttributes(
>                      }
>                  } else if (IS_GEN7(i965->intel.device_info) ||
>                             IS_GEN8(i965->intel.device_info)) {
> -                    if (obj_config->entrypoint == VAEntrypointEncSlice ||
> +                    if (obj_config->entrypoint == VAEntrypointEncFEIIntel ||
> +                        obj_config->entrypoint == VAEntrypointEncSlice ||
>                          obj_config->entrypoint == VAEntrypointVideoProc) {
>                          switch (attrib_list[i].value.value.i) {
>                          case VA_FOURCC_NV12:
> @@ -4488,7 +4496,8 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx,
>              attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
>              attribs[i].value.value.i = VA_FOURCC_NV12;
>              i++;
> -        } else if (obj_config->entrypoint == VAEntrypointEncSlice ||  /* encode */
> +        } else if (obj_config->entrypoint == VAEntrypointEncFEIIntel ||
> +                   obj_config->entrypoint == VAEntrypointEncSlice ||  /* encode */
>                     obj_config->entrypoint == VAEntrypointVideoProc) { /* vpp */ 
>              attribs[i].type = VASurfaceAttribPixelFormat;
>              attribs[i].value.type = VAGenericValueTypeInteger;
> @@ -4579,7 +4588,8 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx,
>                  attribs[i].value.value.i = VA_FOURCC_NV12;
>                  i++;
>              }
> -        } else if (obj_config->entrypoint == VAEntrypointEncSlice ||  /* encode */
> +        } else if (obj_config->entrypoint == VAEntrypointEncFEIIntel ||
> +                   obj_config->entrypoint == VAEntrypointEncSlice ||  /* encode */
>                     obj_config->entrypoint == VAEntrypointVideoProc) { /* vpp */ 
>              attribs[i].type = VASurfaceAttribPixelFormat;
>              attribs[i].value.type = VAGenericValueTypeInteger;
> @@ -4682,7 +4692,8 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx,
>                  attribs[i].value.value.i = VA_FOURCC_NV12;
>                  i++;
>              }
> -        } else if (obj_config->entrypoint == VAEntrypointEncSlice ||  /* encode */
> +        } else if (obj_config->entrypoint == VAEntrypointEncFEIIntel ||
> +                   obj_config->entrypoint == VAEntrypointEncSlice ||  /* encode */
>                     obj_config->entrypoint == VAEntrypointVideoProc) { /* vpp */
>  
>              attribs[i].type = VASurfaceAttribPixelFormat;
> diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h
> index 0e32f7d..7c2306c 100644
> --- a/src/i965_drv_video.h
> +++ b/src/i965_drv_video.h
> @@ -36,6 +36,7 @@
>  #include <va/va_vpp.h>
>  #include <va/va_backend.h>
>  #include <va/va_backend_vpp.h>
> +#include <va/va_intel_fei.h>
>  
>  #include "i965_mutext.h"
>  #include "object_heap.h"




More information about the Libva mailing list