Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
c95d03ee
Commit
c95d03ee
authored
Nov 05, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
yuvp: add conversion to ARGB
parent
91106e6a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
modules/video_filter/yuvp.c
modules/video_filter/yuvp.c
+38
-5
No files found.
modules/video_filter/yuvp.c
View file @
c95d03ee
...
@@ -66,7 +66,8 @@ static int Open( vlc_object_t *p_this )
...
@@ -66,7 +66,8 @@ static int Open( vlc_object_t *p_this )
* (if scaling is required another filter can do it) */
* (if scaling is required another filter can do it) */
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
!=
VLC_CODEC_YUVP
||
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
!=
VLC_CODEC_YUVP
||
(
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_CODEC_YUVA
&&
(
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_CODEC_YUVA
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_CODEC_RGBA
)
||
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_CODEC_RGBA
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_CODEC_ARGB
)
||
p_filter
->
fmt_in
.
video
.
i_width
!=
p_filter
->
fmt_out
.
video
.
i_width
||
p_filter
->
fmt_in
.
video
.
i_width
!=
p_filter
->
fmt_out
.
video
.
i_width
||
p_filter
->
fmt_in
.
video
.
i_height
!=
p_filter
->
fmt_out
.
video
.
i_height
)
p_filter
->
fmt_in
.
video
.
i_height
!=
p_filter
->
fmt_out
.
video
.
i_height
)
{
{
...
@@ -138,12 +139,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
...
@@ -138,12 +139,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
}
}
}
}
}
}
else
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_CODEC_RGBA
)
{
{
assert
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_CODEC_RGBA
)
;
video_palette_t
rgbp
;
/* Create a RGBA palette */
/* Create a RGBA palette */
video_palette_t
rgbp
;
rgbp
.
i_entries
=
p_yuvp
->
i_entries
;
rgbp
.
i_entries
=
p_yuvp
->
i_entries
;
for
(
int
i
=
0
;
i
<
p_yuvp
->
i_entries
;
i
++
)
for
(
int
i
=
0
;
i
<
p_yuvp
->
i_entries
;
i
++
)
{
{
...
@@ -152,7 +152,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
...
@@ -152,7 +152,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
rgbp
.
palette
[
i
][
3
]
=
p_yuvp
->
palette
[
i
][
3
];
rgbp
.
palette
[
i
][
3
]
=
p_yuvp
->
palette
[
i
][
3
];
}
}
/* */
for
(
unsigned
int
y
=
0
;
y
<
p_filter
->
fmt_in
.
video
.
i_height
;
y
++
)
for
(
unsigned
int
y
=
0
;
y
<
p_filter
->
fmt_in
.
video
.
i_height
;
y
++
)
{
{
const
uint8_t
*
p_line
=
&
p_pic
->
p
->
p_pixels
[
y
*
p_pic
->
p
->
i_pitch
];
const
uint8_t
*
p_line
=
&
p_pic
->
p
->
p_pixels
[
y
*
p_pic
->
p
->
i_pitch
];
...
@@ -172,6 +171,40 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
...
@@ -172,6 +171,40 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
}
}
}
}
}
}
else
{
video_palette_t
rgbp
;
assert
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_CODEC_ARGB
);
/* Create a RGBA palette */
rgbp
.
i_entries
=
p_yuvp
->
i_entries
;
for
(
int
i
=
0
;
i
<
p_yuvp
->
i_entries
;
i
++
)
{
Yuv2Rgb
(
&
rgbp
.
palette
[
i
][
1
],
&
rgbp
.
palette
[
i
][
2
],
&
rgbp
.
palette
[
i
][
3
],
p_yuvp
->
palette
[
i
][
0
],
p_yuvp
->
palette
[
i
][
1
],
p_yuvp
->
palette
[
i
][
2
]
);
rgbp
.
palette
[
i
][
0
]
=
p_yuvp
->
palette
[
i
][
3
];
}
for
(
unsigned
int
y
=
0
;
y
<
p_filter
->
fmt_in
.
video
.
i_height
;
y
++
)
{
const
uint8_t
*
p_line
=
&
p_pic
->
p
->
p_pixels
[
y
*
p_pic
->
p
->
i_pitch
];
uint8_t
*
p_rgba
=
&
p_out
->
p
->
p_pixels
[
y
*
p_out
->
p
->
i_pitch
];
for
(
unsigned
int
x
=
0
;
x
<
p_filter
->
fmt_in
.
video
.
i_width
;
x
++
)
{
const
int
v
=
p_line
[
x
];
if
(
v
>=
rgbp
.
i_entries
)
/* maybe assert ? */
continue
;
p_rgba
[
4
*
x
+
0
]
=
rgbp
.
palette
[
v
][
0
];
p_rgba
[
4
*
x
+
1
]
=
rgbp
.
palette
[
v
][
1
];
p_rgba
[
4
*
x
+
2
]
=
rgbp
.
palette
[
v
][
2
];
p_rgba
[
4
*
x
+
3
]
=
rgbp
.
palette
[
v
][
3
];
}
}
}
picture_CopyProperties
(
p_out
,
p_pic
);
picture_CopyProperties
(
p_out
,
p_pic
);
picture_Release
(
p_pic
);
picture_Release
(
p_pic
);
...
...
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