mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
ffmpegcolorspace: Add YUY2/YVYU to all RGB formats conversions
This commit is contained in:
parent
21cb7fd0ff
commit
cff70878b6
2 changed files with 87 additions and 1 deletions
|
@ -1019,7 +1019,6 @@ yvyu422_to_gray (AVPicture * dst, const AVPicture * src, int width, int height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
yvyu422_to_yuv420p (AVPicture * dst, const AVPicture * src,
|
yvyu422_to_yuv420p (AVPicture * dst, const AVPicture * src,
|
||||||
int width, int height)
|
int width, int height)
|
||||||
|
@ -2777,6 +2776,19 @@ static ConvertEntry convert_table[] = {
|
||||||
|
|
||||||
{PIX_FMT_YUV422, PIX_FMT_YUV420P, yuv422_to_yuv420p},
|
{PIX_FMT_YUV422, PIX_FMT_YUV420P, yuv422_to_yuv420p},
|
||||||
{PIX_FMT_YUV422, PIX_FMT_YUV422P, yuv422_to_yuv422p},
|
{PIX_FMT_YUV422, PIX_FMT_YUV422P, yuv422_to_yuv422p},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_GRAY8, yvyu422_to_gray},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_RGB555, yuv422_to_rgb555},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_RGB565, yuv422_to_rgb565},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_BGR24, yuv422_to_bgr24},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_RGB24, yuv422_to_rgb24},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_BGR32, yuv422_to_bgr32},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_RGB32, yuv422_to_rgb32},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_xRGB32, yuv422_to_xrgb32},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_BGRx32, yuv422_to_bgrx32},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_BGRA32, yuv422_to_bgra32},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_RGBA32, yuv422_to_rgba32},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_ABGR32, yuv422_to_abgr32},
|
||||||
|
{PIX_FMT_YUV422, PIX_FMT_ARGB32, yuv422_to_argb32},
|
||||||
|
|
||||||
{PIX_FMT_UYVY422, PIX_FMT_YUV420P, uyvy422_to_yuv420p},
|
{PIX_FMT_UYVY422, PIX_FMT_YUV420P, uyvy422_to_yuv420p},
|
||||||
{PIX_FMT_UYVY422, PIX_FMT_YUV422P, uyvy422_to_yuv422p},
|
{PIX_FMT_UYVY422, PIX_FMT_YUV422P, uyvy422_to_yuv422p},
|
||||||
|
@ -2797,6 +2809,18 @@ static ConvertEntry convert_table[] = {
|
||||||
{PIX_FMT_YVYU422, PIX_FMT_YUV420P, yvyu422_to_yuv420p},
|
{PIX_FMT_YVYU422, PIX_FMT_YUV420P, yvyu422_to_yuv420p},
|
||||||
{PIX_FMT_YVYU422, PIX_FMT_YUV422P, yvyu422_to_yuv422p},
|
{PIX_FMT_YVYU422, PIX_FMT_YUV422P, yvyu422_to_yuv422p},
|
||||||
{PIX_FMT_YVYU422, PIX_FMT_GRAY8, yvyu422_to_gray},
|
{PIX_FMT_YVYU422, PIX_FMT_GRAY8, yvyu422_to_gray},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_RGB555, yvyu422_to_rgb555},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_RGB565, yvyu422_to_rgb565},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_BGR24, yvyu422_to_bgr24},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_RGB24, yvyu422_to_rgb24},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_BGR32, yvyu422_to_bgr32},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_RGB32, yvyu422_to_rgb32},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_xRGB32, yvyu422_to_xrgb32},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_BGRx32, yvyu422_to_bgrx32},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_BGRA32, yvyu422_to_bgra32},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_RGBA32, yvyu422_to_rgba32},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_ABGR32, yvyu422_to_abgr32},
|
||||||
|
{PIX_FMT_YVYU422, PIX_FMT_ARGB32, yvyu422_to_argb32},
|
||||||
|
|
||||||
{PIX_FMT_RGB24, PIX_FMT_YUV420P, rgb24_to_yuv420p},
|
{PIX_FMT_RGB24, PIX_FMT_YUV420P, rgb24_to_yuv420p},
|
||||||
{PIX_FMT_RGB24, PIX_FMT_NV12, rgb24_to_nv12},
|
{PIX_FMT_RGB24, PIX_FMT_NV12, rgb24_to_nv12},
|
||||||
|
|
|
@ -52,6 +52,68 @@ static void glue (uyvy422_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void glue (yuv422_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
|
||||||
|
int width, int height)
|
||||||
|
{
|
||||||
|
uint8_t *s, *d, *d1, *s1;
|
||||||
|
int w, y, cb, cr, r_add, g_add, b_add;
|
||||||
|
uint8_t *cm = cropTbl + MAX_NEG_CROP;
|
||||||
|
unsigned int r, g, b;
|
||||||
|
|
||||||
|
d = dst->data[0];
|
||||||
|
s = src->data[0];
|
||||||
|
for(;height > 0; height --) {
|
||||||
|
d1 = d;
|
||||||
|
s1 = s;
|
||||||
|
for(w = width; w >= 2; w -= 2) {
|
||||||
|
YUV_TO_RGB1_CCIR(s1[1], s1[3]);
|
||||||
|
|
||||||
|
YUV_TO_RGB2_CCIR(r, g, b, s1[0]);
|
||||||
|
RGB_OUT(d1, r, g, b);
|
||||||
|
d1 += BPP;
|
||||||
|
|
||||||
|
YUV_TO_RGB2_CCIR(r, g, b, s1[1]);
|
||||||
|
RGB_OUT(d1, r, g, b);
|
||||||
|
d1 += BPP;
|
||||||
|
|
||||||
|
s1 += 4;
|
||||||
|
}
|
||||||
|
d += dst->linesize[0];
|
||||||
|
s += src->linesize[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void glue (yvyu422_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
|
||||||
|
int width, int height)
|
||||||
|
{
|
||||||
|
uint8_t *s, *d, *d1, *s1;
|
||||||
|
int w, y, cb, cr, r_add, g_add, b_add;
|
||||||
|
uint8_t *cm = cropTbl + MAX_NEG_CROP;
|
||||||
|
unsigned int r, g, b;
|
||||||
|
|
||||||
|
d = dst->data[0];
|
||||||
|
s = src->data[0];
|
||||||
|
for(;height > 0; height --) {
|
||||||
|
d1 = d;
|
||||||
|
s1 = s;
|
||||||
|
for(w = width; w >= 2; w -= 2) {
|
||||||
|
YUV_TO_RGB1_CCIR(s1[3], s1[1]);
|
||||||
|
|
||||||
|
YUV_TO_RGB2_CCIR(r, g, b, s1[0]);
|
||||||
|
RGB_OUT(d1, r, g, b);
|
||||||
|
d1 += BPP;
|
||||||
|
|
||||||
|
YUV_TO_RGB2_CCIR(r, g, b, s1[1]);
|
||||||
|
RGB_OUT(d1, r, g, b);
|
||||||
|
d1 += BPP;
|
||||||
|
|
||||||
|
s1 += 4;
|
||||||
|
}
|
||||||
|
d += dst->linesize[0];
|
||||||
|
s += src->linesize[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void glue (yuv420p_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
|
static void glue (yuv420p_to_, RGB_NAME)(AVPicture *dst, const AVPicture *src,
|
||||||
int width, int height)
|
int width, int height)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue