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
16 16
17namespace {17namespace {
18 18
19const int kTestMode = 0;
20const int kSuperframeSyntax = 1;
21
22typedef std::tr1::tuple<libvpx_test::TestMode,int> SuperframeTestParam;
23
19class SuperframeTest : public ::libvpx_test::EncoderTest,24class SuperframeTest : public ::libvpx_test::EncoderTest,
20 public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {25 public ::libvpx_test::CodecTestWithParam<SuperframeTestParam> {
21 protected:26 protected:
22 SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),27 SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),
23 last_sf_pts_(0) {}28 last_sf_pts_(0) {}
@@ -25,9 +30,13 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 1 unmodified line
25 30
26 virtual void SetUp() {31 virtual void SetUp() {
27 InitializeConfig();32 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);
29 sf_count_ = 0;37 sf_count_ = 0;
30 sf_count_max_ = INT_MAX;38 sf_count_max_ = INT_MAX;
39 is_vp10_style_superframe_ = syntax;
31 }40 }
32 41
33 virtual void TearDown() {42 virtual void TearDown() {
@@ -50,7 +59,8 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 16 unmodified lines
50 const uint8_t marker = buffer[pkt->data.frame.sz - 1];59 const uint8_t marker = buffer[pkt->data.frame.sz - 1];
51 const int frames = (marker & 0x7) + 1;60 const int frames = (marker & 0x7) + 1;
52 const int mag = ((marker >> 3) & 3) + 1;61 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_);
54 if ((marker & 0xe0) == 0xc0 &&64 if ((marker & 0xe0) == 0xc0 &&
55 pkt->data.frame.sz >= index_sz &&65 pkt->data.frame.sz >= index_sz &&
56 buffer[pkt->data.frame.sz - index_sz] == marker) {66 buffer[pkt->data.frame.sz - index_sz] == marker) {
@@ -75,6 +85,7 @@ class SuperframeTest : public ::libvpx_test::EncoderTest, · 18 unmodified lines
75 return pkt;85 return pkt;
76 }86 }
77 87
88 int is_vp10_style_superframe_;
78 int sf_count_;89 int sf_count_;
79 int sf_count_max_;90 int sf_count_max_;
80 vpx_codec_cx_pkt_t modified_pkt_;91 vpx_codec_cx_pkt_t modified_pkt_;
@@ -92,9 +103,11 @@ TEST_P(SuperframeTest, TestSuperframeIndexIsOptional) { · 11 unmodified lines
92 EXPECT_EQ(sf_count_, 1);103 EXPECT_EQ(sf_count_, 1);
93}104}
94 105
95VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(106VP9_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
96 ::libvpx_test::kTwoPassGood));107 ::testing::Values(::libvpx_test::kTwoPassGood),
108 ::testing::Values(0)));
97 109
98VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Values(110VP10_INSTANTIATE_TEST_CASE(SuperframeTest, ::testing::Combine(
99 ::libvpx_test::kTwoPassGood));111 ::testing::Values(::libvpx_test::kTwoPassGood),
112 ::testing::Values(CONFIG_MISC_FIXES)));
100} // namespace113} // 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