We do four blocks at a time when possible, but need to handle single blocks at a time for intra prediction. ~2.31x speedup over MMX for the DCT on Haswell. ~1.92x speedup over MMX for the IDCT on Haswell.
Showing the changes to test/encoder/EncUT_EncoderMbAux.cpp (1 of 7 files). Show all
Unified · Split
| @@ -147,8 +147,10 @@ static void Sub8x8DctAnchor (int16_t iDct[4][4][4], uint8_t* pPix1, uint8_t* pPi · 146 unmodified lines | |||
| 147 | } | 147 | } |
| 148 | static void TestDctT4 (PDctFunc func) { | 148 | static void TestDctT4 (PDctFunc func) { |
| 149 | int16_t iDctRef[4][4]; | 149 | int16_t iDctRef[4][4]; |
| 150 | uint8_t uiPix1[16 * FENC_STRIDE], uiPix2[16 * FDEC_STRIDE]; | 150 | CMemoryAlign cMemoryAlign (0); |
| 151 | int16_t iDct[16]; | 151 | ALLOC_MEMORY (uint8_t, uiPix1, 16 * FENC_STRIDE); |
| 152 | ALLOC_MEMORY (uint8_t, uiPix2, 16 * FDEC_STRIDE); | ||
| 153 | ALLOC_MEMORY (int16_t, iDct, 16); | ||
| 152 | for (int i = 0; i < 4; i++) { | 154 | for (int i = 0; i < 4; i++) { |
| 153 | for (int j = 0; j < 4; j++) { | 155 | for (int j = 0; j < 4; j++) { |
| 154 | uiPix1[i * FENC_STRIDE + j] = rand() & 255; | 156 | uiPix1[i * FENC_STRIDE + j] = rand() & 255; |
| @@ -160,6 +162,9 @@ static void TestDctT4 (PDctFunc func) { · 5 unmodified lines | |||
| 160 | for (int i = 0; i < 4; i++) | 162 | for (int i = 0; i < 4; i++) |
| 161 | for (int j = 0; j < 4; j++) | 163 | for (int j = 0; j < 4; j++) |
| 162 | EXPECT_EQ (iDctRef[j][i], iDct[i * 4 + j]); | 164 | EXPECT_EQ (iDctRef[j][i], iDct[i * 4 + j]); |
| 165 | FREE_MEMORY (uiPix1); | ||
| 166 | FREE_MEMORY (uiPix2); | ||
| 167 | FREE_MEMORY (iDct); | ||
| 163 | } | 168 | } |
| 164 | static void TestDctFourT4 (PDctFunc func) { | 169 | static void TestDctFourT4 (PDctFunc func) { |
| 165 | int16_t iDctRef[4][4][4]; | 170 | int16_t iDctRef[4][4][4]; |
| @@ -195,6 +200,10 @@ TEST (EncodeMbAuxTest, WelsDctT4_mmx) { · 29 unmodified lines | |||
| 195 | TestDctT4 (WelsDctT4_mmx); | 200 | TestDctT4 (WelsDctT4_mmx); |
| 196 | } | 201 | } |
| 197 | 202 | ||
| 203 | TEST (EncodeMbAuxTest, WelsDctT4_sse2) { | ||
| 204 | TestDctT4 (WelsDctT4_sse2); | ||
| 205 | } | ||
| 206 | |||
| 198 | TEST (EncodeMbAuxTest, WelsDctFourT4_sse2) { | 207 | TEST (EncodeMbAuxTest, WelsDctFourT4_sse2) { |
| 199 | TestDctFourT4 (WelsDctFourT4_sse2); | 208 | TestDctFourT4 (WelsDctFourT4_sse2); |
| 200 | } | 209 | } |