Quote Originally Posted by dmantione
Why not:

[pascal]
{$ifdef FPC}
type Pbyte=^byte;
{$else}
ppbyte = ^byte;

pbyte = record
value: ppbyte;
class operator Implicit(x: pbyte): ppbyte;
class operator Add(a: pbyte; x: int): pbyte;
class operator Subtract(a: pbyte; x: int): pbyte;
end;
{$endif}
[/pascal]
... so you don't need the ugly pointer arithmetic emulation on FPC's side?
why redeclaring PByte type anyways....Delphi allows direct pointer arithmetic only with PChars (not sure why though), so I changed it to a PChar which should work also under FPC because it allows pointer arithmetic on all pointer types (?)...

EDIT:
the function is not thread-safe because it has YUV1 and YUV2 variables declared as global even if they are local to the function....modified that (now it is threadsafe) and included $G- directive to speed up global memory access under Delphi....the link in my previous post has been updated....no pass this time....