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
c1b23e15
Commit
c1b23e15
authored
Feb 03, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_nnedi: fix ISO C90 warnings
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
0ab25dac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
vf_nnedi.c
libavfilter/vf_nnedi.c
+16
-12
No files found.
libavfilter/vf_nnedi.c
View file @
c1b23e15
...
...
@@ -488,6 +488,8 @@ static void extract_m8(const uint8_t *srcp8, const int stride, const int xdia, c
{
// uint8_t or uint16_t or float
const
uint8_t
*
srcp
=
(
const
uint8_t
*
)
srcp8
;
float
scale
;
double
tmp
;
// int32_t or int64_t or double
int64_t
sum
=
0
,
sumsq
=
0
;
...
...
@@ -503,9 +505,9 @@ static void extract_m8(const uint8_t *srcp8, const int stride, const int xdia, c
}
input
+=
xdia
;
}
const
float
scale
=
1
.
0
f
/
(
xdia
*
ydia
);
scale
=
1
.
0
f
/
(
xdia
*
ydia
);
mstd
[
0
]
=
sum
*
scale
;
const
double
tmp
=
(
double
)
sumsq
*
scale
-
(
double
)
mstd
[
0
]
*
mstd
[
0
];
tmp
=
(
double
)
sumsq
*
scale
-
(
double
)
mstd
[
0
]
*
mstd
[
0
];
mstd
[
3
]
=
0
.
0
f
;
if
(
tmp
<=
FLT_EPSILON
)
mstd
[
1
]
=
mstd
[
2
]
=
0
.
0
f
;
...
...
@@ -518,6 +520,7 @@ static void extract_m8(const uint8_t *srcp8, const int stride, const int xdia, c
static
void
extract_m8_i16
(
const
uint8_t
*
srcp
,
const
int
stride
,
const
int
xdia
,
const
int
ydia
,
float
*
mstd
,
float
*
inputf
)
{
int16_t
*
input
=
(
int16_t
*
)
inputf
;
float
scale
;
int
sum
=
0
,
sumsq
=
0
;
int
y
,
x
;
...
...
@@ -530,7 +533,7 @@ static void extract_m8_i16(const uint8_t *srcp, const int stride, const int xdia
}
input
+=
xdia
;
}
const
float
scale
=
1
.
0
f
/
(
float
)(
xdia
*
ydia
);
scale
=
1
.
0
f
/
(
float
)(
xdia
*
ydia
);
mstd
[
0
]
=
sum
*
scale
;
mstd
[
1
]
=
sumsq
*
scale
-
mstd
[
0
]
*
mstd
[
0
];
mstd
[
3
]
=
0
.
0
f
;
...
...
@@ -587,9 +590,6 @@ static void evalfunc_1(NNEDIContext *s, FrameData *frame_data)
int
plane
,
y
,
x
,
i
;
for
(
plane
=
0
;
plane
<
s
->
nb_planes
;
plane
++
)
{
if
(
!
(
s
->
process_plane
&
(
1
<<
plane
)))
continue
;
const
uint8_t
*
srcp
=
(
const
uint8_t
*
)
frame_data
->
paddedp
[
plane
];
const
int
src_stride
=
frame_data
->
padded_stride
[
plane
]
/
sizeof
(
uint8_t
);
...
...
@@ -601,23 +601,27 @@ static void evalfunc_1(NNEDIContext *s, FrameData *frame_data)
const
int
ystart
=
frame_data
->
field
[
plane
];
const
int
ystop
=
height
-
12
;
uint8_t
*
srcpp
;
if
(
!
(
s
->
process_plane
&
(
1
<<
plane
)))
continue
;
srcp
+=
(
ystart
+
6
)
*
src_stride
;
dstp
+=
ystart
*
dst_stride
-
32
;
const
uint8_t
*
srcpp
=
srcp
-
(
ydia
-
1
)
*
src_stride
-
xdiad2m1
;
srcpp
=
srcp
-
(
ydia
-
1
)
*
src_stride
-
xdiad2m1
;
for
(
y
=
ystart
;
y
<
ystop
;
y
+=
2
)
{
for
(
x
=
32
;
x
<
width
-
32
;
x
++
)
{
uint32_t
pixel
=
0
;
memcpy
(
&
pixel
,
dstp
+
x
,
sizeof
(
uint8_t
));
uint32_t
all_ones
=
0
;
float
mstd
[
4
];
memcpy
(
&
pixel
,
dstp
+
x
,
sizeof
(
uint8_t
));
memset
(
&
all_ones
,
255
,
sizeof
(
uint8_t
));
if
(
pixel
!=
all_ones
)
continue
;
float
mstd
[
4
];
s
->
extract
((
const
uint8_t
*
)(
srcpp
+
x
),
src_stride
,
xdia
,
ydia
,
mstd
,
input
);
for
(
i
=
0
;
i
<
qual
;
i
++
)
{
s
->
dot_prod
(
s
,
input
,
weights1
[
i
],
temp
,
nns
*
2
,
asize
,
mstd
+
2
);
...
...
@@ -1048,10 +1052,10 @@ static av_cold int init(AVFilterContext *ctx)
// Factor mean removal and 1.0/127.5 scaling
// into first layer weights. scale to int16 range
for
(
j
=
0
;
j
<
4
;
j
++
)
{
double
mval
=
0
.
0
;
double
scale
,
mval
=
0
.
0
;
for
(
k
=
0
;
k
<
48
;
k
++
)
mval
=
FFMAX
(
mval
,
FFABS
((
bdata
[
j
*
48
+
k
]
-
mean
[
j
])
/
127
.
5
));
const
double
scale
=
32767
.
0
/
mval
;
scale
=
32767
.
0
/
mval
;
for
(
k
=
0
;
k
<
48
;
k
++
)
ws
[
j
*
48
+
k
]
=
roundds
(((
bdata
[
j
*
48
+
k
]
-
mean
[
j
])
/
127
.
5
)
*
scale
);
wf
[
j
]
=
(
float
)(
mval
/
32767
.
0
);
...
...
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