mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-09 06:16:14 +01:00
Code review for OpenMP code path
This commit is contained in:
@@ -250,12 +250,12 @@ namespace
|
||||
assert((y >= 0) && (y < int(image.height)));
|
||||
|
||||
size_t rowPitch = image.rowPitch;
|
||||
const uint8_t *pSrc = image.pixels + (y*rowPitch) + (x*sbpp);
|
||||
const uint8_t *pSrc = image.pixels + (size_t(y)*rowPitch) + (size_t(x)*sbpp);
|
||||
|
||||
uint8_t *pDest = result.pixels + (nb*blocksize);
|
||||
uint8_t *pDest = result.pixels + (size_t(nb)*blocksize);
|
||||
|
||||
size_t ph = std::min<size_t>(4, image.height - y);
|
||||
size_t pw = std::min<size_t>(4, image.width - x);
|
||||
size_t ph = std::min<size_t>(4, image.height - size_t(y));
|
||||
size_t pw = std::min<size_t>(4, image.width - size_t(x));
|
||||
assert(pw > 0 && ph > 0);
|
||||
|
||||
ptrdiff_t bytesLeft = pEnd - pSrc;
|
||||
@@ -268,19 +268,19 @@ namespace
|
||||
|
||||
if (ph > 1)
|
||||
{
|
||||
bytesToRead = std::min<size_t>(rowPitch, size_t(bytesLeft - rowPitch));
|
||||
bytesToRead = std::min<size_t>(rowPitch, size_t(bytesLeft) - rowPitch);
|
||||
if (!_LoadScanline(&temp[4], pw, pSrc + rowPitch, bytesToRead, format))
|
||||
fail = true;
|
||||
|
||||
if (ph > 2)
|
||||
{
|
||||
bytesToRead = std::min<size_t>(rowPitch, size_t(bytesLeft - rowPitch * 2));
|
||||
bytesToRead = std::min<size_t>(rowPitch, size_t(bytesLeft) - rowPitch * 2);
|
||||
if (!_LoadScanline(&temp[8], pw, pSrc + rowPitch * 2, bytesToRead, format))
|
||||
fail = true;
|
||||
|
||||
if (ph > 3)
|
||||
{
|
||||
bytesToRead = std::min<size_t>(rowPitch, size_t(bytesLeft - rowPitch * 3));
|
||||
bytesToRead = std::min<size_t>(rowPitch, size_t(bytesLeft) - rowPitch * 3);
|
||||
if (!_LoadScanline(&temp[12], pw, pSrc + rowPitch * 3, bytesToRead, format))
|
||||
fail = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user