frontends/va: fixed av1 decoding 10bit ffmpeg output YUV issue
av1 decoding supports NV12 and P010 output. Reviewed-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19660>
This commit is contained in:
@@ -488,13 +488,6 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV420) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_NV12;
|
||||
i++;
|
||||
}
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV420_10 ||
|
||||
(config->rt_format & VA_RT_FORMAT_YUV420 &&
|
||||
config->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE)) {
|
||||
@@ -509,29 +502,48 @@ vlVaQuerySurfaceAttributes(VADriverContextP ctx, VAConfigID config_id,
|
||||
attribs[i].value.value.i = VA_FOURCC_P016;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV400) {
|
||||
if (config->profile == PIPE_VIDEO_PROFILE_AV1_MAIN &&
|
||||
config->entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_Y800;
|
||||
attribs[i].value.value.i = VA_FOURCC_NV12;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV422) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_YUY2;
|
||||
attribs[i].value.value.i = VA_FOURCC_P010;
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV420) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_NV12;
|
||||
i++;
|
||||
}
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV400) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_Y800;
|
||||
i++;
|
||||
}
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV422) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_YUY2;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV444) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_444P;
|
||||
i++;
|
||||
if (config->rt_format & VA_RT_FORMAT_YUV444) {
|
||||
attribs[i].type = VASurfaceAttribPixelFormat;
|
||||
attribs[i].value.type = VAGenericValueTypeInteger;
|
||||
attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
|
||||
attribs[i].value.value.i = VA_FOURCC_444P;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
attribs[i].type = VASurfaceAttribMemoryType;
|
||||
|
Reference in New Issue
Block a user