mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
video-format: more fixes for big endian
This commit is contained in:
parent
569ca5770c
commit
d1a9eacb75
4 changed files with 110 additions and 1498 deletions
|
@ -1001,17 +1001,10 @@ unpack_RGB16 (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
|
|||
{
|
||||
const guint16 *restrict s = GET_LINE (y);
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)
|
||||
video_orc_unpack_RGB16_le_trunc (dest, s + x, width);
|
||||
video_orc_unpack_RGB16_trunc (dest, s + x, width);
|
||||
else
|
||||
video_orc_unpack_RGB16_le (dest, s + x, width);
|
||||
#else
|
||||
if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)
|
||||
video_orc_unpack_RGB16_be_trunc (dest, s + x, width);
|
||||
else
|
||||
video_orc_unpack_RGB16_be (dest, s + x, width);
|
||||
#endif
|
||||
video_orc_unpack_RGB16 (dest, s + x, width);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1037,17 +1030,10 @@ unpack_BGR16 (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
|
|||
{
|
||||
const guint16 *restrict s = GET_LINE (y);
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)
|
||||
video_orc_unpack_BGR16_le_trunc (dest, s + x, width);
|
||||
video_orc_unpack_BGR16_trunc (dest, s + x, width);
|
||||
else
|
||||
video_orc_unpack_BGR16_le (dest, s + x, width);
|
||||
#else
|
||||
if (flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)
|
||||
video_orc_unpack_BGR16_be_trunc (dest, s + x, width);
|
||||
else
|
||||
video_orc_unpack_BGR16_be (dest, s + x, width);
|
||||
#endif
|
||||
video_orc_unpack_BGR16 (dest, s + x, width);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -125,16 +125,12 @@ void video_orc_unpack_BGR15_le_trunc (guint32 * ORC_RESTRICT d1, const guint16 *
|
|||
void video_orc_unpack_BGR15_be_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_pack_BGR15_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_pack_BGR15_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_RGB16_le (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_RGB16_be (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_RGB16_le_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_RGB16_be_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_RGB16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_RGB16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_pack_RGB16_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_pack_RGB16_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_BGR16_le (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_BGR16_be (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_BGR16_le_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_BGR16_be_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_BGR16 (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_unpack_BGR16_trunc (guint32 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_pack_BGR16_le (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_pack_BGR16_be (guint16 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
|
||||
void video_orc_resample_bilinear_u32 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
|
||||
|
|
|
@ -589,7 +589,7 @@ shrul g, g, 6
|
|||
shrul b, b, 3
|
||||
orl t2, r, g
|
||||
orl t2, t2, b
|
||||
select0lw rgb15, t2
|
||||
select1lw rgb15, t2
|
||||
|
||||
.function video_orc_unpack_BGR15_le
|
||||
.dest 4 argb guint32
|
||||
|
@ -719,9 +719,9 @@ shrul g, g, 6
|
|||
shrul r, r, 19
|
||||
orl t2, r, g
|
||||
orl t2, t2, b
|
||||
select0lw rgb15, t2
|
||||
select1lw rgb15, t2
|
||||
|
||||
.function video_orc_unpack_RGB16_le
|
||||
.function video_orc_unpack_RGB16
|
||||
.dest 4 argb guint32
|
||||
.source 2 rgb16 guint16
|
||||
.temp 2 t
|
||||
|
@ -746,32 +746,7 @@ mergewl gb, g, b
|
|||
mergelq t2, ar, gb
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_unpack_RGB16_be
|
||||
.dest 4 argb guint32
|
||||
.source 2 rgb16 guint16
|
||||
.temp 2 t
|
||||
.temp 2 r
|
||||
.temp 2 g
|
||||
.temp 2 b
|
||||
.temp 4 ar
|
||||
.temp 4 gb
|
||||
.temp 8 t2
|
||||
|
||||
loadw t, rgb16
|
||||
andw r, t, 0xf800
|
||||
andw g, t, 0x07e0
|
||||
andw b, t, 0x001f
|
||||
shruw r, r, 6
|
||||
shlw b, b, 5
|
||||
mulhsw r, r, 0x4200
|
||||
mulhsw g, g, 0x2080
|
||||
mulhsw b, b, 0x4200
|
||||
mergewl ar, r, 0xff
|
||||
mergewl gb, b, g
|
||||
mergelq t2, gb, ar
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_unpack_RGB16_le_trunc
|
||||
.function video_orc_unpack_RGB16_trunc
|
||||
.dest 4 argb guint32
|
||||
.source 2 rgb16 guint16
|
||||
.temp 2 t
|
||||
|
@ -794,29 +769,6 @@ mergewl gb, g, b
|
|||
mergelq t2, ar, gb
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_unpack_RGB16_be_trunc
|
||||
.dest 4 argb guint32
|
||||
.source 2 rgb16 guint16
|
||||
.temp 2 t
|
||||
.temp 2 r
|
||||
.temp 2 g
|
||||
.temp 2 b
|
||||
.temp 4 ar
|
||||
.temp 4 gb
|
||||
.temp 8 t2
|
||||
|
||||
loadw t, rgb16
|
||||
andw r, t, 0xf800
|
||||
andw g, t, 0x07e0
|
||||
andw b, t, 0x001f
|
||||
shruw r, r, 8
|
||||
shruw g, g, 3
|
||||
shlw b, b, 3
|
||||
mergewl ar, r, 0xff
|
||||
mergewl gb, b, g
|
||||
mergelq t2, gb, ar
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_pack_RGB16_le
|
||||
.dest 2 rgb15 guint16
|
||||
.source 4 argb guint32
|
||||
|
@ -854,9 +806,9 @@ shrul g, g, 5
|
|||
shrul b, b, 3
|
||||
orl t2, r, g
|
||||
orl t2, t2, b
|
||||
select0lw rgb16, t2
|
||||
select1lw rgb16, t2
|
||||
|
||||
.function video_orc_unpack_BGR16_le
|
||||
.function video_orc_unpack_BGR16
|
||||
.dest 4 argb guint32
|
||||
.source 2 bgr16 guint16
|
||||
.temp 2 t
|
||||
|
@ -881,32 +833,7 @@ mergewl gb, g, b
|
|||
mergelq t2, ar, gb
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_unpack_BGR16_be
|
||||
.dest 4 argb guint32
|
||||
.source 2 bgr16 guint16
|
||||
.temp 2 t
|
||||
.temp 2 r
|
||||
.temp 2 g
|
||||
.temp 2 b
|
||||
.temp 4 ar
|
||||
.temp 4 gb
|
||||
.temp 8 t2
|
||||
|
||||
loadw t, bgr16
|
||||
andw b, t, 0xf800
|
||||
andw g, t, 0x07e0
|
||||
andw r, t, 0x001f
|
||||
shruw b, b, 6
|
||||
shlw r, r, 5
|
||||
mulhsw b, b, 0x4200
|
||||
mulhsw g, g, 0x2080
|
||||
mulhsw r, r, 0x4200
|
||||
mergewl ar, r, 0xff
|
||||
mergewl gb, b, g
|
||||
mergelq t2, gb, ar
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_unpack_BGR16_le_trunc
|
||||
.function video_orc_unpack_BGR16_trunc
|
||||
.dest 4 argb guint32
|
||||
.source 2 bgr16 guint16
|
||||
.temp 2 t
|
||||
|
@ -929,29 +856,6 @@ mergewl gb, g, b
|
|||
mergelq t2, ar, gb
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_unpack_BGR16_be_trunc
|
||||
.dest 4 argb guint32
|
||||
.source 2 bgr16 guint16
|
||||
.temp 2 t
|
||||
.temp 2 r
|
||||
.temp 2 g
|
||||
.temp 2 b
|
||||
.temp 4 ar
|
||||
.temp 4 gb
|
||||
.temp 8 t2
|
||||
|
||||
loadw t, bgr16
|
||||
andw b, t, 0xf800
|
||||
andw g, t, 0x07e0
|
||||
andw r, t, 0x001f
|
||||
shruw b, b, 8
|
||||
shruw g, g, 3
|
||||
shlw r, r, 3
|
||||
mergewl ar, r, 0xff
|
||||
mergewl gb, b, g
|
||||
mergelq t2, gb, ar
|
||||
x4 convsuswb argb, t2
|
||||
|
||||
.function video_orc_pack_BGR16_le
|
||||
.dest 2 rgb15 guint16
|
||||
.source 4 argb guint32
|
||||
|
@ -990,7 +894,7 @@ shrul g, g, 5
|
|||
shrul r, r, 19
|
||||
orl t2, r, g
|
||||
orl t2, t2, b
|
||||
select0lw rgb15, t2
|
||||
select1lw rgb15, t2
|
||||
|
||||
.function video_orc_resample_bilinear_u32
|
||||
.dest 4 d1 guint8
|
||||
|
|
Loading…
Reference in a new issue