Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
9f9f87c7
Commit
9f9f87c7
authored
10 years ago
by
Alex Converse
Browse files
Options
Download
Patches
Plain Diff
Add test for 4x4 WHT.
Change-Id: I97ba3152f9b44d23a74c6144809142810d07e368
parent
34843e97
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/fdct4x4_test.cc
+64
-12
test/fdct4x4_test.cc
with
64 additions
and
12 deletions
test/fdct4x4_test.cc
+
64
−
12
View file @
9f9f87c7
...
@@ -48,6 +48,10 @@ void fht4x4_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
...
@@ -48,6 +48,10 @@ void fht4x4_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
vp9_fht4x4_c
(
in
,
out
,
stride
,
tx_type
);
vp9_fht4x4_c
(
in
,
out
,
stride
,
tx_type
);
}
}
void
fwht4x4_ref
(
const
int16_t
*
in
,
int16_t
*
out
,
int
stride
,
int
tx_type
)
{
vp9_fwht4x4_c
(
in
,
out
,
stride
);
}
class
Trans4x4TestBase
{
class
Trans4x4TestBase
{
public:
public:
virtual
~
Trans4x4TestBase
()
{}
virtual
~
Trans4x4TestBase
()
{}
...
@@ -57,7 +61,7 @@ class Trans4x4TestBase {
...
@@ -57,7 +61,7 @@ class Trans4x4TestBase {
virtual
void
RunInvTxfm
(
const
int16_t
*
out
,
uint8_t
*
dst
,
int
stride
)
=
0
;
virtual
void
RunInvTxfm
(
const
int16_t
*
out
,
uint8_t
*
dst
,
int
stride
)
=
0
;
void
RunAccuracyCheck
()
{
void
RunAccuracyCheck
(
int
limit
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
uint32_t
max_error
=
0
;
uint32_t
max_error
=
0
;
int64_t
total_error
=
0
;
int64_t
total_error
=
0
;
...
@@ -88,11 +92,13 @@ class Trans4x4TestBase {
...
@@ -88,11 +92,13 @@ class Trans4x4TestBase {
}
}
}
}
EXPECT_GE
(
1u
,
max_error
)
EXPECT_GE
(
static_cast
<
uint32_t
>
(
limit
),
max_error
)
<<
"Error: 4x4 FHT/IHT has an individual round trip error > 1"
;
<<
"Error: 4x4 FHT/IHT has an individual round trip error > "
<<
limit
;
EXPECT_GE
(
count_test_block
,
total_error
)
EXPECT_GE
(
count_test_block
*
limit
,
total_error
)
<<
"Error: 4x4 FHT/IHT has average round trip error > 1 per block"
;
<<
"Error: 4x4 FHT/IHT has average round trip error > "
<<
limit
<<
" per block"
;
}
}
void
RunCoeffCheck
()
{
void
RunCoeffCheck
()
{
...
@@ -150,7 +156,7 @@ class Trans4x4TestBase {
...
@@ -150,7 +156,7 @@ class Trans4x4TestBase {
}
}
}
}
void
RunInvAccuracyCheck
()
{
void
RunInvAccuracyCheck
(
int
limit
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
const
int
count_test_block
=
1000
;
const
int
count_test_block
=
1000
;
DECLARE_ALIGNED_ARRAY
(
16
,
int16_t
,
in
,
kNumCoeffs
);
DECLARE_ALIGNED_ARRAY
(
16
,
int16_t
,
in
,
kNumCoeffs
);
...
@@ -173,8 +179,8 @@ class Trans4x4TestBase {
...
@@ -173,8 +179,8 @@ class Trans4x4TestBase {
for
(
int
j
=
0
;
j
<
kNumCoeffs
;
++
j
)
{
for
(
int
j
=
0
;
j
<
kNumCoeffs
;
++
j
)
{
const
uint32_t
diff
=
dst
[
j
]
-
src
[
j
];
const
uint32_t
diff
=
dst
[
j
]
-
src
[
j
];
const
uint32_t
error
=
diff
*
diff
;
const
uint32_t
error
=
diff
*
diff
;
EXPECT_GE
(
1u
,
error
)
EXPECT_GE
(
static_cast
<
uint32_t
>
(
limit
)
,
error
)
<<
"Error:
16x16
IDCT has error "
<<
error
<<
"Error:
4x4
IDCT has error "
<<
error
<<
" at index "
<<
j
;
<<
" at index "
<<
j
;
}
}
}
}
...
@@ -213,7 +219,7 @@ class Trans4x4DCT
...
@@ -213,7 +219,7 @@ class Trans4x4DCT
};
};
TEST_P
(
Trans4x4DCT
,
AccuracyCheck
)
{
TEST_P
(
Trans4x4DCT
,
AccuracyCheck
)
{
RunAccuracyCheck
();
RunAccuracyCheck
(
1
);
}
}
TEST_P
(
Trans4x4DCT
,
CoeffCheck
)
{
TEST_P
(
Trans4x4DCT
,
CoeffCheck
)
{
...
@@ -225,7 +231,7 @@ TEST_P(Trans4x4DCT, MemCheck) {
...
@@ -225,7 +231,7 @@ TEST_P(Trans4x4DCT, MemCheck) {
}
}
TEST_P
(
Trans4x4DCT
,
InvAccuracyCheck
)
{
TEST_P
(
Trans4x4DCT
,
InvAccuracyCheck
)
{
RunInvAccuracyCheck
();
RunInvAccuracyCheck
(
1
);
}
}
class
Trans4x4HT
class
Trans4x4HT
...
@@ -257,7 +263,7 @@ class Trans4x4HT
...
@@ -257,7 +263,7 @@ class Trans4x4HT
};
};
TEST_P
(
Trans4x4HT
,
AccuracyCheck
)
{
TEST_P
(
Trans4x4HT
,
AccuracyCheck
)
{
RunAccuracyCheck
();
RunAccuracyCheck
(
1
);
}
}
TEST_P
(
Trans4x4HT
,
CoeffCheck
)
{
TEST_P
(
Trans4x4HT
,
CoeffCheck
)
{
...
@@ -269,9 +275,51 @@ TEST_P(Trans4x4HT, MemCheck) {
...
@@ -269,9 +275,51 @@ TEST_P(Trans4x4HT, MemCheck) {
}
}
TEST_P
(
Trans4x4HT
,
InvAccuracyCheck
)
{
TEST_P
(
Trans4x4HT
,
InvAccuracyCheck
)
{
RunInvAccuracyCheck
();
RunInvAccuracyCheck
(
1
);
}
}
class
Trans4x4WHT
:
public
Trans4x4TestBase
,
public
::
testing
::
TestWithParam
<
dct_4x4_param_t
>
{
public:
virtual
~
Trans4x4WHT
()
{}
virtual
void
SetUp
()
{
fwd_txfm_
=
GET_PARAM
(
0
);
inv_txfm_
=
GET_PARAM
(
1
);
tx_type_
=
GET_PARAM
(
2
);
pitch_
=
4
;
fwd_txfm_ref
=
fwht4x4_ref
;
}
virtual
void
TearDown
()
{
libvpx_test
::
ClearSystemState
();
}
protected
:
void
RunFwdTxfm
(
const
int16_t
*
in
,
int16_t
*
out
,
int
stride
)
{
fwd_txfm_
(
in
,
out
,
stride
);
}
void
RunInvTxfm
(
const
int16_t
*
out
,
uint8_t
*
dst
,
int
stride
)
{
inv_txfm_
(
out
,
dst
,
stride
);
}
fdct_t
fwd_txfm_
;
idct_t
inv_txfm_
;
};
TEST_P
(
Trans4x4WHT
,
AccuracyCheck
)
{
RunAccuracyCheck
(
0
);
}
TEST_P
(
Trans4x4WHT
,
CoeffCheck
)
{
RunCoeffCheck
();
}
TEST_P
(
Trans4x4WHT
,
MemCheck
)
{
RunMemCheck
();
}
TEST_P
(
Trans4x4WHT
,
InvAccuracyCheck
)
{
RunInvAccuracyCheck
(
0
);
}
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
make_tuple
;
INSTANTIATE_TEST_CASE_P
(
INSTANTIATE_TEST_CASE_P
(
...
@@ -285,6 +333,10 @@ INSTANTIATE_TEST_CASE_P(
...
@@ -285,6 +333,10 @@ INSTANTIATE_TEST_CASE_P(
make_tuple
(
&
vp9_fht4x4_c
,
&
vp9_iht4x4_16_add_c
,
1
),
make_tuple
(
&
vp9_fht4x4_c
,
&
vp9_iht4x4_16_add_c
,
1
),
make_tuple
(
&
vp9_fht4x4_c
,
&
vp9_iht4x4_16_add_c
,
2
),
make_tuple
(
&
vp9_fht4x4_c
,
&
vp9_iht4x4_16_add_c
,
2
),
make_tuple
(
&
vp9_fht4x4_c
,
&
vp9_iht4x4_16_add_c
,
3
)));
make_tuple
(
&
vp9_fht4x4_c
,
&
vp9_iht4x4_16_add_c
,
3
)));
INSTANTIATE_TEST_CASE_P
(
C
,
Trans4x4WHT
,
::
testing
::
Values
(
make_tuple
(
&
vp9_fwht4x4_c
,
&
vp9_iwht4x4_16_add_c
,
0
)));
#if HAVE_NEON
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P
(
INSTANTIATE_TEST_CASE_P
(
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets