Skip to main content

Notice

Please be aware that much of the software linked to or mentioned on this forum is niche and therefore infrequently downloaded. Lots of anti-virus scanners and so-called malware detectors like to flag infrequently downloaded software as bad until it is either downloaded enough times, or its developer actually bothers with getting each individual release allow listed by every single AV vendor. You can do many people a great favor when encountering such a "problem" example by submitting them to your AV vendor for examination. For almost everything on this forum, it is a false positive.
Topic: libretro resampler version. (Read 528 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.

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.

 

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)

 
SimplePortal 1.0.0 RC1 © 2008-2021