Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a87b17f3
Commit
a87b17f3
authored
Jul 01, 2012
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_yadif: move x86 init code to x86/yadif.c
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
2f0accf1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
55 deletions
+55
-55
vf_yadif.c
libavfilter/vf_yadif.c
+3
-43
yadif.c
libavfilter/x86/yadif.c
+13
-0
yadif_template.c
libavfilter/x86/yadif_template.c
+3
-3
yadif.h
libavfilter/yadif.h
+36
-9
No files found.
libavfilter/vf_yadif.c
View file @
a87b17f3
...
...
@@ -31,42 +31,6 @@
#undef NDEBUG
#include <assert.h>
typedef
struct
{
/**
* 0: send 1 frame for each frame
* 1: send 1 frame for each field
* 2: like 0 but skips spatial interlacing check
* 3: like 1 but skips spatial interlacing check
*/
int
mode
;
/**
* 0: top field first
* 1: bottom field first
* -1: auto-detection
*/
int
parity
;
int
frame_pending
;
/**
* 0: deinterlace all frames
* 1: only deinterlace frames marked as interlaced
*/
int
auto_enable
;
AVFilterBufferRef
*
cur
;
AVFilterBufferRef
*
next
;
AVFilterBufferRef
*
prev
;
AVFilterBufferRef
*
out
;
void
(
*
filter_line
)(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
);
const
AVPixFmtDescriptor
*
csp
;
int
eof
;
}
YADIFContext
;
#define CHECK(j)\
{ int score = FFABS(cur[mrefs-1+(j)] - cur[prefs-1-(j)])\
+ FFABS(cur[mrefs +(j)] - cur[prefs -(j)])\
...
...
@@ -397,7 +361,6 @@ static int query_formats(AVFilterContext *ctx)
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
YADIFContext
*
yadif
=
ctx
->
priv
;
int
cpu_flags
=
av_get_cpu_flags
();
yadif
->
mode
=
0
;
yadif
->
parity
=
-
1
;
...
...
@@ -407,12 +370,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
if
(
args
)
sscanf
(
args
,
"%d:%d:%d"
,
&
yadif
->
mode
,
&
yadif
->
parity
,
&
yadif
->
auto_enable
);
yadif
->
filter_line
=
filter_line_c
;
if
(
HAVE_SSSE3
&&
cpu_flags
&
AV_CPU_FLAG_SSSE3
)
yadif
->
filter_line
=
ff_yadif_filter_line_ssse3
;
else
if
(
HAVE_SSE
&&
cpu_flags
&
AV_CPU_FLAG_SSE2
)
yadif
->
filter_line
=
ff_yadif_filter_line_sse2
;
else
if
(
HAVE_MMX
&&
cpu_flags
&
AV_CPU_FLAG_MMX
)
yadif
->
filter_line
=
ff_yadif_filter_line_mmx
;
if
(
HAVE_MMX
)
ff_yadif_init_x86
(
yadif
);
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"mode:%d parity:%d auto_enable:%d
\n
"
,
yadif
->
mode
,
yadif
->
parity
,
yadif
->
auto_enable
);
...
...
libavfilter/x86/yadif.c
View file @
a87b17f3
...
...
@@ -18,6 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
#include "libavutil/x86_cpu.h"
#include "libavcodec/x86/dsputil_mmx.h"
...
...
@@ -47,3 +48,15 @@ DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x000100010
#define RENAME(a) a ## _mmx
#include "yadif_template.c"
#endif
av_cold
void
ff_yadif_init_x86
(
YADIFContext
*
yadif
)
{
int
cpu_flags
=
av_get_cpu_flags
();
if
(
HAVE_MMX
&&
cpu_flags
&
AV_CPU_FLAG_MMX
)
yadif
->
filter_line
=
yadif_filter_line_mmx
;
if
(
HAVE_SSE
&&
cpu_flags
&
AV_CPU_FLAG_SSE2
)
yadif
->
filter_line
=
yadif_filter_line_sse2
;
if
(
HAVE_SSSE3
&&
cpu_flags
&
AV_CPU_FLAG_SSSE3
)
yadif
->
filter_line
=
yadif_filter_line_ssse3
;
}
libavfilter/x86/yadif_template.c
View file @
a87b17f3
...
...
@@ -103,9 +103,9 @@
"por "MM"5, "MM"3 \n\t"\
MOVQ" "MM"3, "MM"1 \n\t"
void
RENAME
(
ff_yadif_filter_line
)(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
)
static
void
RENAME
(
yadif_filter_line
)(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
)
{
DECLARE_ALIGNED
(
16
,
uint8_t
,
tmp0
)[
16
];
DECLARE_ALIGNED
(
16
,
uint8_t
,
tmp1
)[
16
];
...
...
libavfilter/yadif.h
View file @
a87b17f3
...
...
@@ -19,18 +19,45 @@
#ifndef AVFILTER_YADIF_H
#define AVFILTER_YADIF_H
#include "libavutil/pixdesc.h"
#include "avfilter.h"
void
ff_yadif_filter_line_mmx
(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
);
typedef
struct
{
/**
* 0: send 1 frame for each frame
* 1: send 1 frame for each field
* 2: like 0 but skips spatial interlacing check
* 3: like 1 but skips spatial interlacing check
*/
int
mode
;
void
ff_yadif_filter_line_sse2
(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
);
/**
* 0: top field first
* 1: bottom field first
* -1: auto-detection
*/
int
parity
;
void
ff_yadif_filter_line_ssse3
(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
);
int
frame_pending
;
/**
* 0: deinterlace all frames
* 1: only deinterlace frames marked as interlaced
*/
int
auto_enable
;
AVFilterBufferRef
*
cur
;
AVFilterBufferRef
*
next
;
AVFilterBufferRef
*
prev
;
AVFilterBufferRef
*
out
;
void
(
*
filter_line
)(
uint8_t
*
dst
,
uint8_t
*
prev
,
uint8_t
*
cur
,
uint8_t
*
next
,
int
w
,
int
prefs
,
int
mrefs
,
int
parity
,
int
mode
);
const
AVPixFmtDescriptor
*
csp
;
int
eof
;
}
YADIFContext
;
void
ff_yadif_init_x86
(
YADIFContext
*
yadif
);
#endif
/* AVFILTER_YADIF_H */
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