Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
aom-rav1e
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
aom-rav1e
Commits
3080691e
Commit
3080691e
authored
9 years ago
by
Angie Chiang
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "add range_check for fdct in vp10"
parents
bdb8afbb
f78d6aa7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/test.mk
+2
-0
2 additions, 0 deletions
test/test.mk
test/vp10_dct_test.cc
+96
-0
96 additions, 0 deletions
test/vp10_dct_test.cc
vp10/encoder/dct.c
+688
-203
688 additions, 203 deletions
vp10/encoder/dct.c
with
786 additions
and
203 deletions
test/test.mk
+
2
−
0
View file @
3080691e
...
...
@@ -44,6 +44,8 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_lossless_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
vp9_end_to_end_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
vp9_ethread_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP10_ENCODER)
+=
vp10_dct_test.cc
LIBVPX_TEST_SRCS-yes
+=
decode_test_driver.cc
LIBVPX_TEST_SRCS-yes
+=
decode_test_driver.h
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS)
+=
encode_test_driver.cc
...
...
This diff is collapsed.
Click to expand it.
test/vp10_dct_test.cc
0 → 100644
+
96
−
0
View file @
3080691e
#include
<stdlib.h>
#include
"third_party/googletest/src/include/gtest/gtest.h"
#include
"test/acm_random.h"
#include
"test/util.h"
#include
"vp10/encoder/dct.c"
using
libvpx_test
::
ACMRandom
;
namespace
{
void
reference_dct_1d
(
const
double
*
in
,
double
*
out
,
int
size
)
{
const
double
PI
=
3.141592653589793238462643383279502884
;
const
double
kInvSqrt2
=
0.707106781186547524400844362104
;
for
(
int
k
=
0
;
k
<
size
;
++
k
)
{
out
[
k
]
=
0
;
// initialize out[k]
for
(
int
n
=
0
;
n
<
size
;
++
n
)
{
out
[
k
]
+=
in
[
n
]
*
cos
(
PI
*
(
2
*
n
+
1
)
*
k
/
(
2
*
size
));
}
if
(
k
==
0
)
out
[
k
]
=
out
[
k
]
*
kInvSqrt2
;
}
}
typedef
void
(
*
FdctFuncRef
)(
const
double
*
in
,
double
*
out
,
int
size
);
typedef
void
(
*
IdctFuncRef
)(
const
double
*
in
,
double
*
out
,
int
size
);
typedef
void
(
*
FdctFunc
)(
const
tran_low_t
*
in
,
tran_low_t
*
out
);
typedef
void
(
*
IdctFunc
)(
const
tran_low_t
*
in
,
tran_low_t
*
out
);
class
TransTestBase
{
public:
virtual
~
TransTestBase
()
{}
protected
:
double
max_error
;
int
txfmSize
;
FdctFunc
fwd_txfm
;
FdctFuncRef
fwd_txfm_ref
;
virtual
void
RunFwdAccuracyCheck
()
{
tran_low_t
*
input
=
new
tran_low_t
[
txfmSize
];
tran_low_t
*
output
=
new
tran_low_t
[
txfmSize
];
double
*
refInput
=
new
double
[
txfmSize
];
double
*
refOutput
=
new
double
[
txfmSize
];
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
const
int
count_test_block
=
5000
;
for
(
int
ti
=
0
;
ti
<
count_test_block
;
++
ti
)
{
for
(
int
ni
=
0
;
ni
<
txfmSize
;
++
ni
)
{
input
[
ni
]
=
rnd
.
Rand8
()
-
rnd
.
Rand8
();
refInput
[
ni
]
=
(
double
)
input
[
ni
];
}
fwd_txfm
(
input
,
output
);
fwd_txfm_ref
(
refInput
,
refOutput
,
txfmSize
);
for
(
int
ni
=
0
;
ni
<
txfmSize
;
++
ni
)
{
EXPECT_LE
(
abs
(
output
[
ni
]
-
(
tran_low_t
)
round
(
refOutput
[
ni
])),
max_error
);
}
}
delete
[]
input
;
delete
[]
output
;
delete
[]
refInput
;
delete
[]
refOutput
;
}
};
typedef
std
::
tr1
::
tuple
<
FdctFunc
,
FdctFuncRef
,
int
,
int
>
FdctParam
;
class
Vp10FwdDct
:
public
TransTestBase
,
public
::
testing
::
TestWithParam
<
FdctParam
>
{
public:
virtual
void
SetUp
()
{
fwd_txfm
=
GET_PARAM
(
0
);
fwd_txfm_ref
=
GET_PARAM
(
1
);
txfmSize
=
GET_PARAM
(
2
);
max_error
=
GET_PARAM
(
3
);
}
virtual
void
TearDown
(){}
};
TEST_P
(
Vp10FwdDct
,
RunFwdAccuracyCheck
)
{
RunFwdAccuracyCheck
();
}
INSTANTIATE_TEST_CASE_P
(
C
,
Vp10FwdDct
,
::
testing
::
Values
(
FdctParam
(
&
fdct4
,
&
reference_dct_1d
,
4
,
1
),
FdctParam
(
&
fdct8
,
&
reference_dct_1d
,
8
,
1
),
FdctParam
(
&
fdct16
,
&
reference_dct_1d
,
16
,
2
),
FdctParam
(
&
fdct32
,
&
reference_dct_1d
,
32
,
4
))
);
}
// namespace
This diff is collapsed.
Click to expand it.
vp10/encoder/dct.c
+
688
−
203
View file @
3080691e
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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