mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-28 18:18:38 +00:00
compositor: Add support for Y444 high bitdepth formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1486>
This commit is contained in:
parent
3cab0a9c08
commit
22a4543c5f
3 changed files with 121 additions and 4 deletions
|
@ -629,6 +629,21 @@ PLANAR_YUV_BLEND (i422_12le, GST_ROUND_UP_2, GST_ROUND_UP_1, memcpy,
|
|||
BLEND_HIGH (u12), 12);
|
||||
PLANAR_YUV_BLEND (i422_12be, GST_ROUND_UP_2, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u12_swap), 12);
|
||||
|
||||
PLANAR_YUV_BLEND (y444_10le, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u10), 10);
|
||||
PLANAR_YUV_BLEND (y444_10be, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u10_swap), 10);
|
||||
|
||||
PLANAR_YUV_BLEND (y444_12le, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u12), 12);
|
||||
PLANAR_YUV_BLEND (y444_12be, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u12_swap), 12);
|
||||
|
||||
PLANAR_YUV_BLEND (y444_16le, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u16), 16);
|
||||
PLANAR_YUV_BLEND (y444_16be, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u16_swap), 16);
|
||||
#else /* G_BYTE_ORDER == G_LITTLE_ENDIAN */
|
||||
PLANAR_YUV_BLEND (i420_10le, GST_ROUND_UP_2, GST_ROUND_UP_2, memcpy,
|
||||
BLEND_HIGH (u10_swap), 10);
|
||||
|
@ -649,6 +664,21 @@ PLANAR_YUV_BLEND (i422_12le, GST_ROUND_UP_2, GST_ROUND_UP_1, memcpy,
|
|||
BLEND_HIGH (u12_swap), 12);
|
||||
PLANAR_YUV_BLEND (i422_12be, GST_ROUND_UP_2, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u12), 12);
|
||||
|
||||
PLANAR_YUV_BLEND (y444_10le, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u10_swap), 10);
|
||||
PLANAR_YUV_BLEND (y444_10be, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u10), 10);
|
||||
|
||||
PLANAR_YUV_BLEND (y444_12le, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u12_swap), 12);
|
||||
PLANAR_YUV_BLEND (y444_12be, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u12), 12);
|
||||
|
||||
PLANAR_YUV_BLEND (y444_16le, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u16_swap), 16);
|
||||
PLANAR_YUV_BLEND (y444_16be, GST_ROUND_UP_1, GST_ROUND_UP_1, memcpy,
|
||||
BLEND_HIGH (u16), 16);
|
||||
#endif /* G_BYTE_ORDER == G_LITTLE_ENDIAN */
|
||||
|
||||
PLANAR_YUV_HIGH_FILL_CHECKER (i420_10le, 10, LE, compositor_orc_memset_u16_2d);
|
||||
|
@ -661,6 +691,11 @@ PLANAR_YUV_HIGH_FILL_COLOR (i420_12le, LE, compositor_orc_memset_u16_2d);
|
|||
PLANAR_YUV_HIGH_FILL_CHECKER (i420_12be, 12, BE, compositor_orc_memset_u16_2d);
|
||||
PLANAR_YUV_HIGH_FILL_COLOR (i420_12be, BE, compositor_orc_memset_u16_2d);
|
||||
|
||||
PLANAR_YUV_HIGH_FILL_CHECKER (y444_16le, 16, LE, compositor_orc_memset_u16_2d);
|
||||
PLANAR_YUV_HIGH_FILL_COLOR (y444_16le, LE, compositor_orc_memset_u16_2d);
|
||||
PLANAR_YUV_HIGH_FILL_CHECKER (y444_16be, 16, BE, compositor_orc_memset_u16_2d);
|
||||
PLANAR_YUV_HIGH_FILL_COLOR (y444_16be, BE, compositor_orc_memset_u16_2d);
|
||||
|
||||
/* NV12, NV21 */
|
||||
#define NV_YUV_BLEND(format_name,MEMCPY,BLENDLOOP) \
|
||||
inline static void \
|
||||
|
@ -1229,6 +1264,12 @@ BlendFunction gst_compositor_blend_i422_10le;
|
|||
BlendFunction gst_compositor_blend_i422_10be;
|
||||
BlendFunction gst_compositor_blend_i422_12le;
|
||||
BlendFunction gst_compositor_blend_i422_12be;
|
||||
BlendFunction gst_compositor_blend_y444_10le;
|
||||
BlendFunction gst_compositor_blend_y444_10be;
|
||||
BlendFunction gst_compositor_blend_y444_12le;
|
||||
BlendFunction gst_compositor_blend_y444_12be;
|
||||
BlendFunction gst_compositor_blend_y444_16le;
|
||||
BlendFunction gst_compositor_blend_y444_16be;
|
||||
|
||||
FillCheckerFunction gst_compositor_fill_checker_argb;
|
||||
FillCheckerFunction gst_compositor_fill_checker_bgra;
|
||||
|
@ -1254,6 +1295,8 @@ FillCheckerFunction gst_compositor_fill_checker_i420_10le;
|
|||
FillCheckerFunction gst_compositor_fill_checker_i420_10be;
|
||||
FillCheckerFunction gst_compositor_fill_checker_i420_12le;
|
||||
FillCheckerFunction gst_compositor_fill_checker_i420_12be;
|
||||
FillCheckerFunction gst_compositor_fill_checker_y444_16le;
|
||||
FillCheckerFunction gst_compositor_fill_checker_y444_16be;
|
||||
|
||||
FillColorFunction gst_compositor_fill_color_argb;
|
||||
FillColorFunction gst_compositor_fill_color_bgra;
|
||||
|
@ -1281,6 +1324,8 @@ FillColorFunction gst_compositor_fill_color_i420_10le;
|
|||
FillColorFunction gst_compositor_fill_color_i420_10be;
|
||||
FillColorFunction gst_compositor_fill_color_i420_12le;
|
||||
FillColorFunction gst_compositor_fill_color_i420_12be;
|
||||
FillColorFunction gst_compositor_fill_color_y444_16le;
|
||||
FillColorFunction gst_compositor_fill_color_y444_16be;
|
||||
|
||||
void
|
||||
gst_compositor_init_blend (void)
|
||||
|
@ -1309,6 +1354,12 @@ gst_compositor_init_blend (void)
|
|||
gst_compositor_blend_i422_10be = GST_DEBUG_FUNCPTR (blend_i422_10be);
|
||||
gst_compositor_blend_i422_12le = GST_DEBUG_FUNCPTR (blend_i422_12le);
|
||||
gst_compositor_blend_i422_12be = GST_DEBUG_FUNCPTR (blend_i422_12be);
|
||||
gst_compositor_blend_y444_10le = GST_DEBUG_FUNCPTR (blend_y444_10le);
|
||||
gst_compositor_blend_y444_10be = GST_DEBUG_FUNCPTR (blend_y444_10be);
|
||||
gst_compositor_blend_y444_12le = GST_DEBUG_FUNCPTR (blend_y444_12le);
|
||||
gst_compositor_blend_y444_12be = GST_DEBUG_FUNCPTR (blend_y444_12be);
|
||||
gst_compositor_blend_y444_16le = GST_DEBUG_FUNCPTR (blend_y444_16le);
|
||||
gst_compositor_blend_y444_16be = GST_DEBUG_FUNCPTR (blend_y444_16be);
|
||||
|
||||
gst_compositor_fill_checker_argb = GST_DEBUG_FUNCPTR (fill_checker_argb_c);
|
||||
gst_compositor_fill_checker_bgra = GST_DEBUG_FUNCPTR (fill_checker_bgra_c);
|
||||
|
@ -1333,6 +1384,10 @@ gst_compositor_init_blend (void)
|
|||
GST_DEBUG_FUNCPTR (fill_checker_i420_12le);
|
||||
gst_compositor_fill_checker_i420_12be =
|
||||
GST_DEBUG_FUNCPTR (fill_checker_i420_12be);
|
||||
gst_compositor_fill_checker_y444_16le =
|
||||
GST_DEBUG_FUNCPTR (fill_checker_y444_16le);
|
||||
gst_compositor_fill_checker_y444_16be =
|
||||
GST_DEBUG_FUNCPTR (fill_checker_y444_16be);
|
||||
|
||||
gst_compositor_fill_color_argb = GST_DEBUG_FUNCPTR (fill_color_argb);
|
||||
gst_compositor_fill_color_bgra = GST_DEBUG_FUNCPTR (fill_color_bgra);
|
||||
|
@ -1363,4 +1418,8 @@ gst_compositor_init_blend (void)
|
|||
GST_DEBUG_FUNCPTR (fill_color_i420_12le);
|
||||
gst_compositor_fill_color_i420_12be =
|
||||
GST_DEBUG_FUNCPTR (fill_color_i420_12be);
|
||||
gst_compositor_fill_color_y444_16le =
|
||||
GST_DEBUG_FUNCPTR (fill_color_y444_16le);
|
||||
gst_compositor_fill_color_y444_16be =
|
||||
GST_DEBUG_FUNCPTR (fill_color_y444_16be);
|
||||
}
|
||||
|
|
|
@ -89,6 +89,12 @@ extern BlendFunction gst_compositor_blend_i422_10le;
|
|||
extern BlendFunction gst_compositor_blend_i422_10be;
|
||||
extern BlendFunction gst_compositor_blend_i422_12le;
|
||||
extern BlendFunction gst_compositor_blend_i422_12be;
|
||||
extern BlendFunction gst_compositor_blend_y444_10le;
|
||||
extern BlendFunction gst_compositor_blend_y444_10be;
|
||||
extern BlendFunction gst_compositor_blend_y444_12le;
|
||||
extern BlendFunction gst_compositor_blend_y444_12be;
|
||||
extern BlendFunction gst_compositor_blend_y444_16le;
|
||||
extern BlendFunction gst_compositor_blend_y444_16be;
|
||||
|
||||
extern FillCheckerFunction gst_compositor_fill_checker_argb;
|
||||
#define gst_compositor_fill_checker_abgr gst_compositor_fill_checker_argb
|
||||
|
@ -114,12 +120,18 @@ extern FillCheckerFunction gst_compositor_fill_checker_yuy2;
|
|||
extern FillCheckerFunction gst_compositor_fill_checker_uyvy;
|
||||
extern FillCheckerFunction gst_compositor_fill_checker_i420_10le;
|
||||
#define gst_compositor_fill_checker_i422_10le gst_compositor_fill_checker_i420_10le
|
||||
#define gst_compositor_fill_checker_y444_10le gst_compositor_fill_checker_i420_10le
|
||||
extern FillCheckerFunction gst_compositor_fill_checker_i420_10be;
|
||||
#define gst_compositor_fill_checker_i422_10be gst_compositor_fill_checker_i420_10be
|
||||
#define gst_compositor_fill_checker_y444_10be gst_compositor_fill_checker_i420_10be
|
||||
extern FillCheckerFunction gst_compositor_fill_checker_i420_12le;
|
||||
#define gst_compositor_fill_checker_i422_12le gst_compositor_fill_checker_i420_12le
|
||||
#define gst_compositor_fill_checker_y444_12le gst_compositor_fill_checker_i420_12le
|
||||
extern FillCheckerFunction gst_compositor_fill_checker_i420_12be;
|
||||
#define gst_compositor_fill_checker_i422_12be gst_compositor_fill_checker_i420_12be
|
||||
#define gst_compositor_fill_checker_y444_12be gst_compositor_fill_checker_i420_12be
|
||||
extern FillCheckerFunction gst_compositor_fill_checker_y444_16le;
|
||||
extern FillCheckerFunction gst_compositor_fill_checker_y444_16be;
|
||||
|
||||
extern FillColorFunction gst_compositor_fill_color_argb;
|
||||
extern FillColorFunction gst_compositor_fill_color_abgr;
|
||||
|
@ -145,12 +157,18 @@ extern FillColorFunction gst_compositor_fill_color_yvyu;
|
|||
extern FillColorFunction gst_compositor_fill_color_uyvy;
|
||||
extern FillColorFunction gst_compositor_fill_color_i420_10le;
|
||||
#define gst_compositor_fill_color_i422_10le gst_compositor_fill_color_i420_10le
|
||||
#define gst_compositor_fill_color_y444_10le gst_compositor_fill_color_i420_10le
|
||||
extern FillColorFunction gst_compositor_fill_color_i420_10be;
|
||||
#define gst_compositor_fill_color_i422_10be gst_compositor_fill_color_i420_10be
|
||||
#define gst_compositor_fill_color_y444_10be gst_compositor_fill_color_i420_10be
|
||||
extern FillColorFunction gst_compositor_fill_color_i420_12le;
|
||||
#define gst_compositor_fill_color_i422_12le gst_compositor_fill_color_i420_12le
|
||||
#define gst_compositor_fill_color_y444_12le gst_compositor_fill_color_i420_12le
|
||||
extern FillColorFunction gst_compositor_fill_color_i420_12be;
|
||||
#define gst_compositor_fill_color_i422_12be gst_compositor_fill_color_i420_12be
|
||||
#define gst_compositor_fill_color_y444_12be gst_compositor_fill_color_i420_12be
|
||||
extern FillColorFunction gst_compositor_fill_color_y444_16le;
|
||||
extern FillColorFunction gst_compositor_fill_color_y444_16be;
|
||||
|
||||
void gst_compositor_init_blend (void);
|
||||
|
||||
|
|
|
@ -104,14 +104,18 @@ GST_DEBUG_CATEGORY_STATIC (gst_compositor_debug);
|
|||
#define GST_CAT_DEFAULT gst_compositor_debug
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
#define FORMATS " { AYUV, VUYA, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, "\
|
||||
" YVYU, I422_12LE, I422_12BE, I422_10LE, I422_10BE, "\
|
||||
#define FORMATS " { AYUV, VUYA, BGRA, ARGB, RGBA, ABGR, " \
|
||||
" Y444_16LE, Y444_16BE, Y444_12LE, Y444_12BE, Y444_10LE, Y444_10BE, " \
|
||||
" Y444, Y42B, YUY2, UYVY, YVYU, "\
|
||||
" I422_12LE, I422_12BE, I422_10LE, I422_10BE, "\
|
||||
" I420_12LE, I420_12BE, I420_10LE, I420_10BE, " \
|
||||
" I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, "\
|
||||
" RGBx, BGRx } "
|
||||
#else
|
||||
#define FORMATS " { AYUV, VUYA, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, "\
|
||||
" YVYU, I422_12BE, I422_12LE, I422_10BE, I422_10LE, "\
|
||||
#define FORMATS " { AYUV, VUYA, BGRA, ARGB, RGBA, ABGR, "\
|
||||
" Y444_16BE, Y444_16LE, Y444_12BE, Y444_12LE, Y444_10BE, Y444_10LE, " \
|
||||
" Y444, Y42B, YUY2, UYVY, YVYU, "\
|
||||
" I422_12BE, I422_12LE, I422_10BE, I422_10LE, "\
|
||||
" I420_12BE, I420_12LE, I420_10BE, I420_10LE, "\
|
||||
" I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, "\
|
||||
" RGBx, BGRx } "
|
||||
|
@ -856,6 +860,42 @@ set_functions (GstCompositor * self, const GstVideoInfo * info)
|
|||
self->fill_checker = gst_compositor_fill_checker_rgba;
|
||||
self->fill_color = gst_compositor_fill_color_rgba;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_Y444_16LE:
|
||||
self->blend = gst_compositor_blend_y444_16le;
|
||||
self->overlay = self->blend;
|
||||
self->fill_checker = gst_compositor_fill_checker_y444_16le;
|
||||
self->fill_color = gst_compositor_fill_color_y444_16le;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_Y444_16BE:
|
||||
self->blend = gst_compositor_blend_y444_16be;
|
||||
self->overlay = self->blend;
|
||||
self->fill_checker = gst_compositor_fill_checker_y444_16be;
|
||||
self->fill_color = gst_compositor_fill_color_y444_16be;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_Y444_12LE:
|
||||
self->blend = gst_compositor_blend_y444_12le;
|
||||
self->overlay = self->blend;
|
||||
self->fill_checker = gst_compositor_fill_checker_y444_12le;
|
||||
self->fill_color = gst_compositor_fill_color_y444_12le;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_Y444_12BE:
|
||||
self->blend = gst_compositor_blend_y444_12be;
|
||||
self->overlay = self->blend;
|
||||
self->fill_checker = gst_compositor_fill_checker_y444_12be;
|
||||
self->fill_color = gst_compositor_fill_color_y444_12be;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_Y444_10LE:
|
||||
self->blend = gst_compositor_blend_y444_10le;
|
||||
self->overlay = self->blend;
|
||||
self->fill_checker = gst_compositor_fill_checker_y444_10le;
|
||||
self->fill_color = gst_compositor_fill_color_y444_10le;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_Y444_10BE:
|
||||
self->blend = gst_compositor_blend_y444_10be;
|
||||
self->overlay = self->blend;
|
||||
self->fill_checker = gst_compositor_fill_checker_y444_10be;
|
||||
self->fill_color = gst_compositor_fill_color_y444_10be;
|
||||
break;
|
||||
case GST_VIDEO_FORMAT_Y444:
|
||||
self->blend = gst_compositor_blend_y444;
|
||||
self->overlay = self->blend;
|
||||
|
|
Loading…
Reference in a new issue