Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: libretro resampler version. (Read 2555 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

libretro resampler version.

Question to Case/DEATH since I am no longer on IRC anymore.

1) Is the resampler you use from latest libretro-common Git?
2) Does it use the SSE2/AVX codepaths?
3) Done any other mods to it?

In my own code for einweggerat and things, I use the SSE2 code path (haven't bothered with AVX) and don't do any conversions to and from S16 apart from the S16 > float step needed for libretro core samples.

Re: libretro resampler version.

Reply #1
Case made a the original DSP in 2018, using current libretro version at the time. I took his code and improved it further, adopted own SIMD optimizations and improved speed. Output hasn't changed from original though.

One notable change is that my own SIMD layer is used instead of direct SSE intrinsics, so ARM Neon is utilized too if compiling for ARM, fb2k Mac & Mobile will benefit from this.

I'll look into releasing the source code when foobar2000 1.6.6 final is out.
Microsoft Windows: We can't script here, this is bat country.

Re: libretro resampler version.

Reply #2
Awesome, sounds great. I bet the libretro people would love to see your improvements, especially the original dev (Maister).
I can do a pull request on the repo integrating some of your changes, when this happens.

With some libretro stuff, we already use SSE2NEON.h as a wrapper to NEON intrinsics in some DSP maths (like for N64 vector processor emulation). I guess something similar could be done so that also Android end users of RetroArch could use it.

Re: libretro resampler version.

Reply #3
I have my own thing called "ppsimd" that wraps to either Neon, SSE, or emulation, depending on compile target. Currently supports float32x4 and float64x2 types.

I'm not sure if my mods (gone full C++) will backport to their source cleanly though.
Microsoft Windows: We can't script here, this is bat country.

 

Re: libretro resampler version.

Reply #4
Something you may add in the future, if you feel like it: Neon on aarch64 supports float32x8 and float64x4 too, I think. It also supports a single intrinsic or opcode to sum up all of the vectors of a single register into one output, instead of having to pick them one at a time and add them with conventional math, using the vaddv opcode or intrinsics.

For example, this simple resampler in libsidplayfp:

https://github.com/kode54/libsidplayfp/commit/61c9a88de942f1ec428177880cc87f39a957aa31

Doing it with vectors of ints, though. Wish I'd known that it uses such small ratios to begin with. (~99 samples to 1)