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
db61e2a9
Commit
db61e2a9
authored
Jun 27, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vdpau: basic deinterlacing filter
parent
dd638a1a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
143 additions
and
1 deletion
+143
-1
modules/LIST
modules/LIST
+1
-0
modules/hw/vdpau/Makefile.am
modules/hw/vdpau/Makefile.am
+5
-0
modules/hw/vdpau/chroma.c
modules/hw/vdpau/chroma.c
+3
-1
modules/hw/vdpau/deinterlace.c
modules/hw/vdpau/deinterlace.c
+131
-0
modules/hw/vdpau/picture.c
modules/hw/vdpau/picture.c
+2
-0
modules/hw/vdpau/vlc_vdpau.h
modules/hw/vdpau/vlc_vdpau.h
+1
-0
No files found.
modules/LIST
View file @
db61e2a9
...
@@ -364,6 +364,7 @@ $Id$
...
@@ -364,6 +364,7 @@ $Id$
* vda: VDADecoder hardware-accelerated decoding
* vda: VDADecoder hardware-accelerated decoding
* vdpau_avcodec: VDPAU hardware-accelerated decoding
* vdpau_avcodec: VDPAU hardware-accelerated decoding
* vdpau_chroma: VDPAU hardware surfaces conversion and rendering
* vdpau_chroma: VDPAU hardware surfaces conversion and rendering
* vdpau_deinterlace: VDPAU deinterlacing video filter
* vdpau_display: VDPAU video display
* vdpau_display: VDPAU video display
* vdummy: dummy video display
* vdummy: dummy video display
* visual: visualisation system
* visual: visualisation system
...
...
modules/hw/vdpau/Makefile.am
View file @
db61e2a9
...
@@ -26,6 +26,11 @@ if HAVE_AVCODEC_VDPAU
...
@@ -26,6 +26,11 @@ if HAVE_AVCODEC_VDPAU
libvlc_LTLIBRARIES
+=
libvdpau_avcodec_plugin.la
libvlc_LTLIBRARIES
+=
libvdpau_avcodec_plugin.la
endif
endif
libvdpau_deinterlace_plugin_la_SOURCES
=
deinterlace.c picture.c
libvdpau_deinterlace_plugin_la_CFLAGS
=
$(AM_CFLAGS)
# dummy
libvdpau_deinterlace_plugin_la_LIBADD
=
$(AM_LIBADD)
libvlc_LTLIBRARIES
+=
libvdpau_deinterlace_plugin.la
libvdpau_chroma_plugin_la_SOURCES
=
chroma.c picture.c
libvdpau_chroma_plugin_la_SOURCES
=
chroma.c picture.c
libvdpau_chroma_plugin_la_CFLAGS
=
$(AM_CFLAGS)
# dummy
libvdpau_chroma_plugin_la_CFLAGS
=
$(AM_CFLAGS)
# dummy
libvdpau_chroma_plugin_la_LIBADD
=
$(AM_LIBADD)
libvdpau_chroma_plugin_la_LIBADD
=
$(AM_LIBADD)
...
...
modules/hw/vdpau/chroma.c
View file @
db61e2a9
...
@@ -288,6 +288,8 @@ static picture_t *MixerRender(filter_t *filter, picture_t *src)
...
@@ -288,6 +288,8 @@ static picture_t *MixerRender(filter_t *filter, picture_t *src)
picture_CopyProperties
(
dst
,
src
);
picture_CopyProperties
(
dst
,
src
);
/* Render video into output */
/* Render video into output */
VdpVideoMixerPictureStructure
structure
=
((
vlc_vdp_video_field_t
*
)(
src
->
context
))
->
structure
;
VdpVideoSurface
past
[
MAX_PAST
];
VdpVideoSurface
past
[
MAX_PAST
];
VdpVideoSurface
surface
=
picture_GetVideoSurface
(
src
);
VdpVideoSurface
surface
=
picture_GetVideoSurface
(
src
);
VdpVideoSurface
future
[
MAX_FUTURE
];
VdpVideoSurface
future
[
MAX_FUTURE
];
...
@@ -322,7 +324,7 @@ static picture_t *MixerRender(filter_t *filter, picture_t *src)
...
@@ -322,7 +324,7 @@ static picture_t *MixerRender(filter_t *filter, picture_t *src)
}
}
err
=
vdp_video_mixer_render
(
sys
->
vdp
,
sys
->
mixer
,
VDP_INVALID_HANDLE
,
err
=
vdp_video_mixer_render
(
sys
->
vdp
,
sys
->
mixer
,
VDP_INVALID_HANDLE
,
NULL
,
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME
,
NULL
,
structure
,
MAX_PAST
,
past
,
surface
,
MAX_FUTURE
,
future
,
MAX_PAST
,
past
,
surface
,
MAX_FUTURE
,
future
,
&
src_rect
,
output
,
&
dst_rect
,
NULL
,
0
,
NULL
);
&
src_rect
,
output
,
&
dst_rect
,
NULL
,
0
,
NULL
);
if
(
err
!=
VDP_STATUS_OK
)
if
(
err
!=
VDP_STATUS_OK
)
...
...
modules/hw/vdpau/deinterlace.c
0 → 100644
View file @
db61e2a9
/*****************************************************************************
* deinterlace.c: VDPAU deinterlacing filter
*****************************************************************************
* Copyright (C) 2013 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <assert.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
#include "vlc_vdpau.h"
struct
filter_sys_t
{
mtime_t
last_pts
;
};
static
picture_t
*
Deinterlace
(
filter_t
*
filter
,
picture_t
*
src
)
{
filter_sys_t
*
sys
=
filter
->
p_sys
;
mtime_t
last_pts
=
sys
->
last_pts
;
sys
->
last_pts
=
src
->
date
;
vlc_vdp_video_field_t
*
f1
=
src
->
context
;
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
picture_t
*
dst
=
picture_NewFromFormat
(
&
src
->
format
);
#endif
if
(
dst
==
NULL
)
return
src
;
/* cannot deinterlace without copying fields */
if
(
vlc_vdp_video_copy
(
dst
,
src
)
!=
VDP_STATUS_OK
)
// shallow copy
{
picture_Release
(
dst
);
return
src
;
}
picture_CopyProperties
(
dst
,
src
);
if
(
last_pts
!=
VLC_TS_INVALID
)
dst
->
date
=
(
3
*
src
->
date
-
last_pts
)
/
2
;
else
if
(
filter
->
fmt_in
.
video
.
i_frame_rate
!=
0
)
dst
->
date
=
src
->
date
+
((
filter
->
fmt_in
.
video
.
i_frame_rate_base
*
CLOCK_FREQ
)
/
filter
->
fmt_in
.
video
.
i_frame_rate
);
dst
->
b_top_field_first
=
!
src
->
b_top_field_first
;
dst
->
i_nb_fields
=
1
;
src
->
i_nb_fields
=
1
;
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
;
f2
->
structure
=
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD
;
}
else
{
f1
->
structure
=
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD
;
f2
->
structure
=
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD
;
}
src
->
b_progressive
=
true
;
return
src
;
}
static
int
Open
(
vlc_object_t
*
obj
)
{
filter_t
*
filter
=
(
filter_t
*
)
obj
;
if
(
filter
->
fmt_in
.
video
.
i_chroma
!=
VLC_CODEC_VDPAU_VIDEO_422
&&
filter
->
fmt_in
.
video
.
i_chroma
!=
VLC_CODEC_VDPAU_VIDEO_420
)
return
VLC_EGENERIC
;
if
(
!
video_format_IsSimilar
(
&
filter
->
fmt_in
.
video
,
&
filter
->
fmt_out
.
video
))
return
VLC_EGENERIC
;
filter_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
if
(
unlikely
(
sys
==
NULL
))
return
VLC_ENOMEM
;
/* NOTE: Only weave and bob are mandatory for the hardware to implement.
* The other modes and IVTC should be checked. */
sys
->
last_pts
=
VLC_TS_INVALID
;
filter
->
pf_video_filter
=
Deinterlace
;
filter
->
p_sys
=
sys
;
filter
->
fmt_out
.
video
.
i_frame_rate
*=
2
;
return
VLC_SUCCESS
;
}
static
void
Close
(
vlc_object_t
*
obj
)
{
filter_t
*
filter
=
(
filter_t
*
)
obj
;
filter_sys_t
*
sys
=
filter
->
p_sys
;
free
(
sys
);
}
vlc_module_begin
()
set_description
(
N_
(
"VDPAU deinterlacing filter"
))
set_capability
(
"video filter2"
,
0
)
set_category
(
CAT_VIDEO
)
set_subcategory
(
SUBCAT_VIDEO_VFILTER
)
set_callbacks
(
Open
,
Close
)
add_shortcut
(
"deinterlace"
)
vlc_module_end
()
modules/hw/vdpau/picture.c
View file @
db61e2a9
...
@@ -71,6 +71,7 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
...
@@ -71,6 +71,7 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
field
->
destroy
=
SurfaceDestroy
;
field
->
destroy
=
SurfaceDestroy
;
field
->
frame
=
frame
;
field
->
frame
=
frame
;
field
->
structure
=
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME
;
atomic_init
(
&
frame
->
refs
,
1
);
atomic_init
(
&
frame
->
refs
,
1
);
frame
->
surface
=
surface
;
frame
->
surface
=
surface
;
...
@@ -91,6 +92,7 @@ VdpStatus vlc_vdp_video_copy(picture_t *restrict dst, picture_t *restrict src)
...
@@ -91,6 +92,7 @@ VdpStatus vlc_vdp_video_copy(picture_t *restrict dst, picture_t *restrict src)
fnew
->
destroy
=
SurfaceDestroy
;
fnew
->
destroy
=
SurfaceDestroy
;
fnew
->
frame
=
frame
;
fnew
->
frame
=
frame
;
fnew
->
structure
=
fold
->
structure
;
atomic_fetch_add
(
&
frame
->
refs
,
1
);
atomic_fetch_add
(
&
frame
->
refs
,
1
);
return
VDP_STATUS_OK
;
return
VDP_STATUS_OK
;
...
...
modules/hw/vdpau/vlc_vdpau.h
View file @
db61e2a9
...
@@ -258,6 +258,7 @@ typedef struct vlc_vdp_video_field
...
@@ -258,6 +258,7 @@ typedef struct vlc_vdp_video_field
{
{
void
(
*
destroy
)(
void
*
);
/* must be first @ref picture_Release() */
void
(
*
destroy
)(
void
*
);
/* must be first @ref picture_Release() */
vlc_vdp_video_frame_t
*
frame
;
vlc_vdp_video_frame_t
*
frame
;
VdpVideoMixerPictureStructure
structure
;
}
vlc_vdp_video_field_t
;
}
vlc_vdp_video_field_t
;
/**
/**
...
...
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