Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
182f99f0
Commit
182f99f0
authored
Nov 06, 2012
by
James Zern
Committed by
Gerrit Code Review
Nov 06, 2012
Browse files
Merge "fix test builds" into experimental
parents
4626faf1
2e3e6857
Changes
6
Hide whitespace changes
Inline
Side-by-side
test/boolcoder_test.cc
View file @
182f99f0
...
...
@@ -28,7 +28,7 @@ namespace {
const
int
num_tests
=
10
;
}
// namespace
TEST
(
VP
8
,
TestBitIO
)
{
TEST
(
VP
9
,
TestBitIO
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
for
(
int
n
=
0
;
n
<
num_tests
;
++
n
)
{
for
(
int
method
=
0
;
method
<=
7
;
++
method
)
{
// we generate various proba
...
...
@@ -54,7 +54,7 @@ TEST(VP8, TestBitIO) {
ACMRandom
bit_rnd
(
random_seed
);
BOOL_CODER
bw
;
uint8_t
bw_buffer
[
buffer_size
];
vp
8
_start_encode
(
&
bw
,
bw_buffer
);
vp
9
_start_encode
(
&
bw
,
bw_buffer
);
int
bit
=
(
bit_method
==
0
)
?
0
:
(
bit_method
==
1
)
?
1
:
0
;
for
(
int
i
=
0
;
i
<
bits_to_test
;
++
i
)
{
...
...
@@ -63,13 +63,13 @@ TEST(VP8, TestBitIO) {
}
else
if
(
bit_method
==
3
)
{
bit
=
bit_rnd
(
2
);
}
vp8_
encode_bool
(
&
bw
,
bit
,
static_cast
<
int
>
(
probas
[
i
]));
encode_bool
(
&
bw
,
bit
,
static_cast
<
int
>
(
probas
[
i
]));
}
vp
8
_stop_encode
(
&
bw
);
vp
9
_stop_encode
(
&
bw
);
BOOL_DECODER
br
;
vp
8dx
_start_decode
(
&
br
,
bw_buffer
,
buffer_size
);
vp
9
_start_decode
(
&
br
,
bw_buffer
,
buffer_size
);
bit_rnd
.
Reset
(
random_seed
);
for
(
int
i
=
0
;
i
<
bits_to_test
;
++
i
)
{
if
(
bit_method
==
2
)
{
...
...
@@ -77,7 +77,7 @@ TEST(VP8, TestBitIO) {
}
else
if
(
bit_method
==
3
)
{
bit
=
bit_rnd
(
2
);
}
GTEST_ASSERT_EQ
(
vp8dx_
decode_bool
(
&
br
,
probas
[
i
]),
bit
)
GTEST_ASSERT_EQ
(
decode_bool
(
&
br
,
probas
[
i
]),
bit
)
<<
"pos: "
<<
i
<<
" / "
<<
bits_to_test
<<
" bit_method: "
<<
bit_method
<<
" method: "
<<
method
;
...
...
test/dct16x16_test.cc
View file @
182f99f0
...
...
@@ -17,7 +17,7 @@
extern
"C"
{
#include
"vp9/common/entropy.h"
#include
"vp9/common/idct.h"
#include
"vp
9/encoder/dct
.h"
#include
"vp
x_rtcd
.h"
}
#include
"acm_random.h"
...
...
@@ -256,7 +256,7 @@ void reference_16x16_dct_2d(int16_t input[16*16], double output[16*16]) {
}
TEST
(
VP
8
Idct16x16Test
,
AccuracyCheck
)
{
TEST
(
VP
9
Idct16x16Test
,
AccuracyCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
const
int
count_test_block
=
1000
;
for
(
int
i
=
0
;
i
<
count_test_block
;
++
i
)
{
...
...
@@ -271,7 +271,7 @@ TEST(VP8Idct16x16Test, AccuracyCheck) {
reference_16x16_dct_2d
(
in
,
out_r
);
for
(
int
j
=
0
;
j
<
256
;
j
++
)
coeff
[
j
]
=
round
(
out_r
[
j
]);
vp
8
_short_idct16x16_c
(
coeff
,
out_c
,
32
);
vp
9
_short_idct16x16_c
(
coeff
,
out_c
,
32
);
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
const
int
diff
=
out_c
[
j
]
-
in
[
j
];
const
int
error
=
diff
*
diff
;
...
...
@@ -280,7 +280,7 @@ TEST(VP8Idct16x16Test, AccuracyCheck) {
<<
" at index "
<<
j
;
}
vp
8
_short_fdct16x16_c
(
in
,
out_c
,
32
);
vp
9
_short_fdct16x16_c
(
in
,
out_c
,
32
);
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
const
double
diff
=
coeff
[
j
]
-
out_c
[
j
];
const
double
error
=
diff
*
diff
;
...
...
@@ -291,7 +291,7 @@ TEST(VP8Idct16x16Test, AccuracyCheck) {
}
}
TEST
(
VP
8
Fdct16x16Test
,
AccuracyCheck
)
{
TEST
(
VP
9
Fdct16x16Test
,
AccuracyCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
int
max_error
=
0
;
double
total_error
=
0
;
...
...
@@ -306,8 +306,8 @@ TEST(VP8Fdct16x16Test, AccuracyCheck) {
test_input_block
[
j
]
=
rnd
.
Rand8
()
-
rnd
.
Rand8
();
const
int
pitch
=
32
;
vp
8
_short_fdct16x16_c
(
test_input_block
,
test_temp_block
,
pitch
);
vp
8
_short_idct16x16_c
(
test_temp_block
,
test_output_block
,
pitch
);
vp
9
_short_fdct16x16_c
(
test_input_block
,
test_temp_block
,
pitch
);
vp
9
_short_idct16x16_c
(
test_temp_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
const
int
diff
=
test_input_block
[
j
]
-
test_output_block
[
j
];
...
...
@@ -325,7 +325,7 @@ TEST(VP8Fdct16x16Test, AccuracyCheck) {
<<
"Error: 16x16 FDCT/IDCT has average roundtrip error > 1/10 per block"
;
}
TEST
(
VP
8
Fdct16x16Test
,
CoeffSizeCheck
)
{
TEST
(
VP
9
Fdct16x16Test
,
CoeffSizeCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
const
int
count_test_block
=
1000
;
for
(
int
i
=
0
;
i
<
count_test_block
;
++
i
)
{
...
...
@@ -342,8 +342,8 @@ TEST(VP8Fdct16x16Test, CoeffSizeCheck) {
input_extreme_block
[
j
]
=
255
;
const
int
pitch
=
32
;
vp
8
_short_fdct16x16_c
(
input_block
,
output_block
,
pitch
);
vp
8
_short_fdct16x16_c
(
input_extreme_block
,
output_extreme_block
,
pitch
);
vp
9
_short_fdct16x16_c
(
input_block
,
output_block
,
pitch
);
vp
9
_short_fdct16x16_c
(
input_extreme_block
,
output_extreme_block
,
pitch
);
// The minimum quant value is 4.
for
(
int
j
=
0
;
j
<
256
;
++
j
)
{
...
...
test/fdct4x4_test.cc
View file @
182f99f0
...
...
@@ -16,7 +16,7 @@
extern
"C"
{
#include
"vp9/common/idct.h"
#include
"vp
9/encoder/dct
.h"
#include
"vp
x_rtcd
.h"
}
#include
"acm_random.h"
...
...
@@ -26,7 +26,7 @@ using libvpx_test::ACMRandom;
namespace
{
TEST
(
Vp
8
FdctTest
,
SignBiasCheck
)
{
TEST
(
Vp
9
FdctTest
,
SignBiasCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
int16_t
test_input_block
[
16
];
int16_t
test_output_block
[
16
];
...
...
@@ -43,7 +43,7 @@ TEST(Vp8FdctTest, SignBiasCheck) {
// TODO(Yaowu): this should be converted to a parameterized test
// to test optimized versions of this function.
vp
8
_short_fdct4x4_c
(
test_input_block
,
test_output_block
,
pitch
);
vp
9
_short_fdct4x4_c
(
test_input_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
16
;
++
j
)
{
if
(
test_output_block
[
j
]
<
0
)
...
...
@@ -70,7 +70,7 @@ TEST(Vp8FdctTest, SignBiasCheck) {
// TODO(Yaowu): this should be converted to a parameterized test
// to test optimized versions of this function.
vp
8
_short_fdct4x4_c
(
test_input_block
,
test_output_block
,
pitch
);
vp
9
_short_fdct4x4_c
(
test_input_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
16
;
++
j
)
{
if
(
test_output_block
[
j
]
<
0
)
...
...
@@ -89,7 +89,7 @@ TEST(Vp8FdctTest, SignBiasCheck) {
}
};
TEST
(
Vp
8
FdctTest
,
RoundTripErrorCheck
)
{
TEST
(
Vp
9
FdctTest
,
RoundTripErrorCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
int
max_error
=
0
;
double
total_error
=
0
;
...
...
@@ -106,7 +106,7 @@ TEST(Vp8FdctTest, RoundTripErrorCheck) {
// TODO(Yaowu): this should be converted to a parameterized test
// to test optimized versions of this function.
const
int
pitch
=
8
;
vp
8
_short_fdct4x4_c
(
test_input_block
,
test_temp_block
,
pitch
);
vp
9
_short_fdct4x4_c
(
test_input_block
,
test_temp_block
,
pitch
);
for
(
int
j
=
0
;
j
<
16
;
++
j
)
{
if
(
test_temp_block
[
j
]
>
0
)
{
...
...
@@ -121,7 +121,7 @@ TEST(Vp8FdctTest, RoundTripErrorCheck) {
}
// Because the bitstream is not frozen yet, use the idct in the codebase.
vp
8
_short_idct4x4llm_c
(
test_temp_block
,
test_output_block
,
pitch
);
vp
9
_short_idct4x4llm_c
(
test_temp_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
16
;
++
j
)
{
const
int
diff
=
test_input_block
[
j
]
-
test_output_block
[
j
];
...
...
test/fdct8x8_test.cc
View file @
182f99f0
...
...
@@ -15,8 +15,8 @@
#include
"third_party/googletest/src/include/gtest/gtest.h"
extern
"C"
{
#include
"vp9/encoder/dct.h"
#include
"vp9/common/idct.h"
#include
"vpx_rtcd.h"
}
#include
"acm_random.h"
...
...
@@ -26,7 +26,7 @@ using libvpx_test::ACMRandom;
namespace
{
TEST
(
VP
8
Fdct8x8Test
,
SignBiasCheck
)
{
TEST
(
VP
9
Fdct8x8Test
,
SignBiasCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
int16_t
test_input_block
[
64
];
int16_t
test_output_block
[
64
];
...
...
@@ -41,7 +41,7 @@ TEST(VP8Fdct8x8Test, SignBiasCheck) {
for
(
int
j
=
0
;
j
<
64
;
++
j
)
test_input_block
[
j
]
=
rnd
.
Rand8
()
-
rnd
.
Rand8
();
vp
8
_short_fdct8x8_c
(
test_input_block
,
test_output_block
,
pitch
);
vp
9
_short_fdct8x8_c
(
test_input_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
64
;
++
j
)
{
if
(
test_output_block
[
j
]
<
0
)
...
...
@@ -66,7 +66,7 @@ TEST(VP8Fdct8x8Test, SignBiasCheck) {
for
(
int
j
=
0
;
j
<
64
;
++
j
)
test_input_block
[
j
]
=
(
rnd
.
Rand8
()
>>
4
)
-
(
rnd
.
Rand8
()
>>
4
);
vp
8
_short_fdct8x8_c
(
test_input_block
,
test_output_block
,
pitch
);
vp
9
_short_fdct8x8_c
(
test_input_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
64
;
++
j
)
{
if
(
test_output_block
[
j
]
<
0
)
...
...
@@ -85,7 +85,7 @@ TEST(VP8Fdct8x8Test, SignBiasCheck) {
}
};
TEST
(
VP
8
Fdct8x8Test
,
RoundTripErrorCheck
)
{
TEST
(
VP
9
Fdct8x8Test
,
RoundTripErrorCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
int
max_error
=
0
;
double
total_error
=
0
;
...
...
@@ -100,7 +100,7 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
test_input_block
[
j
]
=
rnd
.
Rand8
()
-
rnd
.
Rand8
();
const
int
pitch
=
16
;
vp
8
_short_fdct8x8_c
(
test_input_block
,
test_temp_block
,
pitch
);
vp
9
_short_fdct8x8_c
(
test_input_block
,
test_temp_block
,
pitch
);
for
(
int
j
=
0
;
j
<
64
;
++
j
){
if
(
test_temp_block
[
j
]
>
0
)
{
test_temp_block
[
j
]
+=
2
;
...
...
@@ -112,7 +112,7 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
test_temp_block
[
j
]
*=
4
;
}
}
vp
8
_short_idct8x8_c
(
test_temp_block
,
test_output_block
,
pitch
);
vp
9
_short_idct8x8_c
(
test_temp_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
64
;
++
j
)
{
const
int
diff
=
test_input_block
[
j
]
-
test_output_block
[
j
];
...
...
@@ -130,7 +130,7 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
<<
"Error: 8x8 FDCT/IDCT has average roundtrip error > 1/5 per block"
;
};
TEST
(
VP
8
Fdct8x8Test
,
ExtremalCheck
)
{
TEST
(
VP
9
Fdct8x8Test
,
ExtremalCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
int
max_error
=
0
;
double
total_error
=
0
;
...
...
@@ -145,8 +145,8 @@ TEST(VP8Fdct8x8Test, ExtremalCheck) {
test_input_block
[
j
]
=
rnd
.
Rand8
()
%
2
?
255
:
-
255
;
const
int
pitch
=
16
;
vp
8
_short_fdct8x8_c
(
test_input_block
,
test_temp_block
,
pitch
);
vp
8
_short_idct8x8_c
(
test_temp_block
,
test_output_block
,
pitch
);
vp
9
_short_fdct8x8_c
(
test_input_block
,
test_temp_block
,
pitch
);
vp
9
_short_idct8x8_c
(
test_temp_block
,
test_output_block
,
pitch
);
for
(
int
j
=
0
;
j
<
64
;
++
j
)
{
const
int
diff
=
test_input_block
[
j
]
-
test_output_block
[
j
];
...
...
test/idct8x8_test.cc
View file @
182f99f0
...
...
@@ -15,8 +15,8 @@
#include
"third_party/googletest/src/include/gtest/gtest.h"
extern
"C"
{
#include
"vp9/encoder/dct.h"
#include
"vp9/common/idct.h"
#include
"vpx_rtcd.h"
}
#include
"acm_random.h"
...
...
@@ -99,7 +99,7 @@ void reference_idct_2d(double input[64], int16_t output[64]) {
output
[
i
]
=
round
(
out2
[
i
]
/
32
);
}
TEST
(
VP
8
Idct8x8Test
,
AccuracyCheck
)
{
TEST
(
VP
9
Idct8x8Test
,
AccuracyCheck
)
{
ACMRandom
rnd
(
ACMRandom
::
DeterministicSeed
());
const
int
count_test_block
=
10000
;
for
(
int
i
=
0
;
i
<
count_test_block
;
++
i
)
{
...
...
@@ -112,7 +112,7 @@ TEST(VP8Idct8x8Test, AccuracyCheck) {
input
[
j
]
=
rnd
.
Rand8
()
-
rnd
.
Rand8
();
const
int
pitch
=
16
;
vp
8
_short_fdct8x8_c
(
input
,
output_c
,
pitch
);
vp
9
_short_fdct8x8_c
(
input
,
output_c
,
pitch
);
reference_dct_2d
(
input
,
output_r
);
for
(
int
j
=
0
;
j
<
64
;
++
j
)
{
...
...
@@ -140,7 +140,7 @@ TEST(VP8Idct8x8Test, AccuracyCheck) {
reference_dct_2d
(
input
,
output_r
);
for
(
int
j
=
0
;
j
<
64
;
++
j
)
coeff
[
j
]
=
round
(
output_r
[
j
]);
vp
8
_short_idct8x8_c
(
coeff
,
output_c
,
pitch
);
vp
9
_short_idct8x8_c
(
coeff
,
output_c
,
pitch
);
for
(
int
j
=
0
;
j
<
64
;
++
j
)
{
const
int
diff
=
output_c
[
j
]
-
input
[
j
];
const
int
error
=
diff
*
diff
;
...
...
vp9/common/blockd.h
View file @
182f99f0
...
...
@@ -467,7 +467,10 @@ static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd, const BLOCKD *b) {
TX_TYPE
tx_type
=
DCT_DCT
;
if
(
xd
->
mode_info_context
->
mbmi
.
mode
==
I8X8_PRED
&&
xd
->
q_index
<
ACTIVE_HT8
)
{
tx_type
=
txfm_map
(
pred_mode_conv
(
b
->
bmi
.
as_mode
.
first
));
// TODO(rbultje): MB_PREDICTION_MODE / B_PREDICTION_MODE should be merged
// or the relationship otherwise modified to address this type conversion.
tx_type
=
txfm_map
(
pred_mode_conv
(
(
MB_PREDICTION_MODE
)
b
->
bmi
.
as_mode
.
first
));
}
return
tx_type
;
}
...
...
Write
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!
Cancel
Please
register
or
sign in
to comment