Search found 11 matches

by Cosmin
Mon Mar 28, 2016 9:12 am
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

You're right. But the problem is that your code it is so complex (for assembler I mean) and has many variables. Even if I use pointers it's not easy to find a way to parallelize the operations on the BGRA and to use ONLY SSE2 registers, A genius in assembler is needed for this. Unfortunately, I'm on...
by Cosmin
Sun Mar 27, 2016 12:46 pm
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

Yes, I know that loading and processing the 4 values (BGRA) as one is faster. But, before thinking of converting to asm, I tried this: var pc: PCardinal; ............... pc := @dbLine^[0]; pc^ := ((sbLine1[xp1] * w11 + sbLine1[xp2] * w21 + sbLine2[xp1] * w12 + sbLine2[xp2] * w22) shr 16) + ((sbLine1...
by Cosmin
Sun Mar 27, 2016 10:02 am
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

I started working to the asm conversion. And I understood why you recommended SSE2 - because MMX and SSE don't have 32 bit integer multiplication. For now I just tried to convert a code line: dbLine^[0] := (sbLine1[xp1] * w11 + sbLine1[xp2] * w21 + sbLine2[xp1] * w12 + sbLine2[xp2] * w22) shr 16; Th...
by Cosmin
Sat Mar 26, 2016 1:54 pm
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

Many GPUs these days have 2GB, some 4GB, some even more. Not so many but, like I said, my app should work on older hardware too. Anyway, you don't have to upload all the frames at once. Just create a queue of 3 frames, and delete frames from GPU RAM which were already displayed. That's how video pl...
by Cosmin
Sat Mar 26, 2016 1:38 pm
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

I'm really short on time atm. But if you want to do "real time" animation scaling, you might want to consider using Direct3D. GPUs are much faster at that sort of stuff than even MMX/SSE/SSE2 etc. Yes, I know. I already found something called DelphiX http://www.micrel.cz/Dx/ But the probl...
by Cosmin
Sat Mar 26, 2016 1:20 pm
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

Just so you can have an idea about what I'm trying to make, here is a testing app: https://drive.google.com/open?id=0ByKxAD_t9uvLVWZFYVlFQ1BzVlU And a testing file: https://drive.google.com/open?id=0ByKxAD_t9uvLZVRUa2tGZEYybGs Use the load button from the middle of the form to load the file and then...
by Cosmin
Sat Mar 26, 2016 10:51 am
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

Not sure about SSE2, my application has to work on older CPU's too.
Btw, AMD implementation of SSE2 doesn't work as expected. Until a year ago I had an AMD CPU. The difference in performance wasn't so high as with Intel CPU's when using SSE2 optimized code.
I'm hoping MMX has a better implementation.
by Cosmin
Sat Mar 26, 2016 10:18 am
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

Just asking a question:

I'm thinking of rewriting the Bilinear32 function in asm, maybe even with MMX/SSE.
Do you think it will perform a lot faster, so it would worth the work?
by Cosmin
Thu Mar 24, 2016 6:24 pm
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

Yes, it woks :)

Thank you very much.
by Cosmin
Thu Mar 24, 2016 2:37 pm
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

Re: fast resize transparent images

I understand.

But can you at least add some comments to the code from Bilinear32 function explaining what the code lines do? I know how to use bitmap's scanline function but I've never seen code like yours.
It would help me a lot.

Thank you in advance.
by Cosmin
Thu Mar 24, 2016 2:00 pm
Forum: madBasic
Topic: fast resize transparent images
Replies: 17
Views: 44523

fast resize transparent images

Hi. Very nice collection. I use it in Delphi XE8 update 1. OS: Windows 8.1. For example I need it for fast resizing many transparent bitmaps (pf32bit) and display them as animation. I tried the StretchBitmap function(s) from madGraphics.pas. But, although I can input 32 bit bitmaps and it outputs 32...