ArtDen: I've modified your byte swapping strategy in Utils.cpp and am getting good results on both intel and powerpc (rosetta emulation). Here's the diff from the version of Utils.cpp referenced in your previous post:
880a881,888
>
> inline unsigned short swap_bytes_uint16(unsigned short src)
> {
> unsigned char upper = ((src & 0xff00) >> 8);
> unsigned char lower = (src & 0x00ff);
> return ((lower << 8) | upper);
> }
>
901,908c909,910
< #ifdef BIG_ENDIAN
< if (vbits < 10)
< {
< vbits += 16;
< const unsigned char *ptr = reinterpret_cast<const unsigned char*>(dp);
< buf = (buf << 16) + ((unsigned short)(*(ptr+0)) << 8) + (unsigned short)(*(ptr+1));
< dp++;
< }
---
> #if qDNGBigEndian
> if (vbits < 10) buf = (vbits += 16, (buf << 16) + swap_bytes_uint16(*dp++));
910c912
< if (vbits < 10) buf = (vbits += 16, (buf << 16) + *dp++);
---
> if (vbits < 10) buf = (vbits += 16, (buf << 16) + *dp++);
I reused the qDNGBigEndian define instead of BIG_ENDIAN since it is
automatically setup correctly by the DNG SDK header logic.
I've uploaded the changed version to
http://spebbe.googlepages.com/Utils.cppI'll publish a universal binary on the main page later today.
As a bonus, this version will also get a nice icon :-)
image13: Would you mind trying this version also, just to make sure that it works
on a real silicon powerpc and not just rosetta?