Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
29c602fc
Commit
29c602fc
authored
Feb 05, 2006
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Added YVYU blending and fixed UYVY blending.
parent
f2dc268e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
modules/video_filter/blend.c
modules/video_filter/blend.c
+29
-10
No files found.
modules/video_filter/blend.c
View file @
29c602fc
...
@@ -85,6 +85,7 @@ static int OpenFilter( vlc_object_t *p_this )
...
@@ -85,6 +85,7 @@ static int OpenFilter( vlc_object_t *p_this )
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'Y'
,
'V'
,
'Y'
,
'U'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'6'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'R'
,
'V'
,
'1'
,
'6'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'R'
,
'V'
,
'2'
,
'4'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'R'
,
'V'
,
'2'
,
'4'
)
&&
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
)
)
)
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'R'
,
'V'
,
'3'
,
'2'
)
)
)
...
@@ -140,7 +141,8 @@ static void Blend( filter_t *p_filter, picture_t *p_dst,
...
@@ -140,7 +141,8 @@ static void Blend( filter_t *p_filter, picture_t *p_dst,
}
}
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'V'
,
'A'
)
&&
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'V'
,
'A'
)
&&
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
||
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
||
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
)
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
||
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'V'
,
'Y'
,
'U'
)
)
)
{
{
BlendYUVPacked
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
BlendYUVPacked
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
i_x_offset
,
i_y_offset
,
i_width
,
i_height
,
i_alpha
);
i_x_offset
,
i_y_offset
,
i_width
,
i_height
,
i_alpha
);
...
@@ -171,7 +173,8 @@ static void Blend( filter_t *p_filter, picture_t *p_dst,
...
@@ -171,7 +173,8 @@ static void Blend( filter_t *p_filter, picture_t *p_dst,
}
}
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'V'
,
'P'
)
&&
if
(
p_filter
->
fmt_in
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'V'
,
'P'
)
&&
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
||
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
||
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
)
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
||
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'V'
,
'Y'
,
'U'
)
)
)
{
{
BlendPalYUVPacked
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
BlendPalYUVPacked
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
i_x_offset
,
i_y_offset
,
i_width
,
i_height
,
i_alpha
);
i_x_offset
,
i_y_offset
,
i_width
,
i_height
,
i_alpha
);
...
@@ -514,18 +517,26 @@ static void BlendYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
...
@@ -514,18 +517,26 @@ static void BlendYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
uint8_t
*
p_trans
;
uint8_t
*
p_trans
;
int
i_x
,
i_y
,
i_pix_pitch
,
i_trans
;
int
i_x
,
i_y
,
i_pix_pitch
,
i_trans
;
vlc_bool_t
b_even
=
!
((
i_x_offset
+
p_filter
->
fmt_out
.
video
.
i_x_offset
)
%
2
);
vlc_bool_t
b_even
=
!
((
i_x_offset
+
p_filter
->
fmt_out
.
video
.
i_x_offset
)
%
2
);
int
i_
u_offset
,
i_v_offset
;
int
i_
l_offset
=
0
,
i_u_offset
=
0
,
i_v_offset
=
0
;
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
)
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
)
{
{
i_l_offset
=
0
;
i_u_offset
=
1
;
i_u_offset
=
1
;
i_v_offset
=
3
;
i_v_offset
=
3
;
}
}
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
{
{
i_l_offset
=
1
;
i_u_offset
=
0
;
i_u_offset
=
0
;
i_v_offset
=
2
;
i_v_offset
=
2
;
}
}
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'V'
,
'Y'
,
'U'
)
)
{
i_l_offset
=
0
;
i_u_offset
=
3
;
i_v_offset
=
1
;
}
i_pix_pitch
=
2
;
i_pix_pitch
=
2
;
i_dst_pitch
=
p_dst_pic
->
p
->
i_pitch
;
i_dst_pitch
=
p_dst_pic
->
p
->
i_pitch
;
...
@@ -577,7 +588,7 @@ static void BlendYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
...
@@ -577,7 +588,7 @@ static void BlendYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
else
if
(
i_trans
==
MAX_TRANS
)
else
if
(
i_trans
==
MAX_TRANS
)
{
{
/* Completely opaque. Completely overwrite underlying pixel */
/* Completely opaque. Completely overwrite underlying pixel */
p_dst
[
i_x
*
2
]
=
p_src2_y
[
i_x
];
p_dst
[
i_x
*
2
+
i_l_offset
]
=
p_src2_y
[
i_x
];
if
(
b_even
)
if
(
b_even
)
{
{
...
@@ -588,8 +599,8 @@ static void BlendYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
...
@@ -588,8 +599,8 @@ static void BlendYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
else
else
{
{
/* Blending */
/* Blending */
p_dst
[
i_x
*
2
]
=
(
(
uint16_t
)
p_src2_y
[
i_x
]
*
i_trans
+
p_dst
[
i_x
*
2
+
i_l_offset
]
=
(
(
uint16_t
)
p_src2_y
[
i_x
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
]
*
(
MAX_TRANS
-
i_trans
)
)
(
uint16_t
)
p_src1
[
i_x
*
2
+
i_l_offset
]
*
(
MAX_TRANS
-
i_trans
)
)
>>
TRANS_BITS
;
>>
TRANS_BITS
;
if
(
b_even
)
if
(
b_even
)
...
@@ -727,18 +738,26 @@ static void BlendPalYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
...
@@ -727,18 +738,26 @@ static void BlendPalYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
uint8_t
*
p_src1
,
*
p_src2
,
*
p_dst
;
uint8_t
*
p_src1
,
*
p_src2
,
*
p_dst
;
int
i_x
,
i_y
,
i_pix_pitch
,
i_trans
;
int
i_x
,
i_y
,
i_pix_pitch
,
i_trans
;
vlc_bool_t
b_even
=
!
((
i_x_offset
+
p_filter
->
fmt_out
.
video
.
i_x_offset
)
%
2
);
vlc_bool_t
b_even
=
!
((
i_x_offset
+
p_filter
->
fmt_out
.
video
.
i_x_offset
)
%
2
);
int
i_
u_offset
,
i_v_offset
;
int
i_
l_offset
=
0
,
i_u_offset
=
0
,
i_v_offset
=
0
;
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
)
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
)
{
{
i_l_offset
=
0
;
i_u_offset
=
1
;
i_u_offset
=
1
;
i_v_offset
=
3
;
i_v_offset
=
3
;
}
}
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
{
{
i_l_offset
=
1
;
i_u_offset
=
0
;
i_u_offset
=
0
;
i_v_offset
=
2
;
i_v_offset
=
2
;
}
}
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'V'
,
'Y'
,
'U'
)
)
{
i_l_offset
=
0
;
i_u_offset
=
3
;
i_v_offset
=
1
;
}
i_pix_pitch
=
2
;
i_pix_pitch
=
2
;
i_dst_pitch
=
p_dst_pic
->
p
->
i_pitch
;
i_dst_pitch
=
p_dst_pic
->
p
->
i_pitch
;
...
@@ -777,7 +796,7 @@ static void BlendPalYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
...
@@ -777,7 +796,7 @@ static void BlendPalYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
else
if
(
i_trans
==
MAX_TRANS
)
else
if
(
i_trans
==
MAX_TRANS
)
{
{
/* Completely opaque. Completely overwrite underlying pixel */
/* Completely opaque. Completely overwrite underlying pixel */
p_dst
[
i_x
*
2
]
=
p_pal
[
p_src2
[
i_x
]][
0
];
p_dst
[
i_x
*
2
+
i_l_offset
]
=
p_pal
[
p_src2
[
i_x
]][
0
];
if
(
b_even
)
if
(
b_even
)
{
{
...
@@ -788,8 +807,8 @@ static void BlendPalYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
...
@@ -788,8 +807,8 @@ static void BlendPalYUVPacked( filter_t *p_filter, picture_t *p_dst_pic,
else
else
{
{
/* Blending */
/* Blending */
p_dst
[
i_x
*
2
]
=
(
(
uint16_t
)
p_pal
[
p_src2
[
i_x
]][
0
]
*
p_dst
[
i_x
*
2
+
i_l_offset
]
=
(
(
uint16_t
)
p_pal
[
p_src2
[
i_x
]][
0
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
i_l_offset
]
*
(
MAX_TRANS
-
i_trans
)
)
>>
TRANS_BITS
;
(
MAX_TRANS
-
i_trans
)
)
>>
TRANS_BITS
;
if
(
b_even
)
if
(
b_even
)
...
...
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