mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 18:00:24 +01:00
frontends/va: Fix RGB/YUV conversion in Get/PutImage
This needs to set some matrix, otherwise identity would be used for
RGB/YUV conversion. For YUV/YUV or RGB/RGB conversion vlVaPostProcCompositor
will ignore the matrices, so it's okay to always set bt709.
Also set color range.
Fixes: 9393a0510b ("frontends/va: Use new RGB YUV conversion matrix")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14456
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38892>
This commit is contained in:
parent
1395d806ba
commit
94f2d110a1
1 changed files with 12 additions and 0 deletions
|
|
@ -504,6 +504,12 @@ vlVaGetImage(VADriverContextP ctx, VASurfaceID surface, int x, int y,
|
|||
.x1 = vaimage->width,
|
||||
.y1 = vaimage->height,
|
||||
},
|
||||
.in_color_range = util_format_is_yuv(surf->buffer->buffer_format) ?
|
||||
PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED : PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL,
|
||||
.out_color_range = util_format_is_yuv(tmp_surf.buffer->buffer_format) ?
|
||||
PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED : PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL,
|
||||
.in_matrix_coefficients = PIPE_VIDEO_VPP_MCF_BT709,
|
||||
.out_matrix_coefficients = PIPE_VIDEO_VPP_MCF_BT709,
|
||||
};
|
||||
ret = vlVaPostProcCompositor(drv, surf->buffer, tmp_surf.buffer,
|
||||
VL_COMPOSITOR_NONE, ¶m);
|
||||
|
|
@ -674,6 +680,12 @@ vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image,
|
|||
.x1 = dest_x + dest_width,
|
||||
.y1 = dest_y + dest_height,
|
||||
},
|
||||
.in_color_range = util_format_is_yuv(tmp_surf.buffer->buffer_format) ?
|
||||
PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED : PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL,
|
||||
.out_color_range = util_format_is_yuv(surf->buffer->buffer_format) ?
|
||||
PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED : PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL,
|
||||
.in_matrix_coefficients = PIPE_VIDEO_VPP_MCF_BT709,
|
||||
.out_matrix_coefficients = PIPE_VIDEO_VPP_MCF_BT709,
|
||||
};
|
||||
ret = vlVaPostProcCompositor(drv, tmp_surf.buffer, surf->buffer,
|
||||
VL_COMPOSITOR_NONE, ¶m);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue