BUG=webm:1575
Unified · Split
| @@ -72,49 +72,57 @@ TEST_P(IDCTTest, TestAllZeros) { · 71 unmodified lines | ||
| 72 | 72 | |
| 73 | 73 | TEST_P(IDCTTest, TestAllOnes) { |
| 74 | 74 | input->Set(0); |
| 75 | − // When the first element is '4' it will fill the output buffer with '1'. | |
| 76 | − input->TopLeftPixel()[0] = 4; | |
| 77 | − predict->Set(0); | |
| 78 | − output->Set(0); | |
| 79 | − | |
| 80 | − ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(), | |
| 81 | − predict->stride(), output->TopLeftPixel(), | |
| 82 | − output->stride())); | |
| 83 | − | |
| 84 | − ASSERT_TRUE(output->CheckValues(1)); | |
| 85 | − ASSERT_TRUE(output->CheckPadding()); | |
| 75 | + if (input->TopLeftPixel() != NULL) { | |
| 76 | + // When the first element is '4' it will fill the output buffer with '1'. | |
| 77 | + input->TopLeftPixel()[0] = 4; | |
| 78 | + predict->Set(0); | |
| 79 | + output->Set(0); | |
| 80 | + | |
| 81 | + ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(), | |
| 82 | + predict->stride(), output->TopLeftPixel(), | |
| 83 | + output->stride())); | |
| 84 | + | |
| 85 | + ASSERT_TRUE(output->CheckValues(1)); | |
| 86 | + ASSERT_TRUE(output->CheckPadding()); | |
| 87 | + } else { | |
| 88 | + assert(0); | |
| 89 | + } | |
| 86 | 90 | } |
| 87 | 91 | |
| 88 | 92 | TEST_P(IDCTTest, TestAddOne) { |
| 89 | 93 | // Set the transform output to '1' and make sure it gets added to the |
| 90 | 94 | // prediction buffer. |
| 91 | 95 | input->Set(0); |
| 92 | − input->TopLeftPixel()[0] = 4; | |
| 93 | − output->Set(0); | |
| 94 | − | |
| 95 | − uint8_t *pred = predict->TopLeftPixel(); | |
| 96 | − for (int y = 0; y < 4; ++y) { | |
| 97 | − for (int x = 0; x < 4; ++x) { | |
| 98 | − pred[y * predict->stride() + x] = y * 4 + x; | |
| 96 | + if (input->TopLeftPixel() != NULL) { | |
| 97 | + input->TopLeftPixel()[0] = 4; | |
| 98 | + output->Set(0); | |
| 99 | + | |
| 100 | + uint8_t *pred = predict->TopLeftPixel(); | |
| 101 | + for (int y = 0; y < 4; ++y) { | |
| 102 | + for (int x = 0; x < 4; ++x) { | |
| 103 | + pred[y * predict->stride() + x] = y * 4 + x; | |
| 104 | + } | |
| 99 | 105 | } |
| 100 | − } | |
| 101 | 106 | |
| 102 | − ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(), | |
| 103 | − predict->stride(), output->TopLeftPixel(), | |
| 104 | − output->stride())); | |
| 107 | + ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(), | |
| 108 | + predict->stride(), output->TopLeftPixel(), | |
| 109 | + output->stride())); | |
| 105 | 110 | |
| 106 | − uint8_t const *out = output->TopLeftPixel(); | |
| 107 | − for (int y = 0; y < 4; ++y) { | |
| 108 | − for (int x = 0; x < 4; ++x) { | |
| 109 | − EXPECT_EQ(1 + y * 4 + x, out[y * output->stride() + x]); | |
| 111 | + uint8_t const *out = output->TopLeftPixel(); | |
| 112 | + for (int y = 0; y < 4; ++y) { | |
| 113 | + for (int x = 0; x < 4; ++x) { | |
| 114 | + EXPECT_EQ(1 + y * 4 + x, out[y * output->stride() + x]); | |
| 115 | + } | |
| 110 | 116 | } |
| 111 | − } | |
| 112 | 117 | |
| 113 | − if (HasFailure()) { | |
| 114 | − output->DumpBuffer(); | |
| 115 | − } | |
| 118 | + if (HasFailure()) { | |
| 119 | + output->DumpBuffer(); | |
| 120 | + } | |
| 116 | 121 | |
| 117 | − ASSERT_TRUE(output->CheckPadding()); | |
| 122 | + ASSERT_TRUE(output->CheckPadding()); | |
| 123 | + } else { | |
| 124 | + assert(0); | |
| 125 | + } | |
| 118 | 126 | } |
| 119 | 127 | |
| 120 | 128 | TEST_P(IDCTTest, TestWithData) { |