mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
video-converter: don't do gamma on alpha channel
The alpha channel is not supposed to be gamma encoded.
This commit is contained in:
parent
561ddabd97
commit
bf916a244d
1 changed files with 18 additions and 6 deletions
|
@ -1089,8 +1089,12 @@ gamma_convert_u8_u16 (GammaData * data, gpointer dest, gpointer src)
|
||||||
guint16 *table = data->gamma_table;
|
guint16 *table = data->gamma_table;
|
||||||
gint width = data->width * 4;
|
gint width = data->width * 4;
|
||||||
|
|
||||||
for (i = 0; i < width; i++)
|
for (i = 0; i < width; i += 4) {
|
||||||
d[i] = table[s[i]];
|
d[i + 0] = (s[i] << 8) | s[i];
|
||||||
|
d[i + 1] = table[s[i + 1]];
|
||||||
|
d[i + 2] = table[s[i + 2]];
|
||||||
|
d[i + 3] = table[s[i + 3]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1102,8 +1106,12 @@ gamma_convert_u16_u8 (GammaData * data, gpointer dest, gpointer src)
|
||||||
guint8 *table = data->gamma_table;
|
guint8 *table = data->gamma_table;
|
||||||
gint width = data->width * 4;
|
gint width = data->width * 4;
|
||||||
|
|
||||||
for (i = 0; i < width; i++)
|
for (i = 0; i < width; i += 4) {
|
||||||
d[i] = table[s[i]];
|
d[i + 0] = s[i] >> 8;
|
||||||
|
d[i + 1] = table[s[i + 1]];
|
||||||
|
d[i + 2] = table[s[i + 2]];
|
||||||
|
d[i + 3] = table[s[i + 3]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1115,8 +1123,12 @@ gamma_convert_u16_u16 (GammaData * data, gpointer dest, gpointer src)
|
||||||
guint16 *table = data->gamma_table;
|
guint16 *table = data->gamma_table;
|
||||||
gint width = data->width * 4;
|
gint width = data->width * 4;
|
||||||
|
|
||||||
for (i = 0; i < width; i++)
|
for (i = 0; i < width; i += 4) {
|
||||||
d[i] = table[s[i]];
|
d[i + 0] = s[i];
|
||||||
|
d[i + 1] = table[s[i + 1]];
|
||||||
|
d[i + 2] = table[s[i + 2]];
|
||||||
|
d[i + 3] = table[s[i + 3]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue