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
e22bb0dc
"README.md" did not exist on "051eb16536305f1a1b4c8b0eb17bab7599a11b00"
Commit
e22bb0dc
authored
11 years ago
by
Jingning Han
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Refactor 16x16 unit tests"
parents
1d44fc0c
ec4b2742
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
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
stable-vp9-decoder
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
v1.3.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/dct16x16_test.cc
+28
-19
test/dct16x16_test.cc
with
28 additions
and
19 deletions
test/dct16x16_test.cc
+
28
−
19
View file @
e22bb0dc
...
@@ -75,7 +75,7 @@ static const double C13 = 0.290284677254462;
...
@@ -75,7 +75,7 @@ static const double C13 = 0.290284677254462;
static
const
double
C14
=
0.195090322016128
;
static
const
double
C14
=
0.195090322016128
;
static
const
double
C15
=
0.098017140329561
;
static
const
double
C15
=
0.098017140329561
;
static
void
butterfly_16x16_dct_1d
(
double
input
[
16
],
double
output
[
16
])
{
void
butterfly_16x16_dct_1d
(
double
input
[
16
],
double
output
[
16
])
{
double
step
[
16
];
double
step
[
16
];
double
intermediate
[
16
];
double
intermediate
[
16
];
double
temp1
,
temp2
;
double
temp1
,
temp2
;
...
@@ -287,37 +287,37 @@ void iht16x16_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
...
@@ -287,37 +287,37 @@ void iht16x16_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
vp9_short_iht16x16_add_c
(
out
,
dst
,
stride
>>
1
,
tx_type
);
vp9_short_iht16x16_add_c
(
out
,
dst
,
stride
>>
1
,
tx_type
);
}
}
class
Fwd
Trans16x16Test
:
public
::
testing
::
TestWithParam
<
int
>
{
class
Trans16x16Test
:
public
::
testing
::
TestWithParam
<
int
>
{
public:
public:
virtual
~
Fwd
Trans16x16Test
()
{}
virtual
~
Trans16x16Test
()
{}
virtual
void
SetUp
()
{
virtual
void
SetUp
()
{
tx_type_
=
GetParam
();
tx_type_
=
GetParam
();
if
(
tx_type_
==
0
)
{
if
(
tx_type_
==
0
)
{
fwd_txfm
=
fdct16x16
;
fwd_txfm
_
=
fdct16x16
;
inv_txfm
=
idct16x16_add
;
inv_txfm
_
=
idct16x16_add
;
}
else
{
}
else
{
fwd_txfm
=
fht16x16
;
fwd_txfm
_
=
fht16x16
;
inv_txfm
=
iht16x16_add
;
inv_txfm
_
=
iht16x16_add
;
}
}
}
}
protected
:
protected
:
void
RunFwdTxfm
(
int16_t
*
in
,
int16_t
*
out
,
uint8_t
*
dst
,
void
RunFwdTxfm
(
int16_t
*
in
,
int16_t
*
out
,
uint8_t
*
dst
,
int
stride
,
int
tx_type
)
{
int
stride
,
int
tx_type
)
{
(
*
fwd_txfm
)(
in
,
out
,
dst
,
stride
,
tx_type
);
(
*
fwd_txfm
_
)(
in
,
out
,
dst
,
stride
,
tx_type
);
}
}
void
RunInvTxfm
(
int16_t
*
in
,
int16_t
*
out
,
uint8_t
*
dst
,
void
RunInvTxfm
(
int16_t
*
in
,
int16_t
*
out
,
uint8_t
*
dst
,
int
stride
,
int
tx_type
)
{
int
stride
,
int
tx_type
)
{
(
*
inv_txfm
)(
in
,
out
,
dst
,
stride
,
tx_type
);
(
*
inv_txfm
_
)(
in
,
out
,
dst
,
stride
,
tx_type
);
}
}
int
tx_type_
;
int
tx_type_
;
void
(
*
fwd_txfm
)(
int16_t
*
,
int16_t
*
,
uint8_t
*
,
int
,
int
);
void
(
*
fwd_txfm
_
)(
int16_t
*
,
int16_t
*
,
uint8_t
*
,
int
,
int
);
void
(
*
inv_txfm
)(
int16_t
*
,
int16_t
*
,
uint8_t
*
,
int
,
int
);
void
(
*
inv_txfm
_
)(
int16_t
*
,
int16_t
*
,
uint8_t
*
,
int
,
int
);
};
};
TEST_P
(
Fwd
Trans16x16Test
,
AccuracyCheck
)
{
TEST_P
(
Trans16x16Test
,
AccuracyCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
int
max_error
=
0
;
int
max_error
=
0
;
int
total_error
=
0
;
int
total_error
=
0
;
...
@@ -355,7 +355,7 @@ TEST_P(FwdTrans16x16Test, AccuracyCheck) {
...
@@ -355,7 +355,7 @@ TEST_P(FwdTrans16x16Test, AccuracyCheck) {
<<
"Error: 16x16 FHT/IHT has average round trip error > 1 per block"
;
<<
"Error: 16x16 FHT/IHT has average round trip error > 1 per block"
;
}
}
TEST_P
(
Fwd
Trans16x16Test
,
CoeffSizeCheck
)
{
TEST_P
(
Trans16x16Test
,
CoeffSizeCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
const
int
count_test_block
=
1000
;
const
int
count_test_block
=
1000
;
for
(
int
i
=
0
;
i
<
count_test_block
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count_test_block
;
++
i
)
{
...
@@ -389,14 +389,19 @@ TEST_P(FwdTrans16x16Test, CoeffSizeCheck) {
...
@@ -389,14 +389,19 @@ TEST_P(FwdTrans16x16Test, CoeffSizeCheck) {
}
}
}
}
INSTANTIATE_TEST_CASE_P
(
VP9
,
FwdTrans16x16Test
,
::
testing
::
Range
(
0
,
4
));
TEST_P
(
Trans16x16Test
,
InvAccuracyCheck
)
{
TEST
(
VP9Idct16x16Test
,
AccuracyCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
const
int
count_test_block
=
1000
;
const
int
count_test_block
=
1000
;
// TODO(jingning): is this unit test necessary? if so, need to add
// check sets for inverse hybrid transforms too.
if
(
tx_type_
!=
DCT_DCT
)
return
;
for
(
int
i
=
0
;
i
<
count_test_block
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count_test_block
;
++
i
)
{
int16_t
in
[
256
],
coeff
[
256
];
DECLARE_ALIGNED_ARRAY
(
16
,
int16_t
,
in
,
256
);
uint8_t
dst
[
256
],
src
[
256
];
DECLARE_ALIGNED_ARRAY
(
16
,
int16_t
,
coeff
,
256
);
DECLARE_ALIGNED_ARRAY
(
16
,
uint8_t
,
dst
,
256
);
DECLARE_ALIGNED_ARRAY
(
16
,
uint8_t
,
src
,
256
);
double
out_r
[
256
];
double
out_r
[
256
];
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
...
@@ -410,7 +415,10 @@ TEST(VP9Idct16x16Test, AccuracyCheck) {
...
@@ -410,7 +415,10 @@ TEST(VP9Idct16x16Test, AccuracyCheck) {
reference_16x16_dct_2d
(
in
,
out_r
);
reference_16x16_dct_2d
(
in
,
out_r
);
for
(
int
j
=
0
;
j
<
256
;
j
++
)
for
(
int
j
=
0
;
j
<
256
;
j
++
)
coeff
[
j
]
=
round
(
out_r
[
j
]);
coeff
[
j
]
=
round
(
out_r
[
j
]);
vp9_short_idct16x16_add_c
(
coeff
,
dst
,
16
);
const
int
pitch
=
32
;
RunInvTxfm
(
coeff
,
coeff
,
dst
,
pitch
,
tx_type_
);
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
const
int
diff
=
dst
[
j
]
-
src
[
j
];
const
int
diff
=
dst
[
j
]
-
src
[
j
];
const
int
error
=
diff
*
diff
;
const
int
error
=
diff
*
diff
;
...
@@ -421,4 +429,5 @@ TEST(VP9Idct16x16Test, AccuracyCheck) {
...
@@ -421,4 +429,5 @@ TEST(VP9Idct16x16Test, AccuracyCheck) {
}
}
}
}
INSTANTIATE_TEST_CASE_P
(
VP9
,
Trans16x16Test
,
::
testing
::
Range
(
0
,
4
));
}
// namespace
}
// namespace
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