History

Adjust superframe-is-optional unit test for vp10 superframe syntax.

Ronald S. Bultje committed 11 years ago

Commit aa112561 parent 6a032501 file · +20 −7Browse files

Unified · Split

test/superframe_test.cc+20−7
@@ -16,8 +16,13 @@ · 15 unmodified lines
1616
1717 namespace {
1818
19+const int kTestMode = 0;
20+const int kSuperframeSyntax = 1;
21+
22+typedef std::tr1::tuple<libvpx_test::TestMode,int> SuperframeTestParam;
23+
1924 class SuperframeTest : public ::libvpx_test::EncoderTest,
20− public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
25+ public ::libvpx_test::CodecTestWithParam<SuperframeTestParam> {
2126 protected:
2227 SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),
2328 last_sf_pts_(0) {}
@@ -25,9 +30,13 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 1 unmodified line
2530
2631 virtual void SetUp() {
2732 InitializeConfig();
28− SetMode(GET_PARAM(1));
33+ const SuperframeTestParam input = GET_PARAM(1);
34+ const libvpx_test::TestMode mode = std::tr1::get<kTestMode>(input);
35+ const int syntax = std::tr1::get<kSuperframeSyntax>(input);
36+ SetMode(mode);
2937 sf_count_ = 0;
3038 sf_count_max_ = INT_MAX;
39+ is_vp10_style_superframe_ = syntax;
3140 }
3241
3342 virtual void TearDown() {
@@ -50,7 +59,8 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 16 unmodified lines
5059 const uint8_t marker = buffer[pkt->data.frame.sz - 1];
5160 const int frames = (marker & 0x7) + 1;
5261 const int mag = ((marker >> 3) & 3) + 1;
53− const unsigned int index_sz = 2 + mag * frames;
62+ const unsigned int index_sz =
63+ 2 + mag * (frames - is_vp10_style_superframe_);
5464 if ((marker & 0xe0) == 0xc0 &&
5565 pkt->data.frame.sz >= index_sz &&
5666 buffer[pkt->data.frame.sz - index_sz] == marker) {
@@ -75,6 +85,7 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 18 unmodified lines
7585 return pkt;
7686 }
7787
88+ int is_vp10_style_superframe_;
7889 int sf_count_;
7990 int sf_count_max_;
8091 vpx_codec_cx_pkt_t modified_pkt_;
@@ -92,9 +103,11 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) { · 11 unmodified lines
92103 EXPECT_EQ(sf_count_, 1);
93104 }
94105
95−VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
96− ::libvpx_test::kTwoPassGood));
106+VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
107+ ::testing::Values(::libvpx_test::kTwoPassGood),
108+ ::testing::Values(0)));
97109
98−VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(
99− ::libvpx_test::kTwoPassGood));
110+VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
111+ ::testing::Values(::libvpx_test::kTwoPassGood),
112+ ::testing::Values(CONFIG_MISC_FIXES)));
100113 } // namespace

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t