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
6f85cc66
Commit
6f85cc66
authored
Jul 11, 2014
by
hkuang
Committed by
Gerrit Code Review
Jul 11, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Add unit test to test tile decoding error handling."
parents
0999a2a2
c147cf3d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
20 deletions
+59
-20
test/decode_test_driver.cc
test/decode_test_driver.cc
+8
-3
test/decode_test_driver.h
test/decode_test_driver.h
+2
-0
test/invalid_file_test.cc
test/invalid_file_test.cc
+29
-11
test/test-data.sha1
test/test-data.sha1
+8
-0
test/test.mk
test/test.mk
+8
-6
vp9/decoder/vp9_decodeframe.c
vp9/decoder/vp9_decodeframe.c
+4
-0
No files found.
test/decode_test_driver.cc
View file @
6f85cc66
...
...
@@ -39,8 +39,8 @@ vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size,
return
res_dec
;
}
void
DecoderTest
::
RunLoop
(
CompressedVideoSource
*
video
)
{
vpx_codec_dec_cfg_t
dec_cfg
=
{
0
};
void
DecoderTest
::
RunLoop
(
CompressedVideoSource
*
video
,
const
vpx_codec_dec_cfg_t
&
dec_cfg
)
{
Decoder
*
const
decoder
=
codec_
->
CreateDecoder
(
dec_cfg
,
0
);
ASSERT_TRUE
(
decoder
!=
NULL
);
const
char
*
codec_name
=
decoder
->
GetDecoderName
();
...
...
@@ -82,7 +82,12 @@ void DecoderTest::RunLoop(CompressedVideoSource *video) {
while
((
img
=
dec_iter
.
Next
()))
DecompressedFrameHook
(
*
img
,
video
->
frame_number
());
}
delete
decoder
;
}
void
DecoderTest
::
RunLoop
(
CompressedVideoSource
*
video
)
{
vpx_codec_dec_cfg_t
dec_cfg
=
{
0
};
RunLoop
(
video
,
dec_cfg
);
}
}
// namespace libvpx_test
test/decode_test_driver.h
View file @
6f85cc66
...
...
@@ -119,6 +119,8 @@ class DecoderTest {
public:
// Main decoding loop
virtual
void
RunLoop
(
CompressedVideoSource
*
video
);
virtual
void
RunLoop
(
CompressedVideoSource
*
video
,
const
vpx_codec_dec_cfg_t
&
dec_cfg
);
// Hook to be called before decompressing every frame.
virtual
void
PreDecodeFrameHook
(
const
CompressedVideoSource
&
video
,
...
...
test/invalid_file_test.cc
View file @
6f85cc66
...
...
@@ -25,9 +25,13 @@
namespace
{
using
std
::
tr1
::
make_tuple
;
typedef
std
::
tr1
::
tuple
<
int
,
const
char
*>
DecodeParam
;
class
InvalidFileTest
:
public
::
libvpx_test
::
DecoderTest
,
public
::
libvpx_test
::
CodecTestWithParam
<
const
char
*
>
{
public
::
libvpx_test
::
CodecTestWithParam
<
DecodeParam
>
{
protected:
InvalidFileTest
()
:
DecoderTest
(
GET_PARAM
(
0
)),
res_file_
(
NULL
)
{}
...
...
@@ -66,8 +70,11 @@ class InvalidFileTest
};
TEST_P
(
InvalidFileTest
,
ReturnCode
)
{
const
std
::
string
filename
=
GET_PARAM
(
1
);
libvpx_test
::
CompressedVideoSource
*
video
=
NULL
;
const
DecodeParam
input
=
GET_PARAM
(
1
);
vpx_codec_dec_cfg_t
cfg
=
{
0
};
cfg
.
threads
=
std
::
tr1
::
get
<
0
>
(
input
);
const
std
::
string
filename
=
std
::
tr1
::
get
<
1
>
(
input
);
// Open compressed video file.
if
(
filename
.
substr
(
filename
.
length
()
-
3
,
3
)
==
"ivf"
)
{
...
...
@@ -90,24 +97,35 @@ TEST_P(InvalidFileTest, ReturnCode) {
OpenResFile
(
res_filename
);
// Decode frame, and check the md5 matching.
ASSERT_NO_FATAL_FAILURE
(
RunLoop
(
video
));
ASSERT_NO_FATAL_FAILURE
(
RunLoop
(
video
,
cfg
));
delete
video
;
}
const
char
*
const
kVP9InvalidFileTests
[]
=
{
"invalid-vp90-01.webm"
,
"invalid-vp90-02.webm"
,
"invalid-vp90-01
-v2
.webm"
,
"invalid-vp90-02
-v2
.webm"
,
"invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf"
,
"invalid-vp90-03.webm"
,
"invalid-vp90-03
-v2
.webm"
,
"invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"
,
"invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"
,
};
#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0]))
INSTANTIATE_TEST_CASE_P
(
VP9
,
InvalidFileTest
,
::
testing
::
Combine
(
::
testing
::
Values
(
static_cast
<
const
libvpx_test
::
CodecFactory
*>
(
&
libvpx_test
::
kVP9
)),
::
testing
::
Combine
(
::
testing
::
Values
(
1
),
::
testing
::
ValuesIn
(
kVP9InvalidFileTests
))));
VP9_INSTANTIATE_TEST_CASE
(
InvalidFileTest
,
::
testing
::
ValuesIn
(
kVP9InvalidFileTests
,
kVP9InvalidFileTests
+
NELEMENTS
(
kVP9InvalidFileTests
)));
const
DecodeParam
kMultiThreadedVP9InvalidFileTests
[]
=
{
make_tuple
(
4
,
"invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"
),
};
INSTANTIATE_TEST_CASE_P
(
VP9MultiThreaded
,
InvalidFileTest
,
::
testing
::
Combine
(
::
testing
::
Values
(
static_cast
<
const
libvpx_test
::
CodecFactory
*>
(
&
libvpx_test
::
kVP9
)),
::
testing
::
ValuesIn
(
kMultiThreadedVP9InvalidFileTests
)));
}
// namespace
test/test-data.sha1
View file @
6f85cc66
...
...
@@ -663,3 +663,11 @@ d3964f9dad9f60363c81b688324d95b4ec7c8038 invalid-vp90-2-00-quantizer-00.webm.iv
456d1493e52d32a5c30edf44a27debc1fa6b253a invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf.res
c123d1f9f02fb4143abb5e271916e3a3080de8f6 invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf
456d1493e52d32a5c30edf44a27debc1fa6b253a invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf.res
fe346136b9b8c1e6f6084cc106485706915795e4 invalid-vp90-01-v2.webm
25751f5d3b05ff03f0719ad42cd625348eb8961e invalid-vp90-01-v2.webm.res
d78e2fceba5ac942246503ec8366f879c4775ca5 invalid-vp90-02-v2.webm
8e2eff4af87d2b561cce2365713269e301457ef3 invalid-vp90-02-v2.webm.res
df1a1453feb3c00d7d89746c7003b4163523bff3 invalid-vp90-03-v2.webm
25dd58c22d23f75304d7ce7f69f4e5b02ef9119a invalid-vp90-03-v2.webm.res
d637297561dd904eb2c97a9015deeb31c4a1e8d2 invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm
3a204bdbeaa3c6458b77bcebb8366d107267f55d invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm.res
test/test.mk
View file @
6f85cc66
...
...
@@ -777,18 +777,20 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yuv444.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
vp91-2-04-yuv444.webm.md5
# Invalid files for testing libvpx error checking.
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-01.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-01.webm.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-02.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-02.webm.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-03.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-03.webm.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-01
-v2
.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-01
-v2
.webm.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-02
-v2
.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-02
-v2
.webm.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-03
-v2
.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-03
-v2
.webm.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.ivf.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf.res
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER)
+=
invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm.res
ifeq
($(CONFIG_DECODE_PERF_TESTS),yes)
# BBB VP9 streams
...
...
vp9/decoder/vp9_decodeframe.c
View file @
6f85cc66
...
...
@@ -858,6 +858,7 @@ static const uint8_t *decode_tiles(VP9Decoder *pbi,
decode_partition
(
tile_data
->
cm
,
&
tile_data
->
xd
,
&
tile
,
mi_row
,
mi_col
,
&
tile_data
->
bit_reader
,
BLOCK_64X64
);
}
pbi
->
mb
.
corrupted
|=
tile_data
->
xd
.
corrupted
;
}
// Loopfilter one row.
if
(
cm
->
lf
.
filter_level
)
{
...
...
@@ -1411,6 +1412,9 @@ void vp9_decode_frame(VP9Decoder *pbi,
}
else
{
debug_check_frame_counts
(
cm
);
}
}
else
{
vpx_internal_error
(
&
cm
->
error
,
VPX_CODEC_CORRUPT_FRAME
,
"Decode failed. Frame data is corrupted."
);
}
if
(
cm
->
refresh_frame_context
)
...
...
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