mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
frontends/va: add support for VAProcColorStandardExplicit
for video post processing, add support for VAProcColorStandardExplicit Signed-off-by: Peyton Lee <peytolee@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32087>
This commit is contained in:
parent
acb48bde44
commit
a9e4461c26
4 changed files with 127 additions and 4 deletions
|
|
@ -274,6 +274,12 @@ static VAStatus vlVaVidEngineBlit(vlVaDriver *drv, vlVaContext *context,
|
|||
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;
|
||||
else if (param->surface_color_standard == VAProcColorStandardExplicit) {
|
||||
context->desc.vidproc.in_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_EXPLICIT;
|
||||
context->desc.vidproc.in_color_primaries = param->input_color_properties.colour_primaries;
|
||||
context->desc.vidproc.in_transfer_characteristics = param->input_color_properties.transfer_characteristics;
|
||||
context->desc.vidproc.in_matrix_coefficients = param->input_color_properties.matrix_coefficients;
|
||||
}
|
||||
|
||||
// Input surface color range
|
||||
context->desc.vidproc.in_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_NONE;
|
||||
|
|
@ -303,6 +309,12 @@ static VAStatus vlVaVidEngineBlit(vlVaDriver *drv, vlVaContext *context,
|
|||
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;
|
||||
else if (param->output_color_standard == VAProcColorStandardExplicit) {
|
||||
context->desc.vidproc.out_colors_standard = PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_EXPLICIT;
|
||||
context->desc.vidproc.out_color_primaries = param->input_color_properties.colour_primaries;
|
||||
context->desc.vidproc.out_transfer_characteristics = param->input_color_properties.transfer_characteristics;
|
||||
context->desc.vidproc.out_matrix_coefficients = param->input_color_properties.matrix_coefficients;
|
||||
}
|
||||
|
||||
// Output surface color range
|
||||
context->desc.vidproc.out_color_range = PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_NONE;
|
||||
|
|
|
|||
|
|
@ -1421,6 +1421,20 @@ static VAProcColorStandardType vpp_output_color_standards[] = {
|
|||
VAProcColorStandardBT709
|
||||
};
|
||||
|
||||
static VAProcColorStandardType vpp_input_color_standards_extends[] = {
|
||||
VAProcColorStandardBT601,
|
||||
VAProcColorStandardBT709,
|
||||
VAProcColorStandardBT2020,
|
||||
VAProcColorStandardExplicit
|
||||
};
|
||||
|
||||
static VAProcColorStandardType vpp_output_color_standards_extends[] = {
|
||||
VAProcColorStandardBT601,
|
||||
VAProcColorStandardBT709,
|
||||
VAProcColorStandardBT2020,
|
||||
VAProcColorStandardExplicit
|
||||
};
|
||||
|
||||
VAStatus
|
||||
vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
|
||||
VABufferID *filters, unsigned int num_filters,
|
||||
|
|
@ -1441,10 +1455,6 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
|
|||
pipeline_cap->filter_flags = 0;
|
||||
pipeline_cap->num_forward_references = 0;
|
||||
pipeline_cap->num_backward_references = 0;
|
||||
pipeline_cap->num_input_color_standards = ARRAY_SIZE(vpp_input_color_standards);
|
||||
pipeline_cap->input_color_standards = vpp_input_color_standards;
|
||||
pipeline_cap->num_output_color_standards = ARRAY_SIZE(vpp_output_color_standards);
|
||||
pipeline_cap->output_color_standards = vpp_output_color_standards;
|
||||
|
||||
struct pipe_screen *pscreen = VL_VA_PSCREEN(ctx);
|
||||
uint32_t pipe_orientation_flags = pscreen->get_video_param(pscreen,
|
||||
|
|
@ -1466,6 +1476,23 @@ vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,
|
|||
if(pipe_orientation_flags & PIPE_VIDEO_VPP_FLIP_VERTICAL)
|
||||
pipeline_cap->mirror_flags |= VA_MIRROR_VERTICAL;
|
||||
|
||||
if (pscreen->get_video_param(pscreen, PIPE_VIDEO_PROFILE_UNKNOWN, PIPE_VIDEO_ENTRYPOINT_PROCESSING,
|
||||
PIPE_VIDEO_CAP_VPP_SUPPORT_HDR_INPUT)) {
|
||||
pipeline_cap->num_input_color_standards = ARRAY_SIZE(vpp_input_color_standards_extends);
|
||||
pipeline_cap->input_color_standards = vpp_input_color_standards_extends;
|
||||
} else {
|
||||
pipeline_cap->num_input_color_standards = ARRAY_SIZE(vpp_input_color_standards);
|
||||
pipeline_cap->input_color_standards = vpp_input_color_standards;
|
||||
}
|
||||
if (pscreen->get_video_param(pscreen, PIPE_VIDEO_PROFILE_UNKNOWN, PIPE_VIDEO_ENTRYPOINT_PROCESSING,
|
||||
PIPE_VIDEO_CAP_VPP_SUPPORT_HDR_OUTPUT)) {
|
||||
pipeline_cap->num_output_color_standards = ARRAY_SIZE(vpp_output_color_standards_extends);
|
||||
pipeline_cap->output_color_standards = vpp_output_color_standards_extends;
|
||||
} else {
|
||||
pipeline_cap->num_output_color_standards = ARRAY_SIZE(vpp_output_color_standards);
|
||||
pipeline_cap->output_color_standards = vpp_output_color_standards;
|
||||
}
|
||||
|
||||
pipeline_cap->max_input_width = pscreen->get_video_param(pscreen, PIPE_VIDEO_PROFILE_UNKNOWN,
|
||||
PIPE_VIDEO_ENTRYPOINT_PROCESSING,
|
||||
PIPE_VIDEO_CAP_VPP_MAX_INPUT_WIDTH);
|
||||
|
|
|
|||
|
|
@ -164,6 +164,11 @@ enum pipe_video_cap
|
|||
* HEVC range extension support pipe_h265_enc_cap_range_extension_flags
|
||||
*/
|
||||
PIPE_VIDEO_CAP_ENC_HEVC_RANGE_EXTENSION_FLAGS_SUPPORT = 52,
|
||||
/*
|
||||
* Video Post Processing support HDR content
|
||||
*/
|
||||
PIPE_VIDEO_CAP_VPP_SUPPORT_HDR_INPUT = 53,
|
||||
PIPE_VIDEO_CAP_VPP_SUPPORT_HDR_OUTPUT = 54,
|
||||
};
|
||||
|
||||
enum pipe_video_h264_enc_dbk_filter_mode_flags
|
||||
|
|
@ -251,6 +256,7 @@ enum pipe_video_vpp_color_standard_type
|
|||
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_EXPLICIT = 0xD,
|
||||
PIPE_VIDEO_VPP_COLOR_STANDARD_TYPE_COUNT,
|
||||
};
|
||||
|
||||
|
|
@ -273,6 +279,76 @@ enum pipe_video_vpp_chroma_siting
|
|||
PIPE_VIDEO_VPP_CHROMA_SITING_HORIZONTAL_CENTER = 0x20,
|
||||
};
|
||||
|
||||
/* To be used for VPP state*/
|
||||
enum pipe_video_vpp_color_primaries {
|
||||
PIPE_VIDEO_VPP_PRI_RESERVED0 = 0,
|
||||
PIPE_VIDEO_VPP_PRI_BT709 = 1,
|
||||
PIPE_VIDEO_VPP_PRI_UNSPECIFIED = 2,
|
||||
PIPE_VIDEO_VPP_PRI_RESERVED = 3,
|
||||
PIPE_VIDEO_VPP_PRI_BT470M = 4,
|
||||
PIPE_VIDEO_VPP_PRI_BT470BG = 5,
|
||||
PIPE_VIDEO_VPP_PRI_SMPTE170M = 6,
|
||||
PIPE_VIDEO_VPP_PRI_SMPTE240M = 7,
|
||||
PIPE_VIDEO_VPP_PRI_FILM = 8,
|
||||
PIPE_VIDEO_VPP_PRI_BT2020 = 9,
|
||||
PIPE_VIDEO_VPP_PRI_SMPTE428 = 10,
|
||||
PIPE_VIDEO_VPP_PRI_SMPTEST428_1 = PIPE_VIDEO_VPP_PRI_SMPTE428,
|
||||
PIPE_VIDEO_VPP_PRI_SMPTE431 = 11,
|
||||
PIPE_VIDEO_VPP_PRI_SMPTE432 = 12,
|
||||
PIPE_VIDEO_VPP_PRI_EBU3213 = 22,
|
||||
PIPE_VIDEO_VPP_PRI_JEDEC_P22 = PIPE_VIDEO_VPP_PRI_EBU3213,
|
||||
PIPE_VIDEO_VPP_PRI_COUNT,
|
||||
};
|
||||
|
||||
/* To be used for VPP state*/
|
||||
enum pipe_video_vpp_transfer_characteristic {
|
||||
PIPE_VIDEO_VPP_TRC_RESERVED0 = 0,
|
||||
PIPE_VIDEO_VPP_TRC_BT709 = 1,
|
||||
PIPE_VIDEO_VPP_TRC_UNSPECIFIED = 2,
|
||||
PIPE_VIDEO_VPP_TRC_RESERVED = 3,
|
||||
PIPE_VIDEO_VPP_TRC_GAMMA22 = 4,
|
||||
PIPE_VIDEO_VPP_TRC_GAMMA28 = 5,
|
||||
PIPE_VIDEO_VPP_TRC_SMPTE170M = 6,
|
||||
PIPE_VIDEO_VPP_TRC_SMPTE240M = 7,
|
||||
PIPE_VIDEO_VPP_TRC_LINEAR = 8,
|
||||
PIPE_VIDEO_VPP_TRC_LOG = 9,
|
||||
PIPE_VIDEO_VPP_TRC_LOG_SQRT = 10,
|
||||
PIPE_VIDEO_VPP_TRC_IEC61966_2_4 = 11,
|
||||
PIPE_VIDEO_VPP_TRC_BT1361_ECG = 12,
|
||||
PIPE_VIDEO_VPP_TRC_IEC61966_2_1 = 13,
|
||||
PIPE_VIDEO_VPP_TRC_BT2020_10 = 14,
|
||||
PIPE_VIDEO_VPP_TRC_BT2020_12 = 15,
|
||||
PIPE_VIDEO_VPP_TRC_SMPTE2084 = 16,
|
||||
PIPE_VIDEO_VPP_TRC_SMPTEST2084 = PIPE_VIDEO_VPP_TRC_SMPTE2084,
|
||||
PIPE_VIDEO_VPP_TRC_SMPTE428 = 17,
|
||||
PIPE_VIDEO_VPP_TRC_SMPTEST428_1 = PIPE_VIDEO_VPP_TRC_SMPTE428,
|
||||
PIPE_VIDEO_VPP_TRC_ARIB_STD_B67 = 18,
|
||||
PIPE_VIDEO_VPP_TRC_COUNT,
|
||||
};
|
||||
|
||||
/* To be used for VPP state*/
|
||||
enum pipe_video_vpp_matrix_coefficients {
|
||||
PIPE_VIDEO_VPP_MCF_RGB = 0,
|
||||
PIPE_VIDEO_VPP_MCF_BT709 = 1,
|
||||
PIPE_VIDEO_VPP_MCF_UNSPECIFIED = 2,
|
||||
PIPE_VIDEO_VPP_MCF_RESERVED = 3,
|
||||
PIPE_VIDEO_VPP_MCF_FCC = 4,
|
||||
PIPE_VIDEO_VPP_MCF_BT470BG = 5,
|
||||
PIPE_VIDEO_VPP_MCF_SMPTE170M = 6,
|
||||
PIPE_VIDEO_VPP_MCF_SMPTE240M = 7,
|
||||
PIPE_VIDEO_VPP_MCF_YCGCO = 8,
|
||||
PIPE_VIDEO_VPP_MCF_YCOCG = PIPE_VIDEO_VPP_MCF_YCGCO,
|
||||
PIPE_VIDEO_VPP_MCF_BT2020_NCL = 9,
|
||||
PIPE_VIDEO_VPP_MCF_BT2020_CL = 10,
|
||||
PIPE_VIDEO_VPP_MCF_SMPTE2085 = 11,
|
||||
PIPE_VIDEO_VPP_MCF_CHROMA_DERIVED_NCL = 12,
|
||||
PIPE_VIDEO_VPP_MCF_CHROMA_DERIVED_CL = 13,
|
||||
PIPE_VIDEO_VPP_MCF_ICTCP = 14,
|
||||
PIPE_VIDEO_VPP_MCF_IPT_C2 = 15,
|
||||
PIPE_VIDEO_VPP_MCF_YCGCO_RE = 16,
|
||||
PIPE_VIDEO_VPP_MCF_YCGCO_RO = 17,
|
||||
PIPE_VIDEO_VPP_MCF_COUNT,
|
||||
};
|
||||
|
||||
/* To be used with cap PIPE_VIDEO_CAP_ENC_SLICES_STRUCTURE*/
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1977,6 +1977,14 @@ struct pipe_vpp_desc
|
|||
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;
|
||||
|
||||
enum pipe_video_vpp_color_primaries in_color_primaries;
|
||||
enum pipe_video_vpp_transfer_characteristic in_transfer_characteristics;
|
||||
enum pipe_video_vpp_matrix_coefficients in_matrix_coefficients;
|
||||
|
||||
enum pipe_video_vpp_color_primaries out_color_primaries;
|
||||
enum pipe_video_vpp_transfer_characteristic out_transfer_characteristics;
|
||||
enum pipe_video_vpp_matrix_coefficients out_matrix_coefficients;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue