This makes the code work properly on big endian. The MC case is similar to how it's done in the encoder. Neither of these should have any significant performance impact.
Showing the changes to codec/decoder/core/src/mc.cpp (1 of 3 files). Show all
Unified · Split
| @@ -326,11 +326,11 @@ static inline void_t McChromaWithFragMv_c (uint8_t* pSrc, int32_t iSrcStride, ui · 325 unmodified lines | ||
| 326 | 326 | int32_t i, j; |
| 327 | 327 | int32_t iA, iB, iC, iD; |
| 328 | 328 | uint8_t* pSrcNext = pSrc + iSrcStride; |
| 329 | − const uint32_t kuiABCD = * ((uint32_t*)g_kuiABCD[iMvY & 0x07][iMvX & 0x07]); | |
| 330 | − iA = (kuiABCD) & 0xff; | |
| 331 | − iB = (kuiABCD >> 8) & 0xff; | |
| 332 | − iC = (kuiABCD >> 16) & 0xff; | |
| 333 | − iD = (kuiABCD >> 24) & 0xff; | |
| 329 | + const uint8_t *pABCD = g_kuiABCD[iMvY & 0x07][iMvX & 0x07]; | |
| 330 | + iA = pABCD[0]; | |
| 331 | + iB = pABCD[1]; | |
| 332 | + iC = pABCD[2]; | |
| 333 | + iD = pABCD[3]; | |
| 334 | 334 | for (i = 0; i < iHeight; i++) { |
| 335 | 335 | for (j = 0; j < iWidth; j++) { |
| 336 | 336 | pDst[j] = (iA * pSrc[j] + iB * pSrc[j + 1] + iC * pSrcNext[j] + iD * pSrcNext[j + 1] + 32) >> 6; |