summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuijing Dong <ruijing.dong@amd.com>2022-11-05 23:06:54 -0400
committerMarge Bot <emma+marge@anholt.net>2022-11-14 22:19:53 +0000
commit0b02db30070313910d35913aec8b68652d329c0a (patch)
tree4a62ef17f02a84434edc28ac61a2110b48c2e695 /src
parent35606096de65a2896830b8f920e927894a7b19a4 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/frontends/va/surface.c54
1 files changed, 33 insertions, 21 deletions
diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c
index b2c745acdd2..5679f3991d1 100644
--- a/src/gallium/frontends/va/surface.c
+++ b/src/gallium/frontends/va/surface.c
@@ -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;