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
4d8fc0e0
Commit
4d8fc0e0
authored
Jun 21, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/hqx: unroll the pattern calculation
Code si smaller, no speed difference.
parent
dc5972f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
15 deletions
+9
-15
vf_hqx.c
libavfilter/vf_hqx.c
+9
-15
No files found.
libavfilter/vf_hqx.c
View file @
4d8fc0e0
...
...
@@ -401,28 +401,22 @@ static av_always_inline void hqx_filter(const ThreadData *td, int jobnr, int nb_
const
int
nextline
=
y
<
height
-
1
?
src32_linesize
:
0
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
uint32_t
yuv1
,
yuv2
;
const
int
prevcol
=
x
>
0
?
-
1
:
0
;
const
int
nextcol
=
x
<
width
-
1
?
1
:
0
;
int
pattern
=
0
,
flag
=
1
,
k
;
const
uint32_t
w
[
3
*
3
]
=
{
src32
[
prevcol
+
prevline
],
src32
[
prevline
],
src32
[
prevline
+
nextcol
],
src32
[
prevcol
],
src32
[
0
],
src32
[
nextcol
],
src32
[
prevcol
+
nextline
],
src32
[
nextline
],
src32
[
nextline
+
nextcol
]
};
yuv1
=
rgb2yuv
(
r2y
,
w
[
4
]);
for
(
k
=
0
;
k
<
FF_ARRAY_ELEMS
(
w
);
k
++
)
{
if
(
k
==
4
)
continue
;
if
(
w
[
k
]
!=
w
[
4
])
{
yuv2
=
rgb2yuv
(
r2y
,
w
[
k
]);
if
(
yuv_diff
(
yuv1
,
yuv2
))
pattern
|=
flag
;
}
flag
<<=
1
;
}
const
uint32_t
yuv1
=
rgb2yuv
(
r2y
,
w
[
4
]);
const
int
pattern
=
(
w
[
4
]
!=
w
[
0
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
0
])))
:
0
)
<<
0
|
(
w
[
4
]
!=
w
[
1
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
1
])))
:
0
)
<<
1
|
(
w
[
4
]
!=
w
[
2
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
2
])))
:
0
)
<<
2
|
(
w
[
4
]
!=
w
[
3
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
3
])))
:
0
)
<<
3
|
(
w
[
4
]
!=
w
[
5
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
5
])))
:
0
)
<<
4
|
(
w
[
4
]
!=
w
[
6
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
6
])))
:
0
)
<<
5
|
(
w
[
4
]
!=
w
[
7
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
7
])))
:
0
)
<<
6
|
(
w
[
4
]
!=
w
[
8
]
?
(
yuv_diff
(
yuv1
,
rgb2yuv
(
r2y
,
w
[
8
])))
:
0
)
<<
7
;
if
(
n
==
2
)
{
dst32
[
dst32_linesize
*
0
+
0
]
=
hq2x_interp_1x1
(
r2y
,
pattern
,
w
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
);
// 00
...
...
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