Commit 1a5e9ae4 authored by Lynne's avatar Lynne

scale_vulkan: add support for RGB->YUV conversions

Only top-left chroma position supported for now.
parent ecc3dcef
This diff is collapsed.
......@@ -666,6 +666,18 @@ VkSampler *ff_vk_init_sampler(AVFilterContext *avctx, int unnorm_coords,
return sampler;
}
int ff_vk_mt_is_np_rgb(enum AVPixelFormat pix_fmt)
{
if (pix_fmt == AV_PIX_FMT_ABGR || pix_fmt == AV_PIX_FMT_BGRA ||
pix_fmt == AV_PIX_FMT_RGBA || pix_fmt == AV_PIX_FMT_RGB24 ||
pix_fmt == AV_PIX_FMT_BGR24 || pix_fmt == AV_PIX_FMT_RGB48 ||
pix_fmt == AV_PIX_FMT_RGBA64 || pix_fmt == AV_PIX_FMT_RGB565 ||
pix_fmt == AV_PIX_FMT_BGR565 || pix_fmt == AV_PIX_FMT_BGR0 ||
pix_fmt == AV_PIX_FMT_0BGR || pix_fmt == AV_PIX_FMT_RGB0)
return 1;
return 0;
}
const char *ff_vk_shader_rep_fmt(enum AVPixelFormat pixfmt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pixfmt);
......
......@@ -174,6 +174,11 @@ void ff_vk_filter_uninit (AVFilterContext *avctx);
*/
const char *ff_vk_ret2str(VkResult res);
/**
* Returns 1 if the image is any sort of supported RGB
*/
int ff_vk_mt_is_np_rgb(enum AVPixelFormat pix_fmt);
/**
* Gets the glsl format string for a pixel format
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment