diff options
author | Fox Caminiti <fox@foxcam.net> | 2022-08-18 23:11:29 -0400 |
---|---|---|
committer | Fox Caminiti <fox@foxcam.net> | 2022-08-18 23:11:29 -0400 |
commit | 8c5f06c37f3c267ecd8f867cd49765c366b5f47c (patch) | |
tree | f8ec31daa1e050c0f5205d32cebe68ce5df65f6f /bitmap_calls.cpp | |
parent | 9062e0aae9f2f576b7a237c28028aa6b09feee5e (diff) |
many additions
Diffstat (limited to 'bitmap_calls.cpp')
-rw-r--r-- | bitmap_calls.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bitmap_calls.cpp b/bitmap_calls.cpp index 5d549c2..a67cd0b 100644 --- a/bitmap_calls.cpp +++ b/bitmap_calls.cpp @@ -19,6 +19,7 @@ // never even did any measuring to see if there was any speedup-- but I // couldn't resist it. I like doing the software rendering stuff. + // TODO(fox): I could write an AVX version of this function, but it may not be // that much faster since we have to do a bit of uninterleaving. @@ -29,11 +30,11 @@ void Bitmap_ConvertPacking(void *Buffer, void *DestBuffer, uint16 Width, uint16 uint8 *Src = (uint8 *)Buffer; uint8 *Temp = (uint8 *)DestBuffer; uint32 RemainderPixels = Width % 4; + uint16 WidthP, HeightP; + Bitmap_CalcPackedDimensions(Width, Height, &WidthP, &HeightP); for (uint32 Y = 0; Y < Height; Y++) { uint32 X = 0; while (X < Width - RemainderPixels) { - uint16 WidthP, HeightP; - Bitmap_CalcPackedDimensions(Width, Height, &WidthP, &HeightP); uint32 XLookup = (X >> 2)*16 + (X % 4); uint32 YLookup = (Y >> 2)*(WidthP*4) + (Y % 4)*4; uint32 PixelToSeek = XLookup + YLookup; @@ -210,8 +211,6 @@ Bitmap_CopyToPointer(void *Input, void *Output, uint16 BytesPerPixel, uint64 Tot uint64 RemainderBytes = TotalBytes % ByteOffset; while (bytes <= TotalBytes - RemainderBytes) { - if (bytes > 2496*4) - int pp = 0; uint8 *Pixel = (uint8 *)Row + bytes; uint8 *Pixel2 = (uint8 *)Row2 + bytes; #if ARM |