frontends, va: add new parameters of post processor

Signed-off-by: Peyton Lee <peytolee@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713>
This commit is contained in:
Peyton Lee 2023-10-12 17:58:15 +08:00 committed by Marge Bot
parent be05c9458a
commit 6b441ef6ab
3 changed files with 98 additions and 0 deletions

View file

@ -263,6 +263,67 @@ static VAStatus vlVaVidEngineBlit(vlVaDriver *drv, vlVaContext *context,
} }
} }
// Output background color
context->desc.vidproc.background_color = param->output_background_color;
// Input surface color standard
context->desc.vidproc.in_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_NONE;
if (param->surface_color_standard == VAProcColorStandardBT601)
context->desc.vidproc.in_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT601;
else if (param->surface_color_standard == VAProcColorStandardBT709)
context->desc.vidproc.in_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT709;
else if (param->surface_color_standard == VAProcColorStandardBT2020)
context->desc.vidproc.in_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT2020;
// Input surface color range
context->desc.vidproc.in_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_NONE;
if (param->input_color_properties.color_range == VA_SOURCE_RANGE_REDUCED)
context->desc.vidproc.in_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED;
else if (param->input_color_properties.color_range == VA_SOURCE_RANGE_FULL)
context->desc.vidproc.in_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL;
// Input surface chroma sample location
context->desc.vidproc.in_chroma_siting = PIPE_VIDEO_VPP_CHROMA_SITING_NONE;
if (param->input_color_properties.chroma_sample_location & VA_CHROMA_SITING_VERTICAL_TOP)
context->desc.vidproc.in_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_TOP;
else if (param->input_color_properties.chroma_sample_location & VA_CHROMA_SITING_VERTICAL_CENTER)
context->desc.vidproc.in_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_CENTER;
else if (param->input_color_properties.chroma_sample_location & VA_CHROMA_SITING_VERTICAL_BOTTOM)
context->desc.vidproc.in_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_BOTTOM;
if (param->input_color_properties.chroma_sample_location & VA_CHROMA_SITING_HORIZONTAL_LEFT)
context->desc.vidproc.in_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_LEFT;
else if (param->input_color_properties.chroma_sample_location & VA_CHROMA_SITING_HORIZONTAL_CENTER)
context->desc.vidproc.in_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_CENTER;
// Output surface color standard
context->desc.vidproc.out_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_NONE;
if (param->output_color_standard == VAProcColorStandardBT601)
context->desc.vidproc.out_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT601;
else if (param->output_color_standard == VAProcColorStandardBT709)
context->desc.vidproc.out_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT709;
else if (param->output_color_standard == VAProcColorStandardBT2020)
context->desc.vidproc.out_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT2020;
// Output surface color range
context->desc.vidproc.out_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_NONE;
if (param->output_color_properties.color_range == VA_SOURCE_RANGE_REDUCED)
context->desc.vidproc.out_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED;
else if (param->output_color_properties.color_range == VA_SOURCE_RANGE_FULL)
context->desc.vidproc.out_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL;
// Output surface chroma sample location
context->desc.vidproc.out_chroma_siting = PIPE_VIDEO_VPP_CHROMA_SITING_NONE;
if (param->output_color_properties.chroma_sample_location & VA_CHROMA_SITING_VERTICAL_TOP)
context->desc.vidproc.out_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_TOP;
else if (param->output_color_properties.chroma_sample_location & VA_CHROMA_SITING_VERTICAL_CENTER)
context->desc.vidproc.out_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_CENTER;
else if (param->output_color_properties.chroma_sample_location & VA_CHROMA_SITING_VERTICAL_BOTTOM)
context->desc.vidproc.out_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_BOTTOM;
if (param->output_color_properties.chroma_sample_location & VA_CHROMA_SITING_HORIZONTAL_LEFT)
context->desc.vidproc.out_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_LEFT;
else if (param->output_color_properties.chroma_sample_location & VA_CHROMA_SITING_HORIZONTAL_CENTER)
context->desc.vidproc.out_chroma_siting |= PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_CENTER;
if (context->needs_begin_frame) { if (context->needs_begin_frame) {
context->decoder->begin_frame(context->decoder, dst, context->decoder->begin_frame(context->decoder, dst,
&context->desc.base); &context->desc.base);

View file

@ -230,6 +230,35 @@ enum pipe_video_vpp_blend_mode
PIPE_VIDEO_VPP_BLEND_MODE_GLOBAL_ALPHA = 0x1, PIPE_VIDEO_VPP_BLEND_MODE_GLOBAL_ALPHA = 0x1,
}; };
/* To be used for VPP state*/
enum pipe_video_vpp_color_standard_type
{
PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_NONE = 0x0,
PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT601 = 0x1,
PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT709 = 0x2,
PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_BT2020 = 0xC,
PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_COUNT,
};
/* To be used for VPP state*/
enum pipe_video_vpp_color_range
{
PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_NONE = 0x00,
PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED = 0x01,
PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL = 0x02,
};
/* To be used for VPP state*/
enum pipe_video_vpp_chroma_siting
{
PIPE_VIDEO_VPP_CHROMA_SITING_NONE = 0x00,
PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_TOP = 0x01,
PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_CENTER = 0x02,
PIPE_VIDEO_VPP_CHROMA_SITING_VERTICAL_BOTTOM = 0x04,
PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_LEFT = 0x10,
PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_CENTER = 0x20,
};
/* To be used with cap PIPE_VIDEO_CAP_ENC_SLICES_STRUCTURE*/ /* To be used with cap PIPE_VIDEO_CAP_ENC_SLICES_STRUCTURE*/
/** /**

View file

@ -1539,6 +1539,14 @@ struct pipe_vpp_desc
/* Fence to wait on for the src surface */ /* Fence to wait on for the src surface */
struct pipe_fence_handle *src_surface_fence; struct pipe_fence_handle *src_surface_fence;
uint32_t background_color;
enum pipe_video_vpp_color_standard_type in_colors_standard;
enum pipe_video_vpp_color_range in_color_range;
enum pipe_video_vpp_chroma_siting in_chroma_siting;
enum pipe_video_vpp_color_standard_type out_colors_standard;
enum pipe_video_vpp_color_range out_color_range;
enum pipe_video_vpp_chroma_siting out_chroma_siting;
}; };