I also tried to convert it. I didn't inline it however and use nested procedures for all the pixel things and a bit other naughty things like operator overloading for pointer types...

It compiles in both fpc and delphi though. I didn't bother testing it but here it is if you want it
http://www.graesdal.dk/opengl/laks/hq2x.pas