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
a5654696
Commit
a5654696
authored
11 years ago
by
Alex Converse
Browse files
Options
Download
Patches
Plain Diff
Add an active map test.
Change-Id: I641a75dd75cd3c53a20eb4dbceb7a9b70a5a0e4d
parent
59853f8f
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
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
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
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/active_map_test.cc
+92
-0
test/active_map_test.cc
test/encode_test_driver.h
+10
-0
test/encode_test_driver.h
test/test.mk
+1
-0
test/test.mk
with
103 additions
and
0 deletions
test/active_map_test.cc
0 → 100644
+
92
−
0
View file @
a5654696
/*
* Copyright (c) 2014 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
<climits>
#include
<vector>
#include
"third_party/googletest/src/include/gtest/gtest.h"
#include
"test/codec_factory.h"
#include
"test/encode_test_driver.h"
#include
"test/i420_video_source.h"
#include
"test/util.h"
namespace
{
class
ActiveMapTest
:
public
::
libvpx_test
::
EncoderTest
,
public
::
libvpx_test
::
CodecTestWith2Params
<
libvpx_test
::
TestMode
,
int
>
{
protected:
static
const
int
kWidth
=
208
;
static
const
int
kHeight
=
144
;
ActiveMapTest
()
:
EncoderTest
(
GET_PARAM
(
0
))
{}
virtual
~
ActiveMapTest
()
{}
virtual
void
SetUp
()
{
InitializeConfig
();
SetMode
(
GET_PARAM
(
1
));
cpu_used_
=
GET_PARAM
(
2
);
}
virtual
void
PreEncodeFrameHook
(
::
libvpx_test
::
VideoSource
*
video
,
::
libvpx_test
::
Encoder
*
encoder
)
{
if
(
video
->
frame
()
==
1
)
{
encoder
->
Control
(
VP8E_SET_CPUUSED
,
cpu_used_
);
}
else
if
(
video
->
frame
()
==
3
)
{
vpx_active_map_t
map
=
{
0
};
uint8_t
active_map
[
9
*
13
]
=
{
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
0
,
1
,
0
,
1
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
0
,
1
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
0
,
1
,
0
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
,
0
,
1
,
1
,
1
,
1
,
0
,
};
map
.
cols
=
(
kWidth
+
15
)
/
16
;
map
.
rows
=
(
kHeight
+
15
)
/
16
;
ASSERT_EQ
(
map
.
cols
,
13u
);
ASSERT_EQ
(
map
.
rows
,
9u
);
map
.
active_map
=
active_map
;
encoder
->
Control
(
VP8E_SET_ACTIVEMAP
,
&
map
);
}
else
if
(
video
->
frame
()
==
15
)
{
vpx_active_map_t
map
=
{
0
};
map
.
cols
=
(
kWidth
+
15
)
/
16
;
map
.
rows
=
(
kHeight
+
15
)
/
16
;
map
.
active_map
=
NULL
;
encoder
->
Control
(
VP8E_SET_ACTIVEMAP
,
&
map
);
}
}
int
cpu_used_
;
};
TEST_P
(
ActiveMapTest
,
Test
)
{
// Validate that this non multiple of 64 wide clip encodes
cfg_
.
g_lag_in_frames
=
0
;
cfg_
.
rc_target_bitrate
=
400
;
cfg_
.
rc_resize_allowed
=
0
;
cfg_
.
g_pass
=
VPX_RC_ONE_PASS
;
cfg_
.
rc_end_usage
=
VPX_CBR
;
cfg_
.
kf_max_dist
=
90000
;
::
libvpx_test
::
I420VideoSource
video
(
"hantro_odd.yuv"
,
kWidth
,
kHeight
,
30
,
1
,
0
,
20
);
ASSERT_NO_FATAL_FAILURE
(
RunLoop
(
&
video
));
}
#define VP9_FACTORY \
static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)
VP9_INSTANTIATE_TEST_CASE
(
ActiveMapTest
,
::
testing
::
Values
(
::
libvpx_test
::
kRealTime
),
::
testing
::
Range
(
0
,
6
));
}
// namespace
This diff is collapsed.
Click to expand it.
test/encode_test_driver.h
+
10
−
0
View file @
a5654696
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
#include
"./vpx_config.h"
#include
"./vpx_config.h"
#include
"third_party/googletest/src/include/gtest/gtest.h"
#include
"third_party/googletest/src/include/gtest/gtest.h"
#include
"vpx/vpx_encoder.h"
#include
"vpx/vpx_encoder.h"
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
#include
"vpx/vp8cx.h"
#endif
namespace
libvpx_test
{
namespace
libvpx_test
{
...
@@ -128,6 +131,13 @@ class Encoder {
...
@@ -128,6 +131,13 @@ class Encoder {
ASSERT_EQ
(
VPX_CODEC_OK
,
res
)
<<
EncoderError
();
ASSERT_EQ
(
VPX_CODEC_OK
,
res
)
<<
EncoderError
();
}
}
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
void
Control
(
int
ctrl_id
,
vpx_active_map_t
*
arg
)
{
const
vpx_codec_err_t
res
=
vpx_codec_control_
(
&
encoder_
,
ctrl_id
,
arg
);
ASSERT_EQ
(
VPX_CODEC_OK
,
res
)
<<
EncoderError
();
}
#endif
void
set_deadline
(
unsigned
long
deadline
)
{
void
set_deadline
(
unsigned
long
deadline
)
{
deadline_
=
deadline
;
deadline_
=
deadline
;
}
}
...
...
This diff is collapsed.
Click to expand it.
test/test.mk
+
1
−
0
View file @
a5654696
...
@@ -29,6 +29,7 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += cq_test.cc
...
@@ -29,6 +29,7 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += cq_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER)
+=
keyframe_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER)
+=
keyframe_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER)
+=
external_frame_buffer_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER)
+=
external_frame_buffer_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
active_map_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
borders_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
borders_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
cpu_speed_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
cpu_speed_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
resize_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER)
+=
resize_test.cc
...
...
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