Speeding up hq2x / hq3x

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Speeding up hq2x / hq3x

Postby M-HT » 2019-4-15 @ 11:55

I tried speeding up hq2x/hq3x (mainly by using SIMD instructions to speed up function diffYUV - on x86/x64/armv6/armv7/armv8 CPUs).

When I tested just hq2x/hq3x outside of DOSBox, I measured a speed increase 55%-87% (x86/x64 versions). But when I tested whole DOSBox, the maximum speed increase was 2%.

I'm leaving the patches here in case someone is interested in them.

The first patch only changes existing code. The second patch adds (a lot of) code to add some more speed.

The SIMD instructions are enabled by default on x64/armv6/armv8 CPUs. On x86/armv7 they are disabled (because not all CPUs support them) and need to be enabled in file src/gui/render_templates_hq.h.
When using Microsoft Visual C++ compiler, the SIMD instructions can only be enabled on x86 CPUs (inline asm is not supported on other CPUs).
Attachments
diff-ver2-ver1.patch
Second patch
(87.68 KiB) Downloaded 3 times
diff-ver1-r4203.patch
First patch against svn revision 4203
(81.36 KiB) Downloaded 2 times
M-HT
Newbie
 
Posts: 66
Joined: 2008-9-01 @ 12:55
Location: Bratislava

Re: Speeding up hq2x / hq3x

Postby hail-to-the-ryzen » 2019-4-16 @ 01:33

Thank you for the very useful patches. Edit: reproduced above performance result, so removed question about benefit in rendering warcraft 2 start screens.
hail-to-the-ryzen
Member
 
Posts: 308
Joined: 2017-3-09 @ 01:34


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest