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
67e1d348
Commit
67e1d348
authored
Feb 04, 2006
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Hopefully added UYVY blending for YUVA and YUVP. (Untested)
parent
4b1302d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
28 deletions
+55
-28
modules/video_filter/blend.c
modules/video_filter/blend.c
+55
-28
No files found.
modules/video_filter/blend.c
View file @
67e1d348
...
...
@@ -51,12 +51,12 @@ static void BlendR16( filter_t *, picture_t *, picture_t *, picture_t *,
int
,
int
,
int
,
int
,
int
);
static
void
BlendR24
(
filter_t
*
,
picture_t
*
,
picture_t
*
,
picture_t
*
,
int
,
int
,
int
,
int
,
int
);
static
void
BlendYU
Y2
(
filter_t
*
,
picture_t
*
,
picture_t
*
,
picture_t
*
,
int
,
int
,
int
,
int
,
int
);
static
void
BlendYU
VPacked
(
filter_t
*
,
picture_t
*
,
picture_t
*
,
picture_t
*
,
int
,
int
,
int
,
int
,
int
);
static
void
BlendPalI420
(
filter_t
*
,
picture_t
*
,
picture_t
*
,
picture_t
*
,
int
,
int
,
int
,
int
,
int
);
static
void
BlendPalYU
Y2
(
filter_t
*
,
picture_t
*
,
picture_t
*
,
picture_t
*
,
int
,
int
,
int
,
int
,
int
);
static
void
BlendPalYU
VPacked
(
filter_t
*
,
picture_t
*
,
picture_t
*
,
picture_t
*
,
int
,
int
,
int
,
int
,
int
);
static
void
BlendPalRV
(
filter_t
*
,
picture_t
*
,
picture_t
*
,
picture_t
*
,
int
,
int
,
int
,
int
,
int
);
...
...
@@ -84,6 +84,7 @@ static int OpenFilter( vlc_object_t *p_this )
(
p_filter
->
fmt_out
.
video
.
i_chroma
!=
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
)
&&
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
(
'U'
,
'Y'
,
'V'
,
'Y'
)
&&
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'
,
'3'
,
'2'
)
)
)
...
...
@@ -138,9 +139,10 @@ static void Blend( filter_t *p_filter, picture_t *p_dst,
return
;
}
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'
)
)
)
{
BlendYU
Y2
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
BlendYU
VPacked
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
i_x_offset
,
i_y_offset
,
i_width
,
i_height
,
i_alpha
);
return
;
}
...
...
@@ -168,9 +170,10 @@ static void Blend( filter_t *p_filter, picture_t *p_dst,
return
;
}
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'
)
)
)
{
BlendPalYU
Y2
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
BlendPalYU
VPacked
(
p_filter
,
p_dst
,
p_dst_orig
,
p_src
,
i_x_offset
,
i_y_offset
,
i_width
,
i_height
,
i_alpha
);
return
;
}
...
...
@@ -500,10 +503,10 @@ static void BlendR24( filter_t *p_filter, picture_t *p_dst_pic,
return
;
}
static
void
BlendYU
Y2
(
filter_t
*
p_filter
,
picture_t
*
p_dst_pic
,
picture_t
*
p_dst_orig
,
picture_t
*
p_src
,
int
i_x_offset
,
int
i_y_offset
,
int
i_width
,
int
i_height
,
int
i_alpha
)
static
void
BlendYU
VPacked
(
filter_t
*
p_filter
,
picture_t
*
p_dst_pic
,
picture_t
*
p_dst_orig
,
picture_t
*
p_src
,
int
i_x_offset
,
int
i_y_offset
,
int
i_width
,
int
i_height
,
int
i_alpha
)
{
int
i_src1_pitch
,
i_src2_pitch
,
i_dst_pitch
;
uint8_t
*
p_dst
,
*
p_src1
,
*
p_src2_y
;
...
...
@@ -511,6 +514,18 @@ static void BlendYUY2( filter_t *p_filter, picture_t *p_dst_pic,
uint8_t
*
p_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
);
int
i_u_offset
,
i_v_offset
;
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
)
{
i_u_offset
=
1
;
i_v_offset
=
3
;
}
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
{
i_u_offset
=
0
;
i_v_offset
=
2
;
}
i_pix_pitch
=
2
;
i_dst_pitch
=
p_dst_pic
->
p
->
i_pitch
;
...
...
@@ -566,8 +581,8 @@ static void BlendYUY2( filter_t *p_filter, picture_t *p_dst_pic,
if
(
b_even
)
{
p_dst
[
i_x
*
2
+
1
]
=
p_src2_u
[
i_x
];
p_dst
[
i_x
*
2
+
3
]
=
p_src2_v
[
i_x
];
p_dst
[
i_x
*
2
+
i_u_offset
]
=
p_src2_u
[
i_x
];
p_dst
[
i_x
*
2
+
i_v_offset
]
=
p_src2_v
[
i_x
];
}
}
else
...
...
@@ -579,11 +594,11 @@ static void BlendYUY2( filter_t *p_filter, picture_t *p_dst_pic,
if
(
b_even
)
{
p_dst
[
i_x
*
2
+
1
]
=
(
(
uint16_t
)
p_src2_u
[
i_x
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
1
]
*
(
MAX_TRANS
-
i_trans
)
)
p_dst
[
i_x
*
2
+
i_u_offset
]
=
(
(
uint16_t
)
p_src2_u
[
i_x
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
i_u_offset
]
*
(
MAX_TRANS
-
i_trans
)
)
>>
TRANS_BITS
;
p_dst
[
i_x
*
2
+
3
]
=
(
(
uint16_t
)
p_src2_v
[
i_x
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
3
]
*
(
MAX_TRANS
-
i_trans
)
)
p_dst
[
i_x
*
2
+
i_v_offset
]
=
(
(
uint16_t
)
p_src2_v
[
i_x
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
i_v_offset
]
*
(
MAX_TRANS
-
i_trans
)
)
>>
TRANS_BITS
;
}
}
...
...
@@ -703,15 +718,27 @@ static void BlendPalI420( filter_t *p_filter, picture_t *p_dst,
return
;
}
static
void
BlendPalYU
Y2
(
filter_t
*
p_filter
,
picture_t
*
p_dst_pic
,
picture_t
*
p_dst_orig
,
picture_t
*
p_src
,
int
i_x_offset
,
int
i_y_offset
,
int
i_width
,
int
i_height
,
int
i_alpha
)
static
void
BlendPalYU
VPacked
(
filter_t
*
p_filter
,
picture_t
*
p_dst_pic
,
picture_t
*
p_dst_orig
,
picture_t
*
p_src
,
int
i_x_offset
,
int
i_y_offset
,
int
i_width
,
int
i_height
,
int
i_alpha
)
{
int
i_src1_pitch
,
i_src2_pitch
,
i_dst_pitch
;
uint8_t
*
p_src1
,
*
p_src2
,
*
p_dst
;
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
);
int
i_u_offset
,
i_v_offset
;
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'Y'
,
'U'
,
'Y'
,
'2'
)
)
{
i_u_offset
=
1
;
i_v_offset
=
3
;
}
else
if
(
p_filter
->
fmt_out
.
video
.
i_chroma
==
VLC_FOURCC
(
'U'
,
'Y'
,
'V'
,
'Y'
)
)
{
i_u_offset
=
0
;
i_v_offset
=
2
;
}
i_pix_pitch
=
2
;
i_dst_pitch
=
p_dst_pic
->
p
->
i_pitch
;
...
...
@@ -754,8 +781,8 @@ static void BlendPalYUY2( filter_t *p_filter, picture_t *p_dst_pic,
if
(
b_even
)
{
p_dst
[
i_x
*
2
+
1
]
=
p_pal
[
p_src2
[
i_x
]][
1
];
p_dst
[
i_x
*
2
+
3
]
=
p_pal
[
p_src2
[
i_x
]][
2
];
p_dst
[
i_x
*
2
+
i_u_offset
]
=
p_pal
[
p_src2
[
i_x
]][
1
];
p_dst
[
i_x
*
2
+
i_v_offset
]
=
p_pal
[
p_src2
[
i_x
]][
2
];
}
}
else
...
...
@@ -767,11 +794,11 @@ static void BlendPalYUY2( filter_t *p_filter, picture_t *p_dst_pic,
if
(
b_even
)
{
p_dst
[
i_x
*
2
+
1
]
=
(
(
uint16_t
)
p_pal
[
p_src2
[
i_x
]][
1
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
1
]
*
p_dst
[
i_x
*
2
+
i_u_offset
]
=
(
(
uint16_t
)
p_pal
[
p_src2
[
i_x
]][
1
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
i_u_offset
]
*
(
MAX_TRANS
-
i_trans
)
)
>>
TRANS_BITS
;
p_dst
[
i_x
*
2
+
3
]
=
(
(
uint16_t
)
p_pal
[
p_src2
[
i_x
]][
2
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
3
]
*
p_dst
[
i_x
*
2
+
i_v_offset
]
=
(
(
uint16_t
)
p_pal
[
p_src2
[
i_x
]][
2
]
*
i_trans
+
(
uint16_t
)
p_src1
[
i_x
*
2
+
i_v_offset
]
*
(
MAX_TRANS
-
i_trans
)
)
>>
TRANS_BITS
;
}
}
...
...
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