Open source high-quality pro audio sample rate converter library released from Voxengo

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Tale wrote:
Aleksey Vaneev wrote:As I've replied earlier, 2147483648 does NOT fit into 32-bit "int" range. Your test was flawed.
Sorry, I seem to have missed your earlier reply. My confusion came from the "function treats the input value as unsigned", but you are absolutely right. Thanks for explaining (twice). :)
Yes, I understand your confusion, but the function indeed treats it as unsigned integer (will return 32 for -2147483648), but it does not mean you can pass 64-bit number into it. When you pass 2147483648 as "int" the behavior is compiler-dependent it seems.
Image

Post

Aleksey Vaneev wrote:I'm currently working on a better windowing function, and I think the number of taps can be reduced further down to 34 or 32 samples, that way it will be 10-15% faster.
Cool! BTW, I like the new clear() method; I can now reuse the resampler object as long as the sample rates don't change. :cool:

So, what would you say is the current development stage? From the SVN changelog I gather it is sill in alpha stage, which I guess means I should probably not yet release a r8brained (beta) version of Combo Model V/F...

Post

Yes, it's alpha with some development going on. The resampler is fully working, I do not think there will be serious changes to the code from now on. Note on MinPhase filtering - it's available, but it is not fully complete yet.

A "continous sample rate change" resampler will probably be a separate class anyway, if I ever get to implementing it.
Image

Post

The reduction in the number of taps in the interpolation filters should be a transparent change.
Image

Post

Thanks for your reply. I am not too worried about possible future changes, I'll take them as they come. Anyway, I think I will be including r8brain in the next beta of ComboV/F.

Post

Tale wrote:Anyway, I think I will be including r8brain in the next beta of ComboV/F.
Done!

Post

Released v0.6. Huge achievements in all aspects - quality and speed.

CDSPResampler is now a templated class.

While this may seem impossible, in r8brain-free-src the decent quality full 16-bit audio resampling can be achieved by setting CInterpClass to "CDSPFracInterpolator< 14, 22, 9 >" and using ReqTransBand=3, ReqAtten=96. Such mode of operation is ultra fast: achieves 20 Mflops on a single core of Intel i7-4770K processor.
Image

Post

Thanks for the update. :)

I did some quick profiling, resampling an 8-second sine sweep from 96 to 44.1 kHz, and the updated code was ~9% faster while delivering virtually the same output (maximum difference: -138 dB).

I have also profiled the resampler with the "14:22" fractional delay filter, and it was ~26% faster than with the default filter settings. The maximum difference between the "14:22" and the default filter was -105 dB, so I'd say that even with the "14:22" filter r8brain still delivers more than decent quality. :cool:

Post

Tale, your testing environment seems to have a lot of overhead - e.g. hard disk read/write. Here, 14:22 is 60% faster than the default setting.
Image

Post

Er... I don't think so, but I might well be doing something wrong. Here my resample code:

Code: Select all

void rs(const double* src, double src_srate, int src_len, double* dest, double dest_srate, int dest_len)
{
	const int block_len = 64;

	double ReqTransBand = 3.;
	double ReqAtten = 96.;

	CDSPResampler<> rs(src_srate, dest_srate, ReqTransBand, ReqAtten, block_len);

	unsigned __int64 t = 0;
	while (dest_len > 0)
	{
		double buf[block_len], *p = buf;
		int n = block_len;
		if (n > src_len) n = src_len;
		for (int i = 0; i < n; ++i) *p++ = *src++;
		if (n < block_len) memset(p, 0, (block_len - n) * sizeof(double));
		src_len -= n;

		unsigned __int64 start, end;
		start = __rdtsc();
		n = rs.process(buf, block_len, p);
		end = __rdtsc();
		t += end - start;

		if (n > dest_len) n = dest_len;
		for (int i = 0; i < n; ++i) *dest++ = *p++;
		dest_len -= n;
	}

	printf("%I64u\n", t);
}
When I use this to resample 8 seconds (in memory) of 96 to 44.1 kHz, it outputs e.g. 150873373 for 14:22 and 198643515 for 28:800, which makes 14:22 1.3x (or 24%) faster (right?). I am compiling with full optimizations (/O2).

Post

That looks correct. Well, maybe it depends on the compiler. Intel C++ really takes advantage of all higher-order optimizations I've did.
Image

Post

Could well be. I used the MSVC 2010 compiler on x64, which is pretty good, but the Intel compiler is better, especially with IPP. It could also depend on the processor, mine was a Core2 Duo E6550 2.33 GHz.

Post

I've just released v0.7 which implements even more optimizations, uses 2nd order interpolation for filters. However, it requires much bigger filter bank for filters longer than 30 taps. But I guess for "ultra high quality" resampling with 38 taps, 14MB filter bank is not much of a problem.
Image

Post

Note that 14-tap resampler now needs at least 41-filter bank.
Image

Post

Tale, on the difference between 14 and 28 taps: here I can measure the performance increase to be around 40% only, so your test is close to my results.
Image

Post Reply

Return to “DSP and Plugin Development”