Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
6ffb7537
Commit
6ffb7537
authored
Jul 09, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau: simplify surface copy when deinterlacing
parent
59ab278d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
17 deletions
+12
-17
modules/hw/vdpau/deinterlace.c
modules/hw/vdpau/deinterlace.c
+6
-3
modules/hw/vdpau/picture.c
modules/hw/vdpau/picture.c
+3
-12
modules/hw/vdpau/vlc_vdpau.h
modules/hw/vdpau/vlc_vdpau.h
+3
-2
No files found.
modules/hw/vdpau/deinterlace.c
View file @
6ffb7537
...
...
@@ -45,9 +45,9 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
vlc_vdp_video_field_t
*
f1
=
src
->
context
;
if
(
unlikely
(
f1
==
NULL
))
return
src
;
if
(
f1
->
structure
!=
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME
)
return
src
;
/* cannot deinterlace twice */
#ifdef VOUT_CORE_GETS_A_CLUE
picture_t
*
dst
=
filter_NewPicture
(
filter
);
#else
...
...
@@ -55,12 +55,16 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
#endif
if
(
dst
==
NULL
)
return
src
;
/* cannot deinterlace without copying fields */
if
(
vlc_vdp_video_copy
(
dst
,
src
)
!=
VDP_STATUS_OK
)
// shallow copy
vlc_vdp_video_field_t
*
f2
=
vlc_vdp_video_copy
(
f1
);
// shallow copy
if
(
unlikely
(
f2
==
NULL
))
{
picture_Release
(
dst
);
return
src
;
}
picture_CopyProperties
(
dst
,
src
);
dst
->
context
=
f2
;
if
(
last_pts
!=
VLC_TS_INVALID
)
dst
->
date
=
(
3
*
src
->
date
-
last_pts
)
/
2
;
...
...
@@ -75,7 +79,6 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
assert
(
src
->
p_next
==
NULL
);
src
->
p_next
=
dst
;
vlc_vdp_video_field_t
*
f2
=
dst
->
context
;
if
(
src
->
b_progressive
||
src
->
b_top_field_first
)
{
f1
->
structure
=
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD
;
...
...
modules/hw/vdpau/picture.c
View file @
6ffb7537
...
...
@@ -94,21 +94,12 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
return
VDP_STATUS_OK
;
}
VdpStatus
vlc_vdp_video_copy
(
picture_t
*
restrict
dst
,
picture_t
*
restrict
src
)
vlc_vdp_video_field_t
*
vlc_vdp_video_copy
(
vlc_vdp_video_field_t
*
fold
)
{
vlc_vdp_video_field_t
*
fold
=
src
->
context
;
vlc_vdp_video_frame_t
*
frame
=
fold
->
frame
;
vlc_vdp_video_field_t
*
fnew
=
malloc
(
sizeof
(
*
fnew
));
if
(
unlikely
(
fnew
==
NULL
))
return
VDP_STATUS_RESOURCES
;
assert
(
src
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_420
||
src
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_422
);
assert
(
dst
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_420
||
dst
->
format
.
i_chroma
==
VLC_CODEC_VDPAU_VIDEO_422
);
assert
(
!
picture_IsReferenced
(
dst
));
assert
(
dst
->
context
==
NULL
);
dst
->
context
=
fnew
;
return
NULL
;
fnew
->
destroy
=
SurfaceDestroy
;
fnew
->
frame
=
frame
;
...
...
@@ -117,7 +108,7 @@ VdpStatus vlc_vdp_video_copy(picture_t *restrict dst, picture_t *restrict src)
fnew
->
sharpen
=
fold
->
sharpen
;
atomic_fetch_add
(
&
frame
->
refs
,
1
);
return
VDP_STATUS_OK
;
return
fnew
;
}
vlc_vdp_video_field_t
*
vlc_vdp_video_detach
(
picture_t
*
pic
)
...
...
modules/hw/vdpau/vlc_vdpau.h
View file @
6ffb7537
...
...
@@ -271,9 +271,10 @@ typedef struct vlc_vdp_video_field
VdpStatus
vlc_vdp_video_attach
(
vdp_t
*
,
VdpVideoSurface
,
picture_t
*
);
/**
* Copies the VDPAU video surface from a VLC picture into another VLC picture.
* Performs a shallow copy of a VDPAU video surface context
* (the underlying VDPAU video surface is shared).
*/
VdpStatus
vlc_vdp_video_copy
(
picture_t
*
dst
,
picture_t
*
src
);
vlc_vdp_video_field_t
*
vlc_vdp_video_copy
(
vlc_vdp_video_field_t
*
);
/**
* Detaches a VDPAU video surface as context from a VLC picture.
...
...
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