Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
d2db6586
Commit
d2db6586
authored
Aug 06, 2017
by
Angie Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rect txfm unit tests
Change-Id: I70f023a0a7f617bf3452543352c710cfedb2e1ce
parent
155bf9a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
19 deletions
+91
-19
test/av1_inv_txfm2d_test.cc
test/av1_inv_txfm2d_test.cc
+54
-13
test/av1_txfm_test.h
test/av1_txfm_test.h
+37
-6
No files found.
test/av1_inv_txfm2d_test.cc
View file @
d2db6586
...
...
@@ -40,11 +40,12 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
tx_size_
=
GET_PARAM
(
1
);
max_error_
=
GET_PARAM
(
2
);
max_avg_error_
=
GET_PARAM
(
3
);
txfm1d_size_
=
libaom_test
::
get_txfm1d_size
(
tx_size_
);
txfm2d_size_
=
txfm1d_size_
*
txfm1d_size_
;
}
void
RunRoundtripCheck
()
{
int
tx_w
=
tx_size_wide
[
tx_size_
];
int
tx_h
=
tx_size_high
[
tx_size_
];
int
txfm2d_size
=
tx_w
*
tx_h
;
const
Fwd_Txfm2d_Func
fwd_txfm_func
=
libaom_test
::
fwd_txfm_func_ls
[
tx_size_
];
const
Inv_Txfm2d_Func
inv_txfm_func
=
...
...
@@ -56,9 +57,9 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
for
(
int
ci
=
0
;
ci
<
count
;
ci
++
)
{
int16_t
expected
[
64
*
64
]
=
{
0
};
ASSERT_LT
(
txfm2d_size
_
,
NELEMENTS
(
expected
));
ASSERT_LT
(
txfm2d_size
,
NELEMENTS
(
expected
));
for
(
int
ni
=
0
;
ni
<
txfm2d_size
_
;
++
ni
)
{
for
(
int
ni
=
0
;
ni
<
txfm2d_size
;
++
ni
)
{
if
(
ci
==
0
)
{
int
extreme_input
=
input_base
-
1
;
expected
[
ni
]
=
extreme_input
;
// extreme case
...
...
@@ -68,25 +69,26 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
}
int32_t
coeffs
[
64
*
64
]
=
{
0
};
ASSERT_LT
(
txfm2d_size
_
,
NELEMENTS
(
coeffs
));
fwd_txfm_func
(
expected
,
coeffs
,
tx
fm1d_size
_
,
tx_type_
,
bd
);
ASSERT_LT
(
txfm2d_size
,
NELEMENTS
(
coeffs
));
fwd_txfm_func
(
expected
,
coeffs
,
tx_
w
,
tx_type_
,
bd
);
uint16_t
actual
[
64
*
64
]
=
{
0
};
ASSERT_LT
(
txfm2d_size
_
,
NELEMENTS
(
actual
));
inv_txfm_func
(
coeffs
,
actual
,
tx
fm1d_size
_
,
tx_type_
,
bd
);
ASSERT_LT
(
txfm2d_size
,
NELEMENTS
(
actual
));
inv_txfm_func
(
coeffs
,
actual
,
tx_
w
,
tx_type_
,
bd
);
for
(
int
ni
=
0
;
ni
<
txfm2d_size
_
;
++
ni
)
{
for
(
int
ni
=
0
;
ni
<
txfm2d_size
;
++
ni
)
{
EXPECT_GE
(
max_error_
,
abs
(
expected
[
ni
]
-
actual
[
ni
]));
}
avg_abs_error
+=
compute_avg_abs_error
<
int16_t
,
uint16_t
>
(
expected
,
actual
,
txfm2d_size
_
);
expected
,
actual
,
txfm2d_size
);
}
avg_abs_error
/=
count
;
// max_abs_avg_error comes from upper bound of
// printf("txfm1d_size: %d accuracy_avg_abs_error: %f\n",
// txfm1d_size_, avg_abs_error);
EXPECT_GE
(
max_avg_error_
,
avg_abs_error
);
EXPECT_GE
(
max_avg_error_
,
avg_abs_error
)
<<
" tx_w: "
<<
tx_w
<<
" tx_h "
<<
tx_h
<<
" tx_type: "
<<
tx_type_
;
}
private:
...
...
@@ -94,14 +96,53 @@ class AV1InvTxfm2d : public ::testing::TestWithParam<AV1InvTxfm2dParam> {
double
max_avg_error_
;
TX_TYPE
tx_type_
;
TX_SIZE
tx_size_
;
int
txfm1d_size_
;
int
txfm2d_size_
;
};
TEST_P
(
AV1InvTxfm2d
,
RunRoundtripCheck
)
{
RunRoundtripCheck
();
}
const
AV1InvTxfm2dParam
av1_inv_txfm2d_param
[]
=
{
#if CONFIG_EXT_TX
#if CONFIG_RECT_TX
AV1InvTxfm2dParam
(
DCT_DCT
,
TX_4X8
,
2
,
0.007
),
AV1InvTxfm2dParam
(
ADST_DCT
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
DCT_ADST
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
ADST_ADST
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
FLIPADST_DCT
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
DCT_FLIPADST
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
FLIPADST_FLIPADST
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
ADST_FLIPADST
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
FLIPADST_ADST
,
TX_4X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
DCT_DCT
,
TX_8X4
,
2
,
0.007
),
AV1InvTxfm2dParam
(
ADST_DCT
,
TX_8X4
,
2
,
0.012
),
AV1InvTxfm2dParam
(
DCT_ADST
,
TX_8X4
,
2
,
0.012
),
AV1InvTxfm2dParam
(
ADST_ADST
,
TX_8X4
,
2
,
0.012
),
AV1InvTxfm2dParam
(
FLIPADST_DCT
,
TX_8X4
,
2
,
0.007
),
AV1InvTxfm2dParam
(
DCT_FLIPADST
,
TX_8X4
,
2
,
0.012
),
AV1InvTxfm2dParam
(
FLIPADST_FLIPADST
,
TX_8X4
,
2
,
0.012
),
AV1InvTxfm2dParam
(
ADST_FLIPADST
,
TX_8X4
,
2
,
0.012
),
AV1InvTxfm2dParam
(
FLIPADST_ADST
,
TX_8X4
,
2
,
0.012
),
AV1InvTxfm2dParam
(
DCT_DCT
,
TX_8X16
,
2
,
0.025
),
AV1InvTxfm2dParam
(
ADST_DCT
,
TX_8X16
,
2
,
0.020
),
AV1InvTxfm2dParam
(
DCT_ADST
,
TX_8X16
,
2
,
0.027
),
AV1InvTxfm2dParam
(
ADST_ADST
,
TX_8X16
,
2
,
0.023
),
AV1InvTxfm2dParam
(
FLIPADST_DCT
,
TX_8X16
,
2
,
0.020
),
AV1InvTxfm2dParam
(
DCT_FLIPADST
,
TX_8X16
,
2
,
0.027
),
AV1InvTxfm2dParam
(
FLIPADST_FLIPADST
,
TX_8X16
,
2
,
0.032
),
AV1InvTxfm2dParam
(
ADST_FLIPADST
,
TX_8X16
,
2
,
0.023
),
AV1InvTxfm2dParam
(
FLIPADST_ADST
,
TX_8X16
,
2
,
0.023
),
AV1InvTxfm2dParam
(
DCT_DCT
,
TX_16X8
,
2
,
0.007
),
AV1InvTxfm2dParam
(
ADST_DCT
,
TX_16X8
,
2
,
0.012
),
AV1InvTxfm2dParam
(
DCT_ADST
,
TX_16X8
,
2
,
0.024
),
AV1InvTxfm2dParam
(
ADST_ADST
,
TX_16X8
,
2
,
0.033
),
AV1InvTxfm2dParam
(
FLIPADST_DCT
,
TX_16X8
,
2
,
0.015
),
AV1InvTxfm2dParam
(
DCT_FLIPADST
,
TX_16X8
,
2
,
0.032
),
AV1InvTxfm2dParam
(
FLIPADST_FLIPADST
,
TX_16X8
,
2
,
0.032
),
AV1InvTxfm2dParam
(
ADST_FLIPADST
,
TX_16X8
,
2
,
0.033
),
AV1InvTxfm2dParam
(
FLIPADST_ADST
,
TX_16X8
,
2
,
0.032
),
#endif
AV1InvTxfm2dParam
(
FLIPADST_DCT
,
TX_4X4
,
2
,
0.002
),
AV1InvTxfm2dParam
(
DCT_FLIPADST
,
TX_4X4
,
2
,
0.002
),
AV1InvTxfm2dParam
(
FLIPADST_FLIPADST
,
TX_4X4
,
2
,
0.002
),
...
...
test/av1_txfm_test.h
View file @
d2db6586
...
...
@@ -78,21 +78,52 @@ static const int input_base = (1 << bd);
#if CONFIG_HIGHBITDEPTH
#if CONFIG_AV1_ENCODER
static
const
Fwd_Txfm2d_Func
fwd_txfm_func_ls
[
TX_SIZES
]
=
{
static
const
Fwd_Txfm2d_Func
fwd_txfm_func_ls
[
TX_SIZES_ALL
]
=
{
#if CONFIG_CHROMA_2X2
NULL
,
#endif
av1_fwd_txfm2d_4x4_c
,
av1_fwd_txfm2d_8x8_c
,
av1_fwd_txfm2d_16x16_c
,
av1_fwd_txfm2d_32x32_c
av1_fwd_txfm2d_4x4_c
,
av1_fwd_txfm2d_8x8_c
,
av1_fwd_txfm2d_16x16_c
,
av1_fwd_txfm2d_32x32_c
,
#if CONFIG_TX64X64
av1_fwd_txfm2d_64x64_c
,
#endif
av1_fwd_txfm2d_4x8_c
,
av1_fwd_txfm2d_8x4_c
,
av1_fwd_txfm2d_8x16_c
,
av1_fwd_txfm2d_16x8_c
,
av1_fwd_txfm2d_16x32_c
,
av1_fwd_txfm2d_32x16_c
,
NULL
,
NULL
,
NULL
,
NULL
,
};
#endif
static
const
Inv_Txfm2d_Func
inv_txfm_func_ls
[
TX_SIZES
]
=
{
static
const
Inv_Txfm2d_Func
inv_txfm_func_ls
[
TX_SIZES
_ALL
]
=
{
#if CONFIG_CHROMA_2X2
NULL
,
#endif
av1_inv_txfm2d_add_4x4_c
,
av1_inv_txfm2d_add_8x8_c
,
av1_inv_txfm2d_add_16x16_c
,
av1_inv_txfm2d_add_32x32_c
av1_inv_txfm2d_add_4x4_c
,
av1_inv_txfm2d_add_8x8_c
,
av1_inv_txfm2d_add_16x16_c
,
av1_inv_txfm2d_add_32x32_c
,
#if CONFIG_TX64X64
av1_inv_txfm2d_add_64x64_c
,
#endif
av1_inv_txfm2d_add_4x8_c
,
av1_inv_txfm2d_add_8x4_c
,
av1_inv_txfm2d_add_8x16_c
,
av1_inv_txfm2d_add_16x8_c
,
av1_inv_txfm2d_add_16x32_c
,
av1_inv_txfm2d_add_32x16_c
,
NULL
,
NULL
,
NULL
,
NULL
,
};
#endif // CONFIG_HIGHBITDEPTH
...
...
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