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
67168973
Commit
67168973
authored
Apr 14, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factorized a bit CalculateInterlaceScore (deinterlace.c).
parent
f94ced49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
46 deletions
+25
-46
modules/video_filter/deinterlace.c
modules/video_filter/deinterlace.c
+25
-46
No files found.
modules/video_filter/deinterlace.c
View file @
67168973
...
@@ -3103,6 +3103,8 @@ static int CalculateInterlaceScore( const picture_t* p_pic_top,
...
@@ -3103,6 +3103,8 @@ static int CalculateInterlaceScore( const picture_t* p_pic_top,
uint8_t
*
p_p
=
&
ngh
->
p
[
i_plane
].
p_pixels
[(
y
-
1
)
*
wn
];
/* prev line */
uint8_t
*
p_p
=
&
ngh
->
p
[
i_plane
].
p_pixels
[(
y
-
1
)
*
wn
];
/* prev line */
uint8_t
*
p_n
=
&
ngh
->
p
[
i_plane
].
p_pixels
[(
y
+
1
)
*
wn
];
/* next line */
uint8_t
*
p_n
=
&
ngh
->
p
[
i_plane
].
p_pixels
[(
y
+
1
)
*
wn
];
/* next line */
int
x
=
0
;
/* Threshold (value from Transcode 1.1.5) */
/* Threshold (value from Transcode 1.1.5) */
#define T 100
#define T 100
#ifdef CAN_COMPILE_MMXEXT
#ifdef CAN_COMPILE_MMXEXT
...
@@ -3118,7 +3120,7 @@ static int CalculateInterlaceScore( const picture_t* p_pic_top,
...
@@ -3118,7 +3120,7 @@ static int CalculateInterlaceScore( const picture_t* p_pic_top,
static
const
mmx_t
b128
=
{
.
uq
=
0x8080808080808080ULL
};
static
const
mmx_t
b128
=
{
.
uq
=
0x8080808080808080ULL
};
static
const
mmx_t
bT
=
{
.
ub
=
{
T
,
T
,
T
,
T
,
T
,
T
,
T
,
T
}
};
static
const
mmx_t
bT
=
{
.
ub
=
{
T
,
T
,
T
,
T
,
T
,
T
,
T
,
T
}
};
for
(
int
x
=
0
;
x
<
w8
;
x
+=
8
)
for
(
;
x
<
w8
;
x
+=
8
)
{
{
movq_m2r
(
*
((
int64_t
*
)
p_c
),
mm0
);
movq_m2r
(
*
((
int64_t
*
)
p_c
),
mm0
);
movq_m2r
(
*
((
int64_t
*
)
p_p
),
mm1
);
movq_m2r
(
*
((
int64_t
*
)
p_p
),
mm1
);
...
@@ -3153,55 +3155,32 @@ static int CalculateInterlaceScore( const picture_t* p_pic_top,
...
@@ -3153,55 +3155,32 @@ static int CalculateInterlaceScore( const picture_t* p_pic_top,
p_p
+=
8
;
p_p
+=
8
;
p_n
+=
8
;
p_n
+=
8
;
}
}
/* Handle the width remainder if any. */
if
(
wm8
)
{
for
(
int
x
=
0
;
x
<
wm8
;
++
x
)
{
int_fast32_t
C
=
*
p_c
;
int_fast32_t
P
=
*
p_p
;
int_fast32_t
N
=
*
p_n
;
int_fast32_t
comb
=
(
P
-
C
)
*
(
N
-
C
);
if
(
comb
>
T
)
++
i_score
;
++
p_c
;
++
p_p
;
++
p_n
;
}
}
}
}
else
{
#endif
#endif
for
(
int
x
=
0
;
x
<
w
;
++
x
)
for
(
;
x
<
w
;
++
x
)
{
{
/* Worst case: need 17 bits for "comb". */
/* Worst case: need 17 bits for "comb". */
int_fast32_t
C
=
*
p_c
;
int_fast32_t
C
=
*
p_c
;
int_fast32_t
P
=
*
p_p
;
int_fast32_t
P
=
*
p_p
;
int_fast32_t
N
=
*
p_n
;
int_fast32_t
N
=
*
p_n
;
/* Comments in Transcode's filter_ivtc.c attribute this
/* Comments in Transcode's filter_ivtc.c attribute this
combing metric to Gunnar Thalin.
combing metric to Gunnar Thalin.
The idea is that if the picture is interlaced, both
The idea is that if the picture is interlaced, both
expressions will have the same sign, and this comes
expressions will have the same sign, and this comes
up positive. The value T = 100 has been chosen such
up positive. The value T = 100 has been chosen such
that a pixel difference of 10 (on average) will
that a pixel difference of 10 (on average) will
trigger the detector.
trigger the detector.
*/
*/
int_fast32_t
comb
=
(
P
-
C
)
*
(
N
-
C
);
int_fast32_t
comb
=
(
P
-
C
)
*
(
N
-
C
);
if
(
comb
>
T
)
if
(
comb
>
T
)
++
i_score
;
++
i_score
;
++
p_c
;
++
p_c
;
++
p_p
;
++
p_p
;
++
p_n
;
++
p_n
;
}
#ifdef CAN_COMPILE_MMXEXT
}
}
#endif
/* Now the other field - swap current and neighbour pictures */
/* Now the other field - swap current and neighbour pictures */
const
picture_t
*
tmp
=
cur
;
const
picture_t
*
tmp
=
cur
;
...
...
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