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