View Single Post
Old 10th March 2020, 15:03   #68  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by StainlessS View Post
Code:
// ssS:
#ifdef _WIN64
            unsigned __int64 tmp;
            __asm
            {           // test if the whole area isn't just plain black
                mov edx, srcpitch
That asm part can safely be replaced by
Code:
  const BYTE* src2 = src - 8 * srcpitch - 1;
  unsigned int tmp = 0;
  for (int i = 0; i < 24; i++) {
    tmp |= *(unsigned int*)(src2);
    src2 += srcpitch;
  }
  tmp &= 0x00ffffff;
Checked, compiler generates the same or better asm code for that part. No need for special 64 bit tmp, 32 bit is enough.
pinterf is offline   Reply With Quote