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
3bd46914
Commit
3bd46914
authored
Jun 21, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/jpeg2000dwt: Allow testing with a maximum allowed difference
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a49154e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
jpeg2000dwt.c
libavcodec/jpeg2000dwt.c
+6
-4
No files found.
libavcodec/jpeg2000dwt.c
View file @
3bd46914
...
...
@@ -614,7 +614,7 @@ void ff_dwt_destroy(DWTContext *s)
#define MAX_W 256
static
int
test_dwt
(
int
*
array
,
int
*
ref
,
uint16_t
border
[
2
][
2
],
int
decomp_levels
,
int
type
)
{
static
int
test_dwt
(
int
*
array
,
int
*
ref
,
uint16_t
border
[
2
][
2
],
int
decomp_levels
,
int
type
,
int
max_diff
)
{
int
ret
,
j
;
DWTContext
s1
=
{{{
0
}}},
*
s
=
&
s1
;
...
...
@@ -633,12 +633,14 @@ static int test_dwt(int *array, int *ref, uint16_t border[2][2], int decomp_leve
fprintf
(
stderr
,
"ff_dwt_encode failed
\n
"
);
return
1
;
}
for
(
j
=
0
;
j
<
MAX_W
*
MAX_W
;
j
++
)
if
(
array
[
j
]
!=
ref
[
j
]
)
{
for
(
j
=
0
;
j
<
MAX_W
*
MAX_W
;
j
++
)
{
if
(
FFABS
(
array
[
j
]
-
ref
[
j
])
>
max_diff
)
{
fprintf
(
stderr
,
"missmatch at %d (%d != %d) decomp:%d border %d %d %d %d
\n
"
,
j
,
array
[
j
],
ref
[
j
],
decomp_levels
,
border
[
0
][
0
],
border
[
0
][
1
],
border
[
1
][
0
],
border
[
1
][
1
]);
return
2
;
}
array
[
j
]
=
ref
[
j
];
}
ff_dwt_destroy
(
s
);
return
0
;
...
...
@@ -664,7 +666,7 @@ int main(void) {
continue
;
decomp_levels
=
av_lfg_get
(
&
prng
)
%
FF_DWT_MAX_DECLVLS
;
ret
=
test_dwt
(
array
,
ref
,
border
,
decomp_levels
,
FF_DWT53
);
ret
=
test_dwt
(
array
,
ref
,
border
,
decomp_levels
,
FF_DWT53
,
0
);
if
(
ret
)
return
ret
;
}
...
...
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