Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
35c1ce69
Commit
35c1ce69
authored
Jan 21, 2016
by
Yaowu Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear out CONFIG_VP8 and CONFIG_VP9
Change-Id: I851da448695228fd0baa45ebf9690ce7aea8eb51
parent
4a1209dc
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
14 additions
and
2808 deletions
+14
-2808
build/make/Android.mk
build/make/Android.mk
+0
-6
build/make/rtcd.pl
build/make/rtcd.pl
+0
-7
test/blockiness_test.cc
test/blockiness_test.cc
+0
-229
test/consistency_test.cc
test/consistency_test.cc
+0
-224
test/datarate_test.cc
test/datarate_test.cc
+0
-62
test/decode_api_test.cc
test/decode_api_test.cc
+0
-93
test/encode_test_driver.cc
test/encode_test_driver.cc
+1
-16
test/postproc.sh
test/postproc.sh
+0
-63
test/register_state_check.h
test/register_state_check.h
+1
-1
test/test-data.mk
test/test-data.mk
+0
-745
test/test-data.sha1
test/test-data.sha1
+0
-767
test/test.mk
test/test.mk
+0
-5
test/test.mk.bk
test/test.mk.bk
+0
-96
test/test_libvpx.cc
test/test_libvpx.cc
+6
-12
test/test_vector_test.cc
test/test_vector_test.cc
+0
-192
test/test_vectors.cc
test/test_vectors.cc
+0
-250
test/test_vectors.h
test/test_vectors.h
+0
-20
test/tools_common.sh
test/tools_common.sh
+6
-20
No files found.
build/make/Android.mk
View file @
35c1ce69
...
...
@@ -168,12 +168,6 @@ endif
define
rtcd_dep_template
rtcd_dep_template_SRCS
:=
$(
addprefix
$(LOCAL_PATH)
/,
$(LOCAL_SRC_FILES)
)
rtcd_dep_template_SRCS
:=
$
$(rtcd_dep_template_SRCS:.neon=)
ifeq
($(CONFIG_VP8), yes)
$$(rtcd_dep_template_SRCS)
:
vp8_rtcd.h
endif
ifeq
($(CONFIG_VP9), yes)
$$(rtcd_dep_template_SRCS)
:
vp9_rtcd.h
endif
ifeq
($(CONFIG_VP10), yes)
$$(rtcd_dep_template_SRCS)
:
vp10_rtcd.h
endif
...
...
build/make/rtcd.pl
View file @
35c1ce69
...
...
@@ -320,14 +320,7 @@ EOF
print
<<EOF;
#if HAVE_DSPR2
void vpx_dsputil_static_init();
#if CONFIG_VP8
void dsputil_static_init();
#endif
vpx_dsputil_static_init();
#if CONFIG_VP8
dsputil_static_init();
#endif
#endif
}
#endif
...
...
test/blockiness_test.cc
deleted
100644 → 0
View file @
4a1209dc
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
#include "./vp10_rtcd.h"
#endif
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_mem/vpx_mem.h"
extern
"C"
double
vp9_get_blockiness
(
const
unsigned
char
*
img1
,
int
img1_pitch
,
const
unsigned
char
*
img2
,
int
img2_pitch
,
int
width
,
int
height
);
using
libvpx_test
::
ACMRandom
;
namespace
{
class
BlockinessTestBase
:
public
::
testing
::
Test
{
public:
BlockinessTestBase
(
int
width
,
int
height
)
:
width_
(
width
),
height_
(
height
)
{}
static
void
SetUpTestCase
()
{
source_data_
=
reinterpret_cast
<
uint8_t
*>
(
vpx_memalign
(
kDataAlignment
,
kDataBufferSize
));
reference_data_
=
reinterpret_cast
<
uint8_t
*>
(
vpx_memalign
(
kDataAlignment
,
kDataBufferSize
));
}
static
void
TearDownTestCase
()
{
vpx_free
(
source_data_
);
source_data_
=
NULL
;
vpx_free
(
reference_data_
);
reference_data_
=
NULL
;
}
virtual
void
TearDown
()
{
libvpx_test
::
ClearSystemState
();
}
protected:
// Handle frames up to 640x480
static
const
int
kDataAlignment
=
16
;
static
const
int
kDataBufferSize
=
640
*
480
;
virtual
void
SetUp
()
{
source_stride_
=
(
width_
+
31
)
&
~
31
;
reference_stride_
=
width_
*
2
;
rnd_
.
Reset
(
ACMRandom
::
DeterministicSeed
());
}
void
FillConstant
(
uint8_t
*
data
,
int
stride
,
uint8_t
fill_constant
,
int
width
,
int
height
)
{
for
(
int
h
=
0
;
h
<
height
;
++
h
)
{
for
(
int
w
=
0
;
w
<
width
;
++
w
)
{
data
[
h
*
stride
+
w
]
=
fill_constant
;
}
}
}
void
FillConstant
(
uint8_t
*
data
,
int
stride
,
uint8_t
fill_constant
)
{
FillConstant
(
data
,
stride
,
fill_constant
,
width_
,
height_
);
}
void
FillRandom
(
uint8_t
*
data
,
int
stride
,
int
width
,
int
height
)
{
for
(
int
h
=
0
;
h
<
height
;
++
h
)
{
for
(
int
w
=
0
;
w
<
width
;
++
w
)
{
data
[
h
*
stride
+
w
]
=
rnd_
.
Rand8
();
}
}
}
void
FillRandom
(
uint8_t
*
data
,
int
stride
)
{
FillRandom
(
data
,
stride
,
width_
,
height_
);
}
void
FillRandomBlocky
(
uint8_t
*
data
,
int
stride
)
{
for
(
int
h
=
0
;
h
<
height_
;
h
+=
4
)
{
for
(
int
w
=
0
;
w
<
width_
;
w
+=
4
)
{
FillRandom
(
data
+
h
*
stride
+
w
,
stride
,
4
,
4
);
}
}
}
void
FillCheckerboard
(
uint8_t
*
data
,
int
stride
)
{
for
(
int
h
=
0
;
h
<
height_
;
h
+=
4
)
{
for
(
int
w
=
0
;
w
<
width_
;
w
+=
4
)
{
if
(((
h
/
4
)
^
(
w
/
4
))
&
1
)
FillConstant
(
data
+
h
*
stride
+
w
,
stride
,
255
,
4
,
4
);
else
FillConstant
(
data
+
h
*
stride
+
w
,
stride
,
0
,
4
,
4
);
}
}
}
void
Blur
(
uint8_t
*
data
,
int
stride
,
int
taps
)
{
int
sum
=
0
;
int
half_taps
=
taps
/
2
;
for
(
int
h
=
0
;
h
<
height_
;
++
h
)
{
for
(
int
w
=
0
;
w
<
taps
;
++
w
)
{
sum
+=
data
[
w
+
h
*
stride
];
}
for
(
int
w
=
taps
;
w
<
width_
;
++
w
)
{
sum
+=
data
[
w
+
h
*
stride
]
-
data
[
w
-
taps
+
h
*
stride
];
data
[
w
-
half_taps
+
h
*
stride
]
=
(
sum
+
half_taps
)
/
taps
;
}
}
for
(
int
w
=
0
;
w
<
width_
;
++
w
)
{
for
(
int
h
=
0
;
h
<
taps
;
++
h
)
{
sum
+=
data
[
h
+
w
*
stride
];
}
for
(
int
h
=
taps
;
h
<
height_
;
++
h
)
{
sum
+=
data
[
w
+
h
*
stride
]
-
data
[(
h
-
taps
)
*
stride
+
w
];
data
[(
h
-
half_taps
)
*
stride
+
w
]
=
(
sum
+
half_taps
)
/
taps
;
}
}
}
int
width_
,
height_
;
static
uint8_t
*
source_data_
;
int
source_stride_
;
static
uint8_t
*
reference_data_
;
int
reference_stride_
;
ACMRandom
rnd_
;
};
#if CONFIG_VP9_ENCODER
typedef
std
::
tr1
::
tuple
<
int
,
int
>
BlockinessParam
;
class
BlockinessVP9Test
:
public
BlockinessTestBase
,
public
::
testing
::
WithParamInterface
<
BlockinessParam
>
{
public:
BlockinessVP9Test
()
:
BlockinessTestBase
(
GET_PARAM
(
0
),
GET_PARAM
(
1
))
{}
protected:
int
CheckBlockiness
()
{
return
vp9_get_blockiness
(
source_data_
,
source_stride_
,
reference_data_
,
reference_stride_
,
width_
,
height_
);
}
};
#endif // CONFIG_VP9_ENCODER
uint8_t
*
BlockinessTestBase
::
source_data_
=
NULL
;
uint8_t
*
BlockinessTestBase
::
reference_data_
=
NULL
;
#if CONFIG_VP9_ENCODER
TEST_P
(
BlockinessVP9Test
,
SourceBlockierThanReference
)
{
// Source is blockier than reference.
FillRandomBlocky
(
source_data_
,
source_stride_
);
FillConstant
(
reference_data_
,
reference_stride_
,
128
);
int
super_blocky
=
CheckBlockiness
();
EXPECT_EQ
(
0
,
super_blocky
)
<<
"Blocky source should produce 0 blockiness."
;
}
TEST_P
(
BlockinessVP9Test
,
ReferenceBlockierThanSource
)
{
// Source is blockier than reference.
FillConstant
(
source_data_
,
source_stride_
,
128
);
FillRandomBlocky
(
reference_data_
,
reference_stride_
);
int
super_blocky
=
CheckBlockiness
();
EXPECT_GT
(
super_blocky
,
0.0
)
<<
"Blocky reference should score high for blockiness."
;
}
TEST_P
(
BlockinessVP9Test
,
BlurringDecreasesBlockiness
)
{
// Source is blockier than reference.
FillConstant
(
source_data_
,
source_stride_
,
128
);
FillRandomBlocky
(
reference_data_
,
reference_stride_
);
int
super_blocky
=
CheckBlockiness
();
Blur
(
reference_data_
,
reference_stride_
,
4
);
int
less_blocky
=
CheckBlockiness
();
EXPECT_GT
(
super_blocky
,
less_blocky
)
<<
"A straight blur should decrease blockiness."
;
}
TEST_P
(
BlockinessVP9Test
,
WorstCaseBlockiness
)
{
// Source is blockier than reference.
FillConstant
(
source_data_
,
source_stride_
,
128
);
FillCheckerboard
(
reference_data_
,
reference_stride_
);
int
super_blocky
=
CheckBlockiness
();
Blur
(
reference_data_
,
reference_stride_
,
4
);
int
less_blocky
=
CheckBlockiness
();
EXPECT_GT
(
super_blocky
,
less_blocky
)
<<
"A straight blur should decrease blockiness."
;
}
#endif // CONFIG_VP9_ENCODER
using
std
::
tr1
::
make_tuple
;
//------------------------------------------------------------------------------
// C functions
#if CONFIG_VP9_ENCODER
const
BlockinessParam
c_vp9_tests
[]
=
{
make_tuple
(
320
,
240
),
make_tuple
(
318
,
242
),
make_tuple
(
318
,
238
),
};
INSTANTIATE_TEST_CASE_P
(
C
,
BlockinessVP9Test
,
::
testing
::
ValuesIn
(
c_vp9_tests
));
#endif
}
// namespace
test/consistency_test.cc
deleted
100644 → 0
View file @
4a1209dc
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
#include "./vp10_rtcd.h"
#endif
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_dsp/ssim.h"
#include "vpx_mem/vpx_mem.h"
extern
"C"
double
vpx_get_ssim_metrics
(
uint8_t
*
img1
,
int
img1_pitch
,
uint8_t
*
img2
,
int
img2_pitch
,
int
width
,
int
height
,
Ssimv
*
sv2
,
Metrics
*
m
,
int
do_inconsistency
);
using
libvpx_test
::
ACMRandom
;
namespace
{
class
ConsistencyTestBase
:
public
::
testing
::
Test
{
public:
ConsistencyTestBase
(
int
width
,
int
height
)
:
width_
(
width
),
height_
(
height
)
{}
static
void
SetUpTestCase
()
{
source_data_
[
0
]
=
reinterpret_cast
<
uint8_t
*>
(
vpx_memalign
(
kDataAlignment
,
kDataBufferSize
));
reference_data_
[
0
]
=
reinterpret_cast
<
uint8_t
*>
(
vpx_memalign
(
kDataAlignment
,
kDataBufferSize
));
source_data_
[
1
]
=
reinterpret_cast
<
uint8_t
*>
(
vpx_memalign
(
kDataAlignment
,
kDataBufferSize
));
reference_data_
[
1
]
=
reinterpret_cast
<
uint8_t
*>
(
vpx_memalign
(
kDataAlignment
,
kDataBufferSize
));
ssim_array_
=
new
Ssimv
[
kDataBufferSize
/
16
];
}
static
void
ClearSsim
()
{
memset
(
ssim_array_
,
0
,
kDataBufferSize
/
16
);
}
static
void
TearDownTestCase
()
{
vpx_free
(
source_data_
[
0
]);
source_data_
[
0
]
=
NULL
;
vpx_free
(
reference_data_
[
0
]);
reference_data_
[
0
]
=
NULL
;
vpx_free
(
source_data_
[
1
]);
source_data_
[
1
]
=
NULL
;
vpx_free
(
reference_data_
[
1
]);
reference_data_
[
1
]
=
NULL
;
delete
[]
ssim_array_
;
}
virtual
void
TearDown
()
{
libvpx_test
::
ClearSystemState
();
}
protected:
// Handle frames up to 640x480
static
const
int
kDataAlignment
=
16
;
static
const
int
kDataBufferSize
=
640
*
480
;
virtual
void
SetUp
()
{
source_stride_
=
(
width_
+
31
)
&
~
31
;
reference_stride_
=
width_
*
2
;
rnd_
.
Reset
(
ACMRandom
::
DeterministicSeed
());
}
void
FillRandom
(
uint8_t
*
data
,
int
stride
,
int
width
,
int
height
)
{
for
(
int
h
=
0
;
h
<
height
;
++
h
)
{
for
(
int
w
=
0
;
w
<
width
;
++
w
)
{
data
[
h
*
stride
+
w
]
=
rnd_
.
Rand8
();
}
}
}
void
FillRandom
(
uint8_t
*
data
,
int
stride
)
{
FillRandom
(
data
,
stride
,
width_
,
height_
);
}
void
Copy
(
uint8_t
*
reference
,
uint8_t
*
source
)
{
memcpy
(
reference
,
source
,
kDataBufferSize
);
}
void
Blur
(
uint8_t
*
data
,
int
stride
,
int
taps
)
{
int
sum
=
0
;
int
half_taps
=
taps
/
2
;
for
(
int
h
=
0
;
h
<
height_
;
++
h
)
{
for
(
int
w
=
0
;
w
<
taps
;
++
w
)
{
sum
+=
data
[
w
+
h
*
stride
];
}
for
(
int
w
=
taps
;
w
<
width_
;
++
w
)
{
sum
+=
data
[
w
+
h
*
stride
]
-
data
[
w
-
taps
+
h
*
stride
];
data
[
w
-
half_taps
+
h
*
stride
]
=
(
sum
+
half_taps
)
/
taps
;
}
}
for
(
int
w
=
0
;
w
<
width_
;
++
w
)
{
for
(
int
h
=
0
;
h
<
taps
;
++
h
)
{
sum
+=
data
[
h
+
w
*
stride
];
}
for
(
int
h
=
taps
;
h
<
height_
;
++
h
)
{
sum
+=
data
[
w
+
h
*
stride
]
-
data
[(
h
-
taps
)
*
stride
+
w
];
data
[(
h
-
half_taps
)
*
stride
+
w
]
=
(
sum
+
half_taps
)
/
taps
;
}
}
}
int
width_
,
height_
;
static
uint8_t
*
source_data_
[
2
];
int
source_stride_
;
static
uint8_t
*
reference_data_
[
2
];
int
reference_stride_
;
static
Ssimv
*
ssim_array_
;
Metrics
metrics_
;
ACMRandom
rnd_
;
};
#if CONFIG_VP9_ENCODER
typedef
std
::
tr1
::
tuple
<
int
,
int
>
ConsistencyParam
;
class
ConsistencyVP9Test
:
public
ConsistencyTestBase
,
public
::
testing
::
WithParamInterface
<
ConsistencyParam
>
{
public:
ConsistencyVP9Test
()
:
ConsistencyTestBase
(
GET_PARAM
(
0
),
GET_PARAM
(
1
))
{}
protected:
double
CheckConsistency
(
int
frame
)
{
EXPECT_LT
(
frame
,
2
)
<<
"Frame to check has to be less than 2."
;
return
vpx_get_ssim_metrics
(
source_data_
[
frame
],
source_stride_
,
reference_data_
[
frame
],
reference_stride_
,
width_
,
height_
,
ssim_array_
,
&
metrics_
,
1
);
}
};
#endif // CONFIG_VP9_ENCODER
uint8_t
*
ConsistencyTestBase
::
source_data_
[
2
]
=
{
NULL
,
NULL
};
uint8_t
*
ConsistencyTestBase
::
reference_data_
[
2
]
=
{
NULL
,
NULL
};
Ssimv
*
ConsistencyTestBase
::
ssim_array_
=
NULL
;
#if CONFIG_VP9_ENCODER
TEST_P
(
ConsistencyVP9Test
,
ConsistencyIsZero
)
{
FillRandom
(
source_data_
[
0
],
source_stride_
);
Copy
(
source_data_
[
1
],
source_data_
[
0
]);
Copy
(
reference_data_
[
0
],
source_data_
[
0
]);
Blur
(
reference_data_
[
0
],
reference_stride_
,
3
);
Copy
(
reference_data_
[
1
],
source_data_
[
0
]);
Blur
(
reference_data_
[
1
],
reference_stride_
,
3
);
double
inconsistency
=
CheckConsistency
(
1
);
inconsistency
=
CheckConsistency
(
0
);
EXPECT_EQ
(
inconsistency
,
0.0
)
<<
"Should have 0 inconsistency if they are exactly the same."
;
// If sources are not consistent reference frames inconsistency should
// be less than if the source is consistent.
FillRandom
(
source_data_
[
0
],
source_stride_
);
FillRandom
(
source_data_
[
1
],
source_stride_
);
FillRandom
(
reference_data_
[
0
],
reference_stride_
);
FillRandom
(
reference_data_
[
1
],
reference_stride_
);
CheckConsistency
(
0
);
inconsistency
=
CheckConsistency
(
1
);
Copy
(
source_data_
[
1
],
source_data_
[
0
]);
CheckConsistency
(
0
);
double
inconsistency2
=
CheckConsistency
(
1
);
EXPECT_LT
(
inconsistency
,
inconsistency2
)
<<
"Should have less inconsistency if source itself is inconsistent."
;
// Less of a blur should be less inconsistent than more blur coming off a
// a frame with no blur.
ClearSsim
();
FillRandom
(
source_data_
[
0
],
source_stride_
);
Copy
(
source_data_
[
1
],
source_data_
[
0
]);
Copy
(
reference_data_
[
0
],
source_data_
[
0
]);
Copy
(
reference_data_
[
1
],
source_data_
[
0
]);
Blur
(
reference_data_
[
1
],
reference_stride_
,
4
);
CheckConsistency
(
0
);
inconsistency
=
CheckConsistency
(
1
);
ClearSsim
();
Copy
(
reference_data_
[
1
],
source_data_
[
0
]);
Blur
(
reference_data_
[
1
],
reference_stride_
,
8
);
CheckConsistency
(
0
);
inconsistency2
=
CheckConsistency
(
1
);
EXPECT_LT
(
inconsistency
,
inconsistency2
)
<<
"Stronger Blur should produce more inconsistency."
;
}
#endif // CONFIG_VP9_ENCODER
using
std
::
tr1
::
make_tuple
;
//------------------------------------------------------------------------------
// C functions
#if CONFIG_VP9_ENCODER
const
ConsistencyParam
c_vp9_tests
[]
=
{
make_tuple
(
320
,
240
),
make_tuple
(
318
,
242
),
make_tuple
(
318
,
238
),
};
INSTANTIATE_TEST_CASE_P
(
C
,
ConsistencyVP9Test
,
::
testing
::
ValuesIn
(
c_vp9_tests
));
#endif
}
// namespace
test/datarate_test.cc
View file @
35c1ce69
...
...
@@ -682,68 +682,6 @@ TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) {
}
#endif
#if CONFIG_VP9_TEMPORAL_DENOISING
// Check basic datarate targeting, for a single bitrate, when denoiser is on.
TEST_P
(
DatarateTestVP9Large
,
DenoiserLevels
)
{
cfg_
.
rc_buf_initial_sz
=
500
;
cfg_
.
rc_buf_optimal_sz
=
500
;
cfg_
.
rc_buf_sz
=
1000
;
cfg_
.
rc_dropframe_thresh
=
1
;
cfg_
.
rc_min_quantizer
=
2
;
cfg_
.
rc_max_quantizer
=
56
;
cfg_
.
rc_end_usage
=
VPX_CBR
;
cfg_
.
g_lag_in_frames
=
0
;
::
libvpx_test
::
I420VideoSource
video
(
"hantro_collage_w352h288.yuv"
,
352
,
288
,
30
,
1
,
0
,
140
);
// For the temporal denoiser (#if CONFIG_VP9_TEMPORAL_DENOISING),
// there is only one denoiser mode: denoiserYonly(which is 1),
// but may add more modes in the future.
cfg_
.
rc_target_bitrate
=
300
;
ResetModel
();
// Turn on the denoiser.
denoiser_on_
=
1
;
ASSERT_NO_FATAL_FAILURE
(
RunLoop
(
&
video
));
ASSERT_GE
(
effective_datarate_
[
0
],
cfg_
.
rc_target_bitrate
*
0.85
)
<<
" The datarate for the file is lower than target by too much!"
;
ASSERT_LE
(
effective_datarate_
[
0
],
cfg_
.
rc_target_bitrate
*
1.15
)
<<
" The datarate for the file is greater than target by too much!"
;
}
// Check basic datarate targeting, for a single bitrate, when denoiser is off
// and on.
TEST_P
(
DatarateTestVP9Large
,
DenoiserOffOn
)
{
cfg_
.
rc_buf_initial_sz
=
500
;
cfg_
.
rc_buf_optimal_sz
=
500
;
cfg_
.
rc_buf_sz
=
1000
;
cfg_
.
rc_dropframe_thresh
=
1
;
cfg_
.
rc_min_quantizer
=
2
;
cfg_
.
rc_max_quantizer
=
56
;
cfg_
.
rc_end_usage
=
VPX_CBR
;
cfg_
.
g_lag_in_frames
=
0
;
::
libvpx_test
::
I420VideoSource
video
(
"hantro_collage_w352h288.yuv"
,
352
,
288
,
30
,
1
,
0
,
299
);
// For the temporal denoiser (#if CONFIG_VP9_TEMPORAL_DENOISING),
// there is only one denoiser mode: denoiserYonly(which is 1),
// but may add more modes in the future.
cfg_
.
rc_target_bitrate
=
300
;
ResetModel
();
// The denoiser is off by default.
denoiser_on_
=
0
;
// Set the offon test flag.
denoiser_offon_test_
=
1
;
denoiser_offon_period_
=
100
;
ASSERT_NO_FATAL_FAILURE
(
RunLoop
(
&
video
));
ASSERT_GE
(
effective_datarate_
[
0
],
cfg_
.
rc_target_bitrate
*
0.85
)
<<
" The datarate for the file is lower than target by too much!"
;
ASSERT_LE
(
effective_datarate_
[
0
],
cfg_
.
rc_target_bitrate
*
1.15
)
<<
" The datarate for the file is greater than target by too much!"
;
}
#endif // CONFIG_VP9_TEMPORAL_DENOISING
class
DatarateOnePassCbrSvc
:
public
::
libvpx_test
::
EncoderTest
,
public
::
libvpx_test
::
CodecTestWith2Params
<
libvpx_test
::
TestMode
,
int
>
{
public:
...
...
test/decode_api_test.cc
View file @
35c1ce69
...
...
@@ -21,12 +21,6 @@ namespace {
TEST
(
DecodeAPI
,
InvalidParams
)
{
static
const
vpx_codec_iface_t
*
kCodecs
[]
=
{
#if CONFIG_VP8_DECODER
&
vpx_codec_vp8_dx_algo
,
#endif
#if CONFIG_VP9_DECODER
&
vpx_codec_vp9_dx_algo
,
#endif
#if CONFIG_VP10_DECODER
&
vpx_codec_vp10_dx_algo
,
#endif
...
...
@@ -61,91 +55,4 @@ TEST(DecodeAPI, InvalidParams) {
}
}
#if CONFIG_VP8_DECODER
TEST
(
DecodeAPI
,
OptionalParams
)
{
vpx_codec_ctx_t
dec
;
#if CONFIG_ERROR_CONCEALMENT
EXPECT_EQ
(
VPX_CODEC_OK
,
vpx_codec_dec_init
(
&
dec
,
&
vpx_codec_vp8_dx_algo
,
NULL
,
VPX_CODEC_USE_ERROR_CONCEALMENT
));
#else
EXPECT_EQ
(
VPX_CODEC_INCAPABLE
,
vpx_codec_dec_init
(
&
dec
,
&
vpx_codec_vp8_dx_algo
,
NULL
,
VPX_CODEC_USE_ERROR_CONCEALMENT
));
#endif // CONFIG_ERROR_CONCEALMENT
}
#endif // CONFIG_VP8_DECODER
#if CONFIG_VP9_DECODER
// Test VP9 codec controls after a decode error to ensure the code doesn't
// misbehave.
void
TestVp9Controls
(
vpx_codec_ctx_t
*
dec
)
{
static
const
int
kControls
[]
=
{
VP8D_GET_LAST_REF_UPDATES
,
VP8D_GET_FRAME_CORRUPTED
,
VP9D_GET_DISPLAY_SIZE
,
VP9D_GET_FRAME_SIZE
};
int
val
[
2
];
for
(
int
i
=
0
;
i
<
NELEMENTS
(
kControls
);
++
i
)
{
const
vpx_codec_err_t
res
=
vpx_codec_control_
(
dec
,
kControls
[
i
],
val
);
switch
(
kControls
[
i
])
{
case
VP8D_GET_FRAME_CORRUPTED
:
EXPECT_EQ
(
VPX_CODEC_ERROR
,
res
)
<<
kControls
[
i
];
break
;
default:
EXPECT_EQ
(
VPX_CODEC_OK
,
res
)
<<
kControls
[
i
];
break
;
}
EXPECT_EQ
(
VPX_CODEC_INVALID_PARAM
,
vpx_codec_control_
(
dec
,
kControls
[
i
],
NULL
));
}