Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-base
Commits
85b0252c
Commit
85b0252c
authored
Oct 31, 2010
by
Sebastian Dröge
Committed by
Wim Taymans
Jun 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[MOVED FROM BAD 45/68] colorspace: Add support for RGB15 and BGR15
parent
5c3ec381
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
2 deletions
+57
-2
gst/colorspace/colorspace.c
gst/colorspace/colorspace.c
+56
-2
gst/colorspace/gstcolorspace.c
gst/colorspace/gstcolorspace.c
+1
-0
No files found.
gst/colorspace/colorspace.c
View file @
85b0252c
...
...
@@ -594,6 +594,60 @@ putline_BGR16 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
}
}
static
void
getline_RGB15
(
ColorspaceConvert
*
convert
,
guint8
*
dest
,
const
guint8
*
src
,
int
j
)
{
int
i
;
const
guint16
*
srcline
=
(
const
guint16
*
)
FRAME_GET_LINE
(
src
,
0
,
j
);
for
(
i
=
0
;
i
<
convert
->
width
;
i
++
)
{
dest
[
i
*
4
+
0
]
=
0xff
;
dest
[
i
*
4
+
1
]
=
((
srcline
[
i
]
>>
10
)
&
0x1f
)
<<
3
;
dest
[
i
*
4
+
2
]
=
((
srcline
[
i
]
>>
5
)
&
0x1f
)
<<
3
;
dest
[
i
*
4
+
3
]
=
((
srcline
[
i
])
&
0x1f
)
<<
3
;
}
}
static
void
putline_RGB15
(
ColorspaceConvert
*
convert
,
guint8
*
dest
,
const
guint8
*
src
,
int
j
)
{
int
i
;
guint16
*
destline
=
(
guint16
*
)
FRAME_GET_LINE
(
dest
,
0
,
j
);
for
(
i
=
0
;
i
<
convert
->
width
;
i
++
)
{
destline
[
i
]
=
((
src
[
i
*
4
+
1
]
>>
3
)
<<
10
)
|
((
src
[
i
*
4
+
2
]
>>
3
)
<<
5
)
|
(
src
[
i
*
4
+
3
]
>>
3
);
}
}
static
void
getline_BGR15
(
ColorspaceConvert
*
convert
,
guint8
*
dest
,
const
guint8
*
src
,
int
j
)
{
int
i
;
const
guint16
*
srcline
=
(
const
guint16
*
)
FRAME_GET_LINE
(
src
,
0
,
j
);
for
(
i
=
0
;
i
<
convert
->
width
;
i
++
)
{
dest
[
i
*
4
+
0
]
=
0xff
;
dest
[
i
*
4
+
3
]
=
((
srcline
[
i
]
>>
10
)
&
0x1f
)
<<
3
;
dest
[
i
*
4
+
2
]
=
((
srcline
[
i
]
>>
5
)
&
0x1f
)
<<
3
;
dest
[
i
*
4
+
1
]
=
((
srcline
[
i
])
&
0x1f
)
<<
3
;
}
}
static
void
putline_BGR15
(
ColorspaceConvert
*
convert
,
guint8
*
dest
,
const
guint8
*
src
,
int
j
)
{
int
i
;
guint16
*
destline
=
(
guint16
*
)
FRAME_GET_LINE
(
dest
,
0
,
j
);
for
(
i
=
0
;
i
<
convert
->
width
;
i
++
)
{
destline
[
i
]
=
((
src
[
i
*
4
+
3
]
>>
3
)
<<
10
)
|
((
src
[
i
*
4
+
2
]
>>
3
)
<<
5
)
|
(
src
[
i
*
4
+
1
]
>>
3
);
}
}
static
void
getline_BGRA
(
ColorspaceConvert
*
convert
,
guint8
*
dest
,
const
guint8
*
src
,
int
j
)
...
...
@@ -836,8 +890,8 @@ static const ColorspaceLine lines[] = {
{
GST_VIDEO_FORMAT_Y16
,
getline_Y16
,
putline_Y16
},
{
GST_VIDEO_FORMAT_RGB16
,
getline_RGB16
,
putline_RGB16
},
{
GST_VIDEO_FORMAT_BGR16
,
getline_BGR16
,
putline_BGR16
},
//
{GST_VIDEO_FORMAT_RGB15, getline_RGB15, putline_RGB15},
//
{GST_VIDEO_FORMAT_BGR15, getline_BGR15, putline_BGR15},
{
GST_VIDEO_FORMAT_RGB15
,
getline_RGB15
,
putline_RGB15
},
{
GST_VIDEO_FORMAT_BGR15
,
getline_BGR15
,
putline_BGR15
},
{
GST_VIDEO_FORMAT_UYVP
,
getline_UYVP
,
putline_UYVP
},
{
GST_VIDEO_FORMAT_A420
,
getline_A420
,
putline_A420
}
};
...
...
gst/colorspace/gstcolorspace.c
View file @
85b0252c
...
...
@@ -61,6 +61,7 @@ GST_DEBUG_CATEGORY (colorspace_performance);
GST_VIDEO_CAPS_RGB_16";" \
GST_VIDEO_CAPS_BGR_16";" \
GST_VIDEO_CAPS_RGB_15";" \
GST_VIDEO_CAPS_BGR_15";" \
"video/x-raw-rgb, bpp = (int)8, depth = (int)8, " \
"width = "GST_VIDEO_SIZE_RANGE" , " \
"height = " GST_VIDEO_SIZE_RANGE ", " \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment